From: Kenneth Graunke Date: Tue, 29 Dec 2015 04:40:10 +0000 (-0800) Subject: nir/spirv/glsl450: Implement Clamp/SClamp/UClamp. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=083fd6ec2a15db60edbcc55e86a7c6cc686e862f;p=mesa.git nir/spirv/glsl450: Implement Clamp/SClamp/UClamp. --- 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: