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: ea14579f3d ("nir: handle primitives with adjacency")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24780>
This commit is contained in:
Alyssa Rosenzweig
2023-08-18 11:58:01 -04:00
committed by Marge Bot
parent fe4208ed4c
commit 558e36f641

View File

@@ -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);