glsl: fix location and component packing validation on patches
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 17 May 2016 01:29:40 +0000 (11:29 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Tue, 17 May 2016 05:06:12 +0000 (15:06 +1000)
These varyings have a separate location domain from per-vertex varyings
and need to be handled separately.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/compiler/glsl/link_varyings.cpp
src/compiler/shader_enums.h

index 003b9d46abce18f378a10af33ef3e83cfaf2921c..572aba9e8b3100858edd351a3d728f314e254c6f 100644 (file)
@@ -350,7 +350,8 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
                                  gl_shader *producer, gl_shader *consumer)
 {
    glsl_symbol_table parameters;
-   ir_variable *explicit_locations[MAX_VARYING][4] = { {NULL, NULL} };
+   ir_variable *explicit_locations[MAX_VARYINGS_INCL_PATCH][4] =
+      { {NULL, NULL} };
 
    /* Find all shader outputs in the "producer" stage.
     */
index e93345d973dd7e8e330a1e5df0f21d9460188417..df3124eb6b38cf14cd8fa237dd0253e0b7e7a523 100644 (file)
@@ -255,6 +255,7 @@ typedef enum
 #define VARYING_SLOT_MAX       (VARYING_SLOT_VAR0 + MAX_VARYING)
 #define VARYING_SLOT_PATCH0    (VARYING_SLOT_MAX)
 #define VARYING_SLOT_TESS_MAX  (VARYING_SLOT_PATCH0 + MAX_VARYING)
+#define MAX_VARYINGS_INCL_PATCH (VARYING_SLOT_TESS_MAX - VARYING_SLOT_VAR0)
 
 const char *gl_varying_slot_name(gl_varying_slot slot);