nv50/ir: mark STORE destination inputs as used
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 14 Oct 2019 06:40:11 +0000 (02:40 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 30 Oct 2019 23:13:18 +0000 (19:13 -0400)
Observed an issue when looking at the code generatedy by the
image-vertex-attrib-input-output piglit test. Even though the test
itself worked fine (due to TIC 0 being used for the image), this needs
to be fixed.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index d62d36008e618d3fd3804b03d096bb2e3c4e5b07..8c42902645252bb9697c1c66fe005cb8778d75f0 100644 (file)
@@ -1591,6 +1591,12 @@ bool Source::scanInstruction(const struct tgsi_full_instruction *inst)
       if (insn.getOpcode() == TGSI_OPCODE_STORE &&
           dst.getFile() != TGSI_FILE_MEMORY) {
          info->io.globalAccess |= 0x2;
+
+         if (dst.getFile() == TGSI_FILE_INPUT) {
+            // TODO: Handle indirect somehow?
+            const int i = dst.getIndex(0);
+            info->in[i].mask |= 1;
+         }
       }
 
       if (dst.getFile() == TGSI_FILE_OUTPUT) {