summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-01-18 03:18:19 -0500
committerMaarten Lankhorst <[email protected]>2014-01-27 16:40:42 +0100
commitf77069419a644e57d3f1baf708a58c699fa16ca5 (patch)
tree156130b7a53a47f01d8ebac44c65e8d84860b924 /src
parent45b7f1701e4c4d0e3c5a2863fe90686daa6524ce (diff)
nv50/ir: fix support for shader input + immediate in gp
This only works for up to $a3, hopefully we won't go that high. Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp7
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index a28c9175a6d..173497723c2 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -398,9 +398,14 @@ CodeEmitterNV50::setSrcFileBits(const Instruction *i, int enc)
case 0x0c: // rir
break;
case 0x0d: // gir
- code[0] |= 0x01000000;
assert(progType == Program::TYPE_GEOMETRY ||
progType == Program::TYPE_COMPUTE);
+ code[0] |= 0x01000000;
+ if (progType == Program::TYPE_GEOMETRY && i->src(0).isIndirect(0)) {
+ int reg = i->src(0).getIndirect(0)->rep()->reg.data.id;
+ assert(reg < 3);
+ code[0] |= (reg + 1) << 26;
+ }
break;
case 0x08: // rcr
code[0] |= (enc == NV50_OP_ENC_LONG_ALT) ? 0x01000000 : 0x00800000;
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index ecf5d1c70a2..1dc50c44b96 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -313,6 +313,7 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
case 0x0d:
if (ld->bb->getProgram()->getType() != Program::TYPE_GEOMETRY)
return false;
+ break;
default:
return false;
}