[Mesa-dev] [PATCH 11/19] nir: support uniform sampler AoA lookup

Timothy Arceri t_arceri at yahoo.com.au
Sat Jun 20 05:33:08 PDT 2015


To do this we make sure to only append the array subscript
to structs.
---
 src/glsl/nir/nir_lower_samplers.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp
index 7a0b0a0..c450198 100644
--- a/src/glsl/nir/nir_lower_samplers.cpp
+++ b/src/glsl/nir/nir_lower_samplers.cpp
@@ -72,7 +72,8 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr
 
          assert(deref_array->deref_array_type != nir_deref_array_type_wildcard);
 
-         if (deref_array->deref.child) {
+         if (deref_array->deref.child &&
+            deref->child->type->without_array()->is_record()) {
             ralloc_asprintf_append(&name, "[%u]",
                deref_array->deref_array_type == nir_deref_array_type_direct ?
                   deref_array->base_offset : 0);
-- 
2.1.0



More information about the mesa-dev mailing list