Mesa (master): nv50/ir: set position before i instead of i-> next in NV50LoweringPreSSA::visit

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Fri Jul 20 18:46:45 UTC 2012


Module: Mesa
Branch: master
Commit: 248e6f03313afdfd3c23be269b0da7a1aa31cff2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=248e6f03313afdfd3c23be269b0da7a1aa31cff2

Author: Bryan Cain <bryancain3 at gmail.com>
Date:   Tue Jul 17 23:46:39 2012 -0500

nv50/ir: set position before i instead of i->next in NV50LoweringPreSSA::visit

Fixes rendering glitches in Psychonauts such as Raz's eyes flickering white.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51962.

---

 .../drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp
index 39e0cfa..3e0dc75 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp
@@ -701,6 +701,7 @@ NV50LoweringPreSSA::handleTXL(TexInstruction *i)
    BasicBlock *texiBB = i->bb->splitBefore(i, false);
    BasicBlock *joinBB = i->bb->splitAfter(i);
 
+   bld.setPosition(currBB, true);
    currBB->joinAt = bld.mkFlow(OP_JOINAT, joinBB, CC_ALWAYS, NULL);
 
    for (int l = 0; l <= 3; ++l) {
@@ -1030,13 +1031,7 @@ NV50LoweringPreSSA::checkPredicate(Instruction *insn)
 bool
 NV50LoweringPreSSA::visit(Instruction *i)
 {
-   if (i->prev)
-      bld.setPosition(i->prev, true);
-   else
-   if (i->next)
-      bld.setPosition(i->next, false);
-   else
-      bld.setPosition(i->bb, true);
+   bld.setPosition(i, false);
 
    if (i->cc != CC_ALWAYS)
       checkPredicate(i);




More information about the mesa-commit mailing list