[Mesa-dev] [PATCH v2 05/12] st/glsl_to_tgsi: ir_load_ubo always has a second index

Nicolai Hähnle nhaehnle at gmail.com
Mon Aug 28 08:58:13 UTC 2017


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

Acked-by: Roland Scheidegger <sroland at vmware.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9f021962e40..f2aae4f5183 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2179,28 +2179,27 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op)
          /* Relative/variable index into constant buffer */
          emit_asm(ir, TGSI_OPCODE_USHR, st_dst_reg(index_reg), offset,
               st_src_reg_for_int(4));
          cbuf.reladdr = ralloc(mem_ctx, st_src_reg);
          memcpy(cbuf.reladdr, &index_reg, sizeof(index_reg));
       }
 
       if (const_uniform_block) {
          /* Constant constant buffer */
          cbuf.reladdr2 = NULL;
-         cbuf.has_index2 = true;
       }
       else {
          /* Relative/variable constant buffer */
          cbuf.reladdr2 = ralloc(mem_ctx, st_src_reg);
          memcpy(cbuf.reladdr2, &op[0], sizeof(st_src_reg));
-         cbuf.has_index2 = true;
       }
+      cbuf.has_index2 = true;
 
       cbuf.swizzle = swizzle_for_size(ir->type->vector_elements);
       if (glsl_base_type_is_64bit(cbuf.type))
          cbuf.swizzle += MAKE_SWIZZLE4(const_offset % 16 / 8,
                                        const_offset % 16 / 8,
                                        const_offset % 16 / 8,
                                        const_offset % 16 / 8);
       else
          cbuf.swizzle += MAKE_SWIZZLE4(const_offset % 16 / 4,
                                        const_offset % 16 / 4,
-- 
2.11.0



More information about the mesa-dev mailing list