nvc0/ir: don't replace load from input in COMPUTE progs with VFETCH
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 28 Feb 2013 20:05:45 +0000 (21:05 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 12 Mar 2013 11:55:35 +0000 (12:55 +0100)
src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp

index aa4ff35d9661f16f93b20669f17360412ca43b92..94d3cea0112f8d0ba41a7bd9e90efbb75a460a89 100644 (file)
@@ -1489,8 +1489,13 @@ NVC0LoweringPass::visit(Instruction *i)
       return handleWRSV(i);
    case OP_LOAD:
       if (i->src(0).getFile() == FILE_SHADER_INPUT) {
-         i->op = OP_VFETCH;
-         assert(prog->getType() != Program::TYPE_FRAGMENT);
+         if (prog->getType() == Program::TYPE_COMPUTE) {
+            i->getSrc(0)->reg.file = FILE_MEMORY_CONST;
+            i->getSrc(0)->reg.fileIndex = 0;
+         } else {
+            i->op = OP_VFETCH;
+            assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
+         }
       }
       break;
    case OP_ATOM: