From dfca35f8078e79e8c5ba520dae4a2741b96c9ed9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 1 Jul 2014 07:55:00 -0600 Subject: [PATCH] st/mesa: allow 2D indexing for all shader types in translate_src() Reviewed-by: Roland Scheidegger --- 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 256f356623b..d660a6be7cb 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -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]), -- 2.30.2