Mesa (master): nv50/ir: allow a mov to emit directly to a shader output

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 20:13:56 UTC 2021


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Wed Jan  6 14:18:05 2021 -0500

nv50/ir: allow a mov to emit directly to a shader output

Under some very rare circumstances, the OP_EXPORT will refer to a def
provided by a mov. When we then try to make the defining op write to the
export directly, it blows up. Reuse the existing setDst helper which
handles this and more for the long encoding.

Fixes dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8396>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index 60e800ad502..8c5646cd168 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -785,13 +785,14 @@ CodeEmitterNV50::emitMOV(const Instruction *i)
    } else {
       if (i->encSize == 4) {
          code[0] = 0x10008000;
+         defId(i->def(0), 2);
       } else {
          code[0] = 0x10000001;
          code[1] = (typeSizeof(i->dType) == 2) ? 0 : 0x04000000;
          code[1] |= (i->lanes << 14);
+         setDst(i, 0);
          emitFlagsRd(i);
       }
-      defId(i->def(0), 2);
       srcId(i->src(0), 9);
    }
    if (df == FILE_SHADER_OUTPUT) {



More information about the mesa-commit mailing list