[Mesa-dev] [PATCH 3/6] ttn: small logic cleanup

Rob Clark robdclark at gmail.com
Thu Jan 21 11:48:29 PST 2016


From: Rob Clark <robclark at freedesktop.org>

The only case where dim!=NULL is where op==load_ubo.  But using
op==load_ubo is less confusing.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index dfda80f..2c523fc 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -614,7 +614,7 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
       }
 
       nir_ssa_def *offset;
-      if (dim) {
+      if (op == nir_intrinsic_load_ubo) {
          /* UBO loads don't have a const_index[0] base offset. */
          offset = nir_imm_int(b, index);
          if (indirect) {
-- 
2.5.0



More information about the mesa-dev mailing list