From 70f5b24f92f5ae2270f37c6f7f519c4c3f26aec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Thu, 29 Jun 2017 13:40:27 +0200 Subject: [PATCH] libs/vkd3d-shader: Avoid using GLSL.std450 NMin, NMax and NClamp opcodes. These opcodes were implemented by Mesa just few days ago. In addition using these opcodes in a shader leads to a crash on Nvidia. In practice this change doesn't seem to make a difference. We still want to use NMin, NMax and NClamp for correctness. This commit is meant to be reverted when problems with these opcodes are resolved. --- libs/vkd3d-shader/spirv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index a6910a1a..dac8b77f 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -740,7 +740,7 @@ static uint32_t vkd3d_spirv_build_op_glsl_std450_nclamp(struct vkd3d_spirv_build uint32_t glsl_std450_id = vkd3d_spirv_get_glsl_std450_instr_set(builder); uint32_t operands[] = {x, min, max}; return vkd3d_spirv_build_op_ext_inst(builder, result_type, glsl_std450_id, - GLSLstd450NClamp, operands, ARRAY_SIZE(operands)); + GLSLstd450FClamp, operands, ARRAY_SIZE(operands)); } static uint32_t vkd3d_spirv_get_type_id(struct vkd3d_spirv_builder *builder, @@ -1899,8 +1899,8 @@ static enum GLSLstd450 vkd3d_dxbc_compiler_map_ext_glsl_instruction( {VKD3DSIH_FIRSTBIT_LO, GLSLstd450FindILsb}, {VKD3DSIH_FIRSTBIT_SHI, GLSLstd450FindSMsb}, {VKD3DSIH_MAD, GLSLstd450Fma}, - {VKD3DSIH_MAX, GLSLstd450NMax}, - {VKD3DSIH_MIN, GLSLstd450NMin}, + {VKD3DSIH_MAX, GLSLstd450FMax}, + {VKD3DSIH_MIN, GLSLstd450FMin}, {VKD3DSIH_RSQ, GLSLstd450InverseSqrt}, {VKD3DSIH_SQRT, GLSLstd450Sqrt}, };