compiler/spirv: implement 16-bit acos
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 18 Apr 2018 07:15:01 +0000 (09:15 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 2 Jan 2019 06:54:05 +0000 (07:54 +0100)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/vtn_glsl450.c

index 1e3811f2cd189ab9788887c0329c4a6d9826582b..9211bca301c09b21436f812215971bc5b579baf3 100644 (file)
@@ -704,8 +704,9 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
       return;
 
    case GLSLstd450Acos:
-      val->ssa->def = nir_fsub(nb, nir_imm_float(nb, M_PI_2f),
-                               build_asin(nb, src[0], 0.08132463, -0.02363318));
+      val->ssa->def =
+         nir_fsub(nb, nir_imm_floatN_t(nb, M_PI_2f, src[0]->bit_size),
+                      build_asin(nb, src[0], 0.08132463, -0.02363318));
       return;
 
    case GLSLstd450Atan: