From 083fd6ec2a15db60edbcc55e86a7c6cc686e862f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 28 Dec 2015 20:40:10 -0800 Subject: [PATCH] nir/spirv/glsl450: Implement Clamp/SClamp/UClamp. --- src/glsl/nir/spirv/vtn_glsl450.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/glsl/nir/spirv/vtn_glsl450.c b/src/glsl/nir/spirv/vtn_glsl450.c index ecd24c4a3d9..2d5faa7d574 100644 --- a/src/glsl/nir/spirv/vtn_glsl450.c +++ b/src/glsl/nir/spirv/vtn_glsl450.c @@ -156,8 +156,15 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, return; case GLSLstd450FClamp: + val->ssa->def = build_fclamp(nb, src[0], src[1], src[2]); + return; case GLSLstd450UClamp: + val->ssa->def = nir_umin(nb, nir_umax(nb, src[0], src[1]), src[2]); + return; case GLSLstd450SClamp: + val->ssa->def = nir_imin(nb, nir_imax(nb, src[0], src[1]), src[2]); + return; + case GLSLstd450Asin: case GLSLstd450Acos: case GLSLstd450Atan: -- 2.30.2