From 558e36f64196ec734e4c7502db491f56f76118cd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 18 Aug 2023 11:58:01 -0400 Subject: [PATCH] nir/passthrough_gs: Fix array size Triangle strips with adjacency have 6 vertices input, so we need an array big enough for all 6 vertices to avoid overflow. Fixes passthrough GS generated for KHR-GLES31.core.draw_indirect.basic-mode-*-triangle*adj*. Fixes: ea14579f3dc ("nir: handle primitives with adjacency") Signed-off-by: Alyssa Rosenzweig Reviewed-by: Antonino Maniscalco Part-of: --- src/compiler/nir/nir_passthrough_gs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_passthrough_gs.c b/src/compiler/nir/nir_passthrough_gs.c index 0386d1e5223..65270d597e5 100644 --- a/src/compiler/nir/nir_passthrough_gs.c +++ b/src/compiler/nir/nir_passthrough_gs.c @@ -170,7 +170,7 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options, nir_variable *in = nir_variable_clone(var, nir); ralloc_free(in->name); in->name = ralloc_strdup(in, name); - in->type = glsl_array_type(var->type, 4, false); + in->type = glsl_array_type(var->type, 6, false); in->data.mode = nir_var_shader_in; nir_shader_add_variable(nir, in);