virgl: Fix stack overflow in virgl_bind_sampler_states

Triggered on hosts with more than 32 samplers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9207
Fixes: 63c4c559 ("virgl: obtain supported number of shader sampler views from host")
Signed-off-by: Tim Pambor <tp@osasysteme.de>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23678>
(cherry picked from commit 1ad79cb84f)
This commit is contained in:
Tim Pambor 2023-06-15 15:06:28 +00:00 committed by Eric Engestrom
parent f7ac8d19c1
commit 73c5434c25
2 changed files with 2 additions and 2 deletions

View file

@ -1336,7 +1336,7 @@
"description": "virgl: Fix stack overflow in virgl_bind_sampler_states",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "63c4c559cbce22102bdac695db1cb1bf229f68c3"
},

View file

@ -1182,7 +1182,7 @@ static void virgl_bind_sampler_states(struct pipe_context *ctx,
void **samplers)
{
struct virgl_context *vctx = virgl_context(ctx);
uint32_t handles[32];
uint32_t handles[PIPE_MAX_SHADER_SAMPLER_VIEWS];
int i;
for (i = 0; i < num_samplers; i++) {
handles[i] = (unsigned long)(samplers[i]);