Mesa (master): nv50/ir/nir: fix interpolation on explicit operations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 11:43:05 UTC 2020


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Sat Jul  4 11:32:14 2020 +0200

nv50/ir/nir: fix interpolation on explicit operations

Fixes a bunch of interpolate tests in the aosp GLES CTS

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index c634978497d..d5b81b84c35 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -1692,11 +1692,21 @@ Converter::visit(nir_intrinsic_instr *insn)
 
       // see load_barycentric_* handling
       if (prog->getType() == Program::TYPE_FRAGMENT) {
-         mode = translateInterpMode(&vary, nvirOp);
          if (op == nir_intrinsic_load_interpolated_input) {
             ImmediateValue immMode;
             if (getSrc(&insn->src[0], 1)->getUniqueInsn()->src(0).getImmediate(immMode))
-               mode |= immMode.reg.data.u32;
+               mode = immMode.reg.data.u32;
+         }
+         if (mode == NV50_IR_INTERP_DEFAULT)
+            mode |= translateInterpMode(&vary, nvirOp);
+         else {
+            if (vary.linear) {
+               nvirOp = OP_LINTERP;
+               mode |= NV50_IR_INTERP_LINEAR;
+            } else {
+               nvirOp = OP_PINTERP;
+               mode |= NV50_IR_INTERP_PERSPECTIVE;
+            }
          }
       }
 



More information about the mesa-commit mailing list