[Mesa-dev] [PATCH 2/3] nir: remove recreated broken sampler logic

Timothy Arceri t_arceri at yahoo.com.au
Fri May 29 06:16:41 PDT 2015


This logic was recreated based on the old glsl ir code.

The name was only generated for arrays of arrays in which
case this just breaks the Uniform hash lookup.
---
 src/glsl/nir/nir_lower_samplers.cpp | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp
index 7a0b0a0..b054afa 100644
--- a/src/glsl/nir/nir_lower_samplers.cpp
+++ b/src/glsl/nir/nir_lower_samplers.cpp
@@ -71,15 +71,8 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr
          nir_deref_array *deref_array = nir_deref_as_array(deref->child);
 
          assert(deref_array->deref_array_type != nir_deref_array_type_wildcard);
-
-         if (deref_array->deref.child) {
-            ralloc_asprintf_append(&name, "[%u]",
-               deref_array->deref_array_type == nir_deref_array_type_direct ?
-                  deref_array->base_offset : 0);
-         } else {
-            assert(deref->child->type->base_type == GLSL_TYPE_SAMPLER);
-            instr->sampler_index = deref_array->base_offset;
-         }
+         assert(deref->child->type->base_type == GLSL_TYPE_SAMPLER);
+         instr->sampler_index = deref_array->base_offset;
 
          /* XXX: We're assuming here that the indirect is the last array
           * thing we have.  This should be ok for now as we don't support
-- 
2.1.0



More information about the mesa-dev mailing list