Mesa (master): gv100/ir: fix OP_TXG for shadow textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jun 21 23:20:56 UTC 2020


Module: Mesa
Branch: master
Commit: 281f777433f36bff7dea75166be406e2fc22f30b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=281f777433f36bff7dea75166be406e2fc22f30b

Author: Karol Herbst <kherbst at redhat.com>
Date:   Sat Jun 20 22:53:56 2020 +0200

gv100/ir: fix OP_TXG for shadow textures

doesn't seem to fix any tests now, but the previous code was obviously
incorrect and I still see fails in those CTS tests:

KHR-GL46.texture_gather.*depth*

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Ben Skeggs <bskeggs at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5576>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
index 9fbea47a8c2..dcd2fae5367 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
@@ -1190,6 +1190,14 @@ CodeEmitterGV100::emitTLD4()
 {
    const TexInstruction *insn = this->insn->asTex();
 
+   int offsets = 0;
+   switch (insn->tex.useOffsets) {
+   case 4: offsets = 2; break;
+   case 1: offsets = 1; break;
+   case 0: offsets = 0; break;
+   default: assert(!"invalid offsets count"); break;
+   }
+
    if (insn->tex.rIndirectSrc < 0) {
       emitInsn (0xb63);
       emitField(54, 5, prog->driver->io.auxCBSlot);
@@ -1203,8 +1211,7 @@ CodeEmitterGV100::emitTLD4()
    emitField(84, 1, 1); // !.EF
    emitPRED (81);
    emitField(78, 1, insn->tex.target.isShadow());
-   emitField(77, 2, insn->tex.useOffsets == 4);
-   emitField(76, 2, insn->tex.useOffsets == 1);
+   emitField(76, 2, offsets);
    emitField(72, 4, insn->tex.mask);
    emitGPR  (64, insn->def(1));
    emitField(63, 1, insn->tex.target.isArray());



More information about the mesa-commit mailing list