[Mesa-dev] [PATCH 2/5] st/mesa: allow 2D indexing for all shader types in translate_src()

Brian Paul brianp at vmware.com
Tue Jul 1 07:53:45 PDT 2014


---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 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 3391a14..1020d36 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4484,7 +4484,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]),
-- 
1.7.10.4



More information about the mesa-dev mailing list