From: Kenneth Graunke Date: Tue, 29 Dec 2015 07:59:32 +0000 (-0800) Subject: nir/spirv/glsl450: Implement FaceForward built-in. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=659a3623b0fa4217fc4e69cccdb3e7a268bca388;p=mesa.git nir/spirv/glsl450: Implement FaceForward built-in. --- diff --git a/src/glsl/nir/spirv/vtn_glsl450.c b/src/glsl/nir/spirv/vtn_glsl450.c index 1b7751a6a88..f81f16789be 100644 --- a/src/glsl/nir/spirv/vtn_glsl450.c +++ b/src/glsl/nir/spirv/vtn_glsl450.c @@ -190,6 +190,13 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, return; } + case GLSLstd450FaceForward: + val->ssa->def = + nir_bcsel(nb, nir_flt(nb, nir_fdot(nb, src[2], src[1]), + nir_imm_float(nb, 0.0)), + src[0], nir_fneg(nb, src[0])); + return; + case GLSLstd450Asin: case GLSLstd450Acos: case GLSLstd450Atan: @@ -203,7 +210,6 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, case GLSLstd450Frexp: case GLSLstd450PackDouble2x32: case GLSLstd450UnpackDouble2x32: - case GLSLstd450FaceForward: case GLSLstd450Reflect: case GLSLstd450Refract: case GLSLstd450IMix: