[Mesa-stable] [PATCH] st/glsl_to_tgsi: only the first (inner-most) array reference can be a 2D index

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 8 17:03:02 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Don't get distracted by record dereferences between array references.

Fixes dEQP-GLES31.functional.tessellation.user_defined_io.per_vertex_block.*

Cc: mesa-stable at lists.freedesktop.org
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 026aea5d53d..cf6e8f8fde1 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2525,21 +2525,21 @@ glsl_to_tgsi_visitor::visit(ir_dereference_array *ir)
     */
    int element_size = ir->type->without_array()->is_record() ?
       st_glsl_storage_type_size(ir->type, var->data.bindless) :
       type_size(ir->type);
 
    index = ir->array_index->constant_expression_value(ralloc_parent(ir));
 
    ir->array->accept(this);
    src = this->result;
 
-   if (ir->array->ir_type != ir_type_dereference_array) {
+   if (!src.has_index2) {
       switch (this->prog->Target) {
       case GL_TESS_CONTROL_PROGRAM_NV:
          is_2D = (src.file == PROGRAM_INPUT || src.file == PROGRAM_OUTPUT) &&
                  !ir->variable_referenced()->data.patch;
          break;
       case GL_TESS_EVALUATION_PROGRAM_NV:
          is_2D = src.file == PROGRAM_INPUT &&
                  !ir->variable_referenced()->data.patch;
          break;
       case GL_GEOMETRY_PROGRAM_NV:
-- 
2.11.0



More information about the mesa-stable mailing list