[Mesa-dev] [PATCH 06/19] nv50/ir: disallow shader input propagation for gp

Ilia Mirkin imirkin at alum.mit.edu
Mon Jan 13 11:19:22 PST 2014


For some reason, shader input accesses don't work correctly in non-ld
instructions. Disallow those loads from being propagated.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---

I'm not particularly happy with this patch. Some investigation needs to happen
as to what's going on here. NVIDIA's shaders include p[] accesses in various
instructions just fine. Perhaps this is just masking some other bug. However
this works for now for all the piglit tests in the repo.

 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index 52257a8..18fa069 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -297,14 +297,19 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
 
    switch (mode) {
    case 0x00:
-   case 0x01:
    case 0x03:
    case 0x08:
-   case 0x09:
    case 0x0c:
    case 0x20:
    case 0x21:
       break;
+   case 0x01:
+   case 0x09:
+      // TODO: Figure out why a[] accesses can't be propagated into non-ld
+      // instructions. Something to do with vstride maybe?
+      if (ld->bb->getProgram()->getType() == Program::TYPE_GEOMETRY)
+         return false;
+      break;
    case 0x0d:
       if (ld->bb->getProgram()->getType() != Program::TYPE_GEOMETRY)
          return false;
-- 
1.8.3.2



More information about the mesa-dev mailing list