[Mesa-dev] [PATCH 5/5] nir: implement GLSL.std.450 NClamp operation

Juan A. Suarez Romero jasuarez at igalia.com
Mon Jun 12 16:33:58 UTC 2017


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

diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_glsl450.c
index ce80360..cfff7a6 100644
--- a/src/compiler/spirv/vtn_glsl450.c
+++ b/src/compiler/spirv/vtn_glsl450.c
@@ -578,6 +578,10 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
       val->ssa->def = build_nmax(nb, src[0], src[1]);
       return;
 
+   case GLSLstd450NClamp:
+      val->ssa->def = build_nmin(nb, build_nmax(nb, src[0], src[1]), src[2]);
+      return;
+
    case GLSLstd450Log:
       val->ssa->def = build_log(nb, src[0]);
       return;
-- 
2.9.4



More information about the mesa-dev mailing list