diff options
author | Christoph Bumiller <[email protected]> | 2012-05-05 13:30:03 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-05-06 22:03:06 +0200 |
commit | 38a20281fcc2ed244aea0aaa268035533f48a183 (patch) | |
tree | 9c3aace05d6b0b9dc457c27d3e3a33823533f853 /src/gallium/drivers/nvc0/codegen | |
parent | 9dfac63ae0a8759e05dbde20c2cea05afc121def (diff) |
nvc0/ir: fix lowering of textureGrad
Diffstat (limited to 'src/gallium/drivers/nvc0/codegen')
-rw-r--r-- | src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp index 2ca4979dc74..fbd1aa5dfc9 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp @@ -1020,7 +1020,7 @@ CodeEmitterNVC0::emitTEX(const TexInstruction *i) code[1] |= 0x02000000; } - if (i->tex.derivAll) + if (i->op != OP_TXD && i->tex.derivAll) code[1] |= 1 << 13; defId(i->def(0), 14); diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp index 02ae9fd5d0e..900e998df8d 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp @@ -749,21 +749,22 @@ bool NVC0LoweringPass::handleTXD(TexInstruction *txd) { int dim = txd->tex.target.getDim(); - int arg = txd->tex.target.getDim() + txd->tex.target.isArray(); + int arg = txd->tex.target.getArgCount(); handleTEX(txd); - while (txd->src(arg).exists()) + while (txd->srcExists(arg)) ++arg; txd->tex.derivAll = true; - if (dim > 2 || txd->tex.target.isShadow()) + if (dim > 2 || + txd->tex.target.isCube() || + arg > 4 || + txd->tex.target.isShadow()) return handleManualTXD(txd); - assert(arg <= 4); // at most s/t/array, x, y, offset - for (int c = 0; c < dim; ++c) { - txd->src(arg + c * 2 + 0).set(txd->dPdx[c]); - txd->src(arg + c * 2 + 1).set(txd->dPdy[c]); + txd->setSrc(arg + c * 2 + 0, txd->dPdx[c]); + txd->setSrc(arg + c * 2 + 1, txd->dPdy[c]); txd->dPdx[c].set(NULL); txd->dPdy[c].set(NULL); } |