diff options
author | Ilia Mirkin <[email protected]> | 2016-09-08 02:13:56 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-09-10 13:40:04 -0400 |
commit | a8c0c7301cccd6bba1842ae8aa901cd45d9d5ffd (patch) | |
tree | 307042aa435ada8d7c3c7af53b452cf7b02844e6 /src/gallium/drivers/nouveau/codegen | |
parent | a22aee5ad1154918aff77af5102fecd2aa39a631 (diff) |
gm107/ir: allow indirect inputs to be loaded by frag shader
Looks like the GM107 IPA op does not allow a separate offset when
using an indirect register. Instead we must use AL2P like we do for
indirect vertex operations on Kepler+.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 2604296d46e..3c3d61112b9 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -2695,13 +2695,30 @@ NVC0LoweringPass::visit(Instruction *i) /* Kepler+ has a special opcode to compute a new base address to be used * for indirect loads. + * + * Maxwell+ has an additional similar requirement for indirect + * interpolation ops in frag shaders. */ - if (targ->getChipset() >= NVISA_GK104_CHIPSET && !i->perPatch && - (i->op == OP_VFETCH || i->op == OP_EXPORT) && i->src(0).isIndirect(0)) { + bool doAfetch = false; + if (targ->getChipset() >= NVISA_GK104_CHIPSET && + !i->perPatch && + (i->op == OP_VFETCH || i->op == OP_EXPORT) && + i->src(0).isIndirect(0)) { + doAfetch = true; + } + if (targ->getChipset() >= NVISA_GM107_CHIPSET && + (i->op == OP_LINTERP || i->op == OP_PINTERP) && + i->src(0).isIndirect(0)) { + doAfetch = true; + } + + if (doAfetch) { + Value *addr = cloneShallow(func, i->getSrc(0)); Instruction *afetch = bld.mkOp1(OP_AFETCH, TYPE_U32, bld.getSSA(), - cloneShallow(func, i->getSrc(0))); + i->getSrc(0)); afetch->setIndirect(0, 0, i->getIndirect(0, 0)); - i->src(0).get()->reg.data.offset = 0; + addr->reg.data.offset = 0; + i->setSrc(0, addr); i->setIndirect(0, 0, afetch->getDef(0)); } |