[Mesa-dev] [PATCH] nv50/ir: fix use of getUniqueInsn() in loadProjTexCoords

Rhys Perry pendingchaos02 at gmail.com
Sun Jul 8 16:32:05 UTC 2018


Fixes "value not uniquely defined" messages during shader-db runs.

Fixes: 57594065c30feec9376b "nv50/ir: import new shader backend code"

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 2f9bcc1f34..2fe49909d5 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2337,10 +2337,10 @@ void
 Converter::loadProjTexCoords(Value *dst[4], Value *src[4], unsigned int mask)
 {
    Value *proj = fetchSrc(0, 3);
-   Instruction *insn = proj->getUniqueInsn();
+   Instruction *insn = proj->defs.size() > 1 ? NULL : proj->getUniqueInsn();
    int c;
 
-   if (insn->op == OP_PINTERP) {
+   if (insn && insn->op == OP_PINTERP) {
       bb->insertTail(insn = cloneForward(func, insn));
       insn->op = OP_LINTERP;
       insn->setInterpolate(NV50_IR_INTERP_LINEAR | insn->getSampleMode());
@@ -2352,6 +2352,8 @@ Converter::loadProjTexCoords(Value *dst[4], Value *src[4], unsigned int mask)
    for (c = 0; c < 4; ++c) {
       if (!(mask & (1 << c)))
          continue;
+      if (src[c]->defs.size() > 1)
+         continue;
       if ((insn = src[c]->getUniqueInsn())->op != OP_PINTERP)
          continue;
       mask &= ~(1 << c);
-- 
2.14.4



More information about the mesa-dev mailing list