Mesa (master): nir: implement GLSL.std.450 NMax, NMIn and NClamp operations

Juan Antonio Suárez Romero jasuarez at kemper.freedesktop.org
Tue Jun 27 10:08:32 UTC 2017


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

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Thu Jun  8 11:50:55 2017 +0000

nir: implement GLSL.std.450 NMax, NMIn and NClamp operations

v2: NIR fmax/fmin already handles NaN (Connor).

Reviewed by: Elie Tournier <elie.tournier at collabora.com>

---

 src/compiler/spirv/vtn_glsl450.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_glsl450.c
index 96e3407dee..1d7e2b8d95 100644
--- a/src/compiler/spirv/vtn_glsl450.c
+++ b/src/compiler/spirv/vtn_glsl450.c
@@ -433,9 +433,11 @@ vtn_nir_alu_op_for_spirv_glsl_opcode(enum GLSLstd450 opcode)
    case GLSLstd450Log2:          return nir_op_flog2;
    case GLSLstd450Sqrt:          return nir_op_fsqrt;
    case GLSLstd450InverseSqrt:   return nir_op_frsq;
+   case GLSLstd450NMin:          return nir_op_fmin;
    case GLSLstd450FMin:          return nir_op_fmin;
    case GLSLstd450UMin:          return nir_op_umin;
    case GLSLstd450SMin:          return nir_op_imin;
+   case GLSLstd450NMax:          return nir_op_fmax;
    case GLSLstd450FMax:          return nir_op_fmax;
    case GLSLstd450UMax:          return nir_op_umax;
    case GLSLstd450SMax:          return nir_op_imax;
@@ -537,6 +539,7 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
       return;
 
    case GLSLstd450FClamp:
+   case GLSLstd450NClamp:
       val->ssa->def = build_fclamp(nb, src[0], src[1], src[2]);
       return;
    case GLSLstd450UClamp:




More information about the mesa-commit mailing list