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>
This commit is contained in:
Tim Pambor 2023-06-15 15:06:28 +00:00 committed by Marge Bot
parent 0e726c63ff
commit 1ad79cb84f

View file

@ -1181,7 +1181,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]);