Skip to contentSkip to conversation

nv50/ir: fix texture offsets in release builds

PATCH New Ilia Mirkin 1 participant 1 message Jan 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50/ir: fix texture offsets in release builds

assert's get compiled out in release builds, so they can't be relied upon to perform logic.

---
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp | 3 ++-
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp +2 -1
index e283424..0d7612e 100644
@@ -772,7 +772,8 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i)
    if (i->tex.useOffsets) {
       for (int c = 0; c < 3; ++c) {
          ImmediateValue val;
-         assert(i->offset[0][c].getImmediate(val));
+         if (!i->offset[0][c].getImmediate(val))
+            assert(!"non-immediate offset");
          i->tex.offset[c] = val.reg.data.u32;
          i->offset[0][c].set(NULL);
       }
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +2 -1
index e279ba7..ff48e94 100644
@@ -755,7 +755,8 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
          assert(i->tex.useOffsets == 1);
          for (c = 0; c < 3; ++c) {
             ImmediateValue val;
-            assert(i->offset[0][c].getImmediate(val));
+            if (!i->offset[0][c].getImmediate(val))
+               assert(!"non-immediate offset passed to non-TXG");
             imm |= (val.reg.data.u32 & 0xf) << (c * 4);
          }
          if (i->op == OP_TXD && chipset >= NVISA_GK104_CHIPSET) {
Signature · 6 lines
2.0.5

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau