diff options
author | Dave Airlie <[email protected]> | 2017-06-12 00:45:36 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-06-14 12:47:58 +0100 |
commit | 538975fdf8c2224d286599905fc9b5566fff092b (patch) | |
tree | 16402bdbac2e3895be9f6095a634f2872a854cb3 | |
parent | 3734a7de6c6daca154db448cad8723bd16e4943d (diff) |
glsl/lower_distance: only set max_array_access for 1D clip dist arrays
The max_array_access field applies to the first dimension, which means
we only want to set it for the 1D clip dist arrays.
This fixes an ir_validate assert seen with
KHR-GL44.cull_distance.functional
on nouveau and radeon with debug builds.
Fixes: a08c4ebbe (glsl: rewrite clip/cull distance lowering pass)
Reviewed-by: Timothy Arceri <[email protected]>
Tested-by: Tobias Klausmann <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
(cherry picked from commit 53587b7105aaf10ecf7e5dcb8ed63265af688738)
-rw-r--r-- | src/compiler/glsl/lower_distance.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/lower_distance.cpp b/src/compiler/glsl/lower_distance.cpp index 9858503e028..ff04e9a26d8 100644 --- a/src/compiler/glsl/lower_distance.cpp +++ b/src/compiler/glsl/lower_distance.cpp @@ -167,7 +167,6 @@ lower_distance_visitor::visit(ir_variable *ir) /* Clone the old var so that we inherit all of its properties */ *new_var = ir->clone(ralloc_parent(ir), NULL); (*new_var)->name = ralloc_strdup(*new_var, GLSL_CLIP_VAR_NAME); - (*new_var)->data.max_array_access = new_size - 1; (*new_var)->data.location = VARYING_SLOT_CLIP_DIST0; if (!ir->type->fields.array->is_array()) { @@ -182,6 +181,7 @@ lower_distance_visitor::visit(ir_variable *ir) this->shader_stage == MESA_SHADER_GEOMETRY))); assert (ir->type->fields.array == glsl_type::float_type); + (*new_var)->data.max_array_access = new_size - 1; /* And change the properties that we need to change */ (*new_var)->type = glsl_type::get_array_instance(glsl_type::vec4_type, |