summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-04-26 02:08:23 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2014-04-28 19:09:18 -0400
commitf3aa999383074d666d6e3f3506e66b0c937904ca (patch)
tree2c71884220504ba390e2bef267cf8ea196f6dc60 /src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
parent46364a53ef30e5c97e1eeb5a879dd99a47415b73 (diff)
nv50/ir: change texture offsets to ValueRefs, allow nonconst
This allows us to have non-constant offsets for textureGatherOffset and textureGatherOffsets. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
index 69e88e6902d..eafc0a73bc6 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
@@ -695,6 +695,14 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i)
// texel offsets are 3 immediate fields in the instruction,
// nv50 cannot do textureGatherOffsets
assert(i->tex.useOffsets <= 1);
+ if (i->tex.useOffsets) {
+ for (int c = 0; c < 3; ++c) {
+ ImmediateValue val;
+ assert(i->offset[0][c].getImmediate(val));
+ i->tex.offset[c] = val.reg.data.u32;
+ i->offset[0][c].set(NULL);
+ }
+ }
return true;
}