summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/codegen
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-10-11 17:58:14 +0200
committerChristoph Bumiller <[email protected]>2011-10-21 23:00:39 +0200
commit9c930639d9f6d713ccfd16b390a41a9f584f348c (patch)
treeb8b1b5c37b2bdab168ecdbab1a16a93749094fd8 /src/gallium/drivers/nvc0/codegen
parent0e4e0ca6df52ddecd1bb2fe9a427549d1a82b9f9 (diff)
nv50/ir: fix textureGrad with offsets and in non-FPs
Diffstat (limited to 'src/gallium/drivers/nvc0/codegen')
-rw-r--r--src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp8
-rw-r--r--src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp6
2 files changed, 11 insertions, 3 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 13f5d2f7c72..ecff42106da 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
@@ -968,6 +968,9 @@ CodeEmitterNVC0::emitTEX(const TexInstruction *i)
code[1] |= 0x02000000;
}
+ if (i->tex.derivAll)
+ code[1] |= 1 << 13;
+
defId(i->def[0], 14);
srcId(i->src[0], 20);
@@ -992,6 +995,8 @@ CodeEmitterNVC0::emitTEX(const TexInstruction *i)
code[1] |= 1 << 24;
int src1 = i->tex.target.getArgCount();
+ if (i->op == OP_TXD && i->tex.useOffsets)
+ ++src1;
if (i->src[src1].getFile() == FILE_IMMEDIATE) { // lzero
if (i->op == OP_TXL)
@@ -1052,6 +1057,9 @@ CodeEmitterNVC0::emitQUADOP(const Instruction *i, uint8_t qOp, uint8_t laneMask)
srcId(i->src[0], 20);
srcId(i->srcExists(1) ? i->src[1] : i->src[0], 26);
+ if (i->op == OP_QUADOP && progType != Program::TYPE_FRAGMENT)
+ code[0] |= 1 << 9; // dall
+
emitPredicate(i);
}
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 2ef5a87c47d..51537972644 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp
@@ -418,14 +418,14 @@ NVC0LoweringPass::handleTXD(TexInstruction *txd)
int arg = txd->tex.target.getDim() + txd->tex.target.isArray();
handleTEX(txd);
- if (txd->src[arg].exists())
+ while (txd->src[arg].exists())
++arg;
+ txd->tex.derivAll = true;
if (dim > 2 || txd->tex.target.isShadow())
return handleManualTXD(txd);
- // at most s/t/array, x, y, offset
- assert(arg <= 4 && !txd->src[arg].exists());
+ 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]);