From 824f7763550bf83ade57a45fcce4c5a6ac0c4a85 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 21 Jan 2016 14:56:34 -0800 Subject: [PATCH] nir/spirv: Implement ModfStruct opcode. --- src/glsl/nir/spirv/vtn_glsl450.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/spirv/vtn_glsl450.c b/src/glsl/nir/spirv/vtn_glsl450.c index afcf8e2a7da..a675aa4c7f3 100644 --- a/src/glsl/nir/spirv/vtn_glsl450.c +++ b/src/glsl/nir/spirv/vtn_glsl450.c @@ -424,6 +424,13 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, return; } + case GLSLstd450ModfStruct: { + assert(glsl_type_is_struct(val->ssa->type)); + val->ssa->elems[0]->def = nir_ffract(nb, src[0]); + val->ssa->elems[1]->def = nir_ffloor(nb, src[0]); + return; + } + case GLSLstd450FMin: op = nir_op_fmin; break; case GLSLstd450UMin: op = nir_op_umin; break; case GLSLstd450SMin: op = nir_op_imin; break; @@ -618,7 +625,6 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint, return; } - case GLSLstd450ModfStruct: case GLSLstd450PackDouble2x32: case GLSLstd450UnpackDouble2x32: case GLSLstd450IMix: -- 2.30.2