nir: make var arrays large enough in `nir_create_passthrough_gs`
authorantonino <antonino.maniscalco@collabora.com>
Fri, 5 May 2023 16:13:32 +0000 (18:13 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 15 May 2023 11:04:41 +0000 (11:04 +0000)
Because each location has 4 possible different values for location_frac
the arrays need to br 4x the size.

Fixes: d0342e28 ("nir: Add helper to create passthrough GS shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22871>

src/compiler/nir/nir_passthrough_gs.c

index 4f3b27e..f24ac71 100644 (file)
@@ -178,8 +178,8 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options,
 
    bool handle_flat = nir->info.gs.output_primitive == SHADER_PRIM_LINE_STRIP &&
                       nir->info.gs.output_primitive != original_our_prim;
-   nir_variable *in_vars[VARYING_SLOT_MAX];
-   nir_variable *out_vars[VARYING_SLOT_MAX];
+   nir_variable *in_vars[VARYING_SLOT_MAX * 4];
+   nir_variable *out_vars[VARYING_SLOT_MAX * 4];
    unsigned num_inputs = 0, num_outputs = 0;
 
    /* Create input/output variables. */