diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 18 |
1 files changed, 8 insertions, 10 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 87ded68e5a7..176e0cf608d 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -2464,18 +2464,16 @@ NVC0LoweringPass::handleLDST(Instruction *i) assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP } } else if (i->src(0).getFile() == FILE_MEMORY_CONST) { + int8_t fileIndex = i->getSrc(0)->reg.fileIndex - 1; + Value *ind = i->getIndirect(0, 1); + if (targ->getChipset() >= NVISA_GK104_CHIPSET && - prog->getType() == Program::TYPE_COMPUTE) { + prog->getType() == Program::TYPE_COMPUTE && + (fileIndex >= 6 || ind)) { // The launch descriptor only allows to set up 8 CBs, but OpenGL - // requires at least 12 UBOs. To bypass this limitation, we store the - // addrs into the driver constbuf and we directly load from the global - // memory. - int8_t fileIndex = i->getSrc(0)->reg.fileIndex - 1; - Value *ind = i->getIndirect(0, 1); - - if (!ind && fileIndex == -1) - return; - + // requires at least 12 UBOs. To bypass this limitation, for constant + // buffers 7+, we store the addrs into the driver constbuf and we + // directly load from the global memory. if (ind) { // Clamp the UBO index when an indirect access is used to avoid // loading information from the wrong place in the driver cb. |