diff options
author | Christoph Bumiller <[email protected]> | 2013-03-02 21:00:26 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2013-03-12 12:55:36 +0100 |
commit | 7a91d3a2a4c4e7851fdb46465224213ce1874c9b (patch) | |
tree | 43eb651c53d47a85881ffc976f7ac7666ea7a110 /src/gallium/drivers/nv50/codegen | |
parent | 99e4eba669f13a0dc80880f4f91e2338377c1667 (diff) |
nv50/ir: add support for different sampler and resource index on nve4
And remove non-working code for indirect sampler/resource selection.
Will be added back later.
Includes code from "nv50/ir/tgsi: Resource indirect indexing" by
Francisco Jerez (when mixing the R and S handles we can only specify
them via a register, i.e. indirectly, unless we upload all the used
handle combinations to c[] space, which we don't for now).
Diffstat (limited to 'src/gallium/drivers/nv50/codegen')
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir.cpp | 27 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir.h | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir.cpp index 3c05d05b81f..7788e51fd0d 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir.cpp @@ -687,6 +687,11 @@ Instruction::moveSources(const int s, const int delta) } moveSourcesAdjustIndex(predSrc, s, delta); moveSourcesAdjustIndex(flagsSrc, s, delta); + if (asTex()) { + TexInstruction *tex = asTex(); + moveSourcesAdjustIndex(tex->tex.rIndirectSrc, s, delta); + moveSourcesAdjustIndex(tex->tex.sIndirectSrc, s, delta); + } if (delta > 0) { --k; @@ -950,6 +955,28 @@ const struct TexInstruction::Target::Desc TexInstruction::Target::descTable[] = { "BUFFER", 1, 1, false, false, false }, }; +void +TexInstruction::setIndirectR(Value *v) +{ + int p = ((tex.rIndirectSrc < 0) && v) ? srcs.size() : tex.rIndirectSrc; + if (p >= 0) { + tex.rIndirectSrc = p; + setSrc(p, v); + srcs[p].usedAsPtr = !!v; + } +} + +void +TexInstruction::setIndirectS(Value *v) +{ + int p = ((tex.sIndirectSrc < 0) && v) ? srcs.size() : tex.sIndirectSrc; + if (p >= 0) { + tex.sIndirectSrc = p; + setSrc(p, v); + srcs[p].usedAsPtr = !!v; + } +} + CmpInstruction::CmpInstruction(Function *fn, operation op) : Instruction(fn, op, TYPE_F32) { diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir.h b/src/gallium/drivers/nv50/codegen/nv50_ir.h index 548125901e2..7862724411e 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir.h @@ -865,6 +865,8 @@ public: tex.target = targ; } + void setIndirectR(Value *); + void setIndirectS(Value *); inline Value *getIndirectR() const; inline Value *getIndirectS() const; |