diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen')
3 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index bc15992df0e..f4f3c708886 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -1024,6 +1024,7 @@ public: bool liveOnly; // only execute on live pixels of a quad (optimization) bool levelZero; bool derivAll; + bool bindless; int8_t useOffsets; // 0, 1, or 4 for textureGatherOffsets int8_t offset[3]; // only used on nv50 diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index 469fcff41d4..6c615806b83 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -2206,6 +2206,16 @@ Converter::setTexRS(TexInstruction *tex, unsigned int& s, int R, int S) { unsigned rIdx = 0, sIdx = 0; + if (R >= 0 && tgsi.getSrc(R).getFile() != TGSI_FILE_SAMPLER) { + // This is the bindless case. We have to get the actual value and pass + // it in. This will be the complete handle. + tex->tex.rIndirectSrc = s; + tex->setSrc(s++, fetchSrc(R, 0)); + tex->setTexture(tgsi.getTexture(code, R), 0xff, 0x1f); + tex->tex.bindless = true; + return; + } + if (R >= 0) rIdx = tgsi.getSrc(R).getIndex(0); if (S >= 0) 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 8a864079ce9..4e65d449ebf 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -882,10 +882,12 @@ NVC0LoweringPass::handleTEX(TexInstruction *i) if (i->tex.rIndirectSrc >= 0 || i->tex.sIndirectSrc >= 0) { // XXX this ignores tsc, and assumes a 1:1 mapping assert(i->tex.rIndirectSrc >= 0); - Value *hnd = loadTexHandle(i->getIndirectR(), i->tex.r); - i->tex.r = 0xff; - i->tex.s = 0x1f; - i->setIndirectR(hnd); + if (!i->tex.bindless) { + Value *hnd = loadTexHandle(i->getIndirectR(), i->tex.r); + i->tex.r = 0xff; + i->tex.s = 0x1f; + i->setIndirectR(hnd); + } i->setIndirectS(NULL); } else if (i->tex.r == i->tex.s || i->op == OP_TXF) { if (i->tex.r == 0xffff) |