nv50/ir: return a register when retrieving thread id sysval
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 12 Feb 2017 01:23:30 +0000 (20:23 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 12 Feb 2017 01:25:26 +0000 (20:25 -0500)
We have logic to short-circuit such retrievals to zero. However "zero"
was an immediate, and some logic expected to get registers (to later be
propagated). Fix this by using loadImm.

Fixes GL45-CTS.gpu_shader5.images_array_indexing

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index 6ad8189c9103d98d9cab1dbe7d535cadac2b783d..d634d2da92828223b40f759a40b37ba1c869a26c 100644 (file)
@@ -2039,7 +2039,7 @@ Converter::fetchSrc(tgsi::Instruction::SrcRegister src, int c, Value *ptr)
       assert(!ptr);
       if (info->sv[idx].sn == TGSI_SEMANTIC_THREAD_ID &&
           info->prop.cp.numThreads[swz] == 1)
-         return zero;
+         return loadImm(NULL, 0u);
       ld = mkOp1(OP_RDSV, TYPE_U32, getSSA(), srcToSym(src, c));
       ld->perPatch = info->sv[idx].patch;
       return ld->getDef(0);