From: Jason Ekstrand Date: Wed, 6 Jan 2016 23:24:38 +0000 (-0800) Subject: nir/spirv: Properly implement Modf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=22804de110b97dce1415318fd02c1003e16ef14a;p=mesa.git nir/spirv: Properly implement Modf --- diff --git a/src/glsl/nir/spirv/vtn_glsl450.c b/src/glsl/nir/spirv/vtn_glsl450.c index fd8ec3eb2dc..739e4394954 100644 --- a/src/glsl/nir/spirv/vtn_glsl450.c +++ b/src/glsl/nir/spirv/vtn_glsl450.c @@ -111,7 +111,14 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, case GLSLstd450Sqrt: op = nir_op_fsqrt; break; case GLSLstd450InverseSqrt: op = nir_op_frsq; break; - case GLSLstd450Modf: op = nir_op_fmod; break; + case GLSLstd450Modf: { + val->ssa->def = nir_ffract(nb, src[0]); + nir_deref_var *out = vtn_value(b, w[6], vtn_value_type_deref)->deref; + nir_store_deref_var(nb, out, nir_ffloor(nb, src[0]), 0xf); + return; + } + + op = nir_op_fmod; break; case GLSLstd450FMin: op = nir_op_fmin; break; case GLSLstd450UMin: op = nir_op_umin; break; case GLSLstd450SMin: op = nir_op_imin; break;