aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_glsl450.c
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2018-03-21 20:34:38 +0100
committerNeil Roberts <[email protected]>2018-04-17 20:58:03 +0200
commit696f4abcbc07b96724307823b9e807cd981da3b5 (patch)
treefc02cacbb3dcc10402527c37c8bddbbc02f60e8c /src/compiler/spirv/vtn_glsl450.c
parente7b2c125c3f3df43b032e398d900e2ac7f91398a (diff)
spirv: Use nir_imm_floatN_t for constants for GLSL450 builtins
There is an existing macro that is used to choose between either a float or a double immediate constant based on the bit size of the first operand to the builtin. This is now changed to use the new nir_imm_floatN_t helper function to reduce the number of places that make this decision. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_glsl450.c')
-rw-r--r--src/compiler/spirv/vtn_glsl450.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_glsl450.c
index d208215ccb5..c74476a48d7 100644
--- a/src/compiler/spirv/vtn_glsl450.c
+++ b/src/compiler/spirv/vtn_glsl450.c
@@ -514,7 +514,7 @@ vtn_nir_alu_op_for_spirv_glsl_opcode(struct vtn_builder *b,
}
}
-#define NIR_IMM_FP(n, v) (src[0]->bit_size == 64 ? nir_imm_double(n, v) : nir_imm_float(n, v))
+#define NIR_IMM_FP(n, v) (nir_imm_floatN_t(n, v, src[0]->bit_size))
static void
handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,