st/glsl_to_tgsi: only the first (inner-most) array reference can be a 2D index
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Sep 2017 16:43:42 +0000 (18:43 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 11 Sep 2017 13:03:57 +0000 (15:03 +0200)
Don't get distracted by record dereferences between array references.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 026aea5d53dbb621dc88b5911fcc3043ae1cb8d4..cf6e8f8fde1ca8099f9b4df2837007bb167115fa 100644 (file)
@@ -2532,7 +2532,7 @@ glsl_to_tgsi_visitor::visit(ir_dereference_array *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) &&