st/mesa: allow 2D indexing for all shader types in translate_src()
authorBrian Paul <brianp@vmware.com>
Tue, 1 Jul 2014 13:55:00 +0000 (07:55 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 1 Jul 2014 15:42:44 +0000 (09:42 -0600)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 256f356623bf98d85e4b48a4bc04b37941d0ee34..d660a6be7cbcedffd1d8429ce0fb02bc2823e48a 100644 (file)
@@ -4488,7 +4488,10 @@ translate_src(struct st_translate *t, const st_src_reg *src_reg)
 {
    struct ureg_src src = src_register(t, src_reg->file, src_reg->index, src_reg->index2D);
 
-   if (t->procType == TGSI_PROCESSOR_GEOMETRY && src_reg->has_index2) {
+   if (src_reg->has_index2) {
+      /* 2D indexes occur with geometry shader inputs (attrib, vertex)
+       * and UBO constant buffers (buffer, position).
+       */
       src = src_register(t, src_reg->file, src_reg->index, src_reg->index2D);
       if (src_reg->reladdr2)
          src = ureg_src_dimension_indirect(src, ureg_src(t->address[1]),