=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: libs/vkd3d-shader: Use GLSL.std450 NMin , NMax and NClamp opcodes.

Alexandre Julliard julliard at winehq.org
Thu Jan 25 17:25:33 CST 2018


Module: vkd3d
Branch: master
Commit: b1fc5039c8231e0d3c98e7772a2cc8df81f8c213
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=b1fc5039c8231e0d3c98e7772a2cc8df81f8c213

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Jan 25 12:04:27 2018 +0100

libs/vkd3d-shader: Use GLSL.std450 NMin, NMax and NClamp opcodes.

This reverts commit 70f5b24f92f5ae2270f37c6f7f519c4c3f26aec0.

The bug is fixed in Nvidia drivers.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/spirv.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 50803af..d92b7b1 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -1423,9 +1423,8 @@ 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};
-    /* XXX: We would prefer to use NClamp but NClamp crashes the Nvidia driver. */
     return vkd3d_spirv_build_op_ext_inst(builder, result_type, glsl_std450_id,
-            GLSLstd450FClamp, operands, ARRAY_SIZE(operands));
+            GLSLstd450NClamp, operands, ARRAY_SIZE(operands));
 }
 
 static uint32_t vkd3d_spirv_get_type_id(struct vkd3d_spirv_builder *builder,
@@ -3733,11 +3732,8 @@ static enum GLSLstd450 vkd3d_dxbc_compiler_map_ext_glsl_instruction(
         {VKD3DSIH_IMIN,            GLSLstd450SMin},
         {VKD3DSIH_LOG,             GLSLstd450Log2},
         {VKD3DSIH_MAD,             GLSLstd450Fma},
-        /* XXX: We would prefer to use NMax/NMin but these opcodes lead to
-         * a crash in the Nvidia driver.
-         */
-        {VKD3DSIH_MAX,             GLSLstd450FMax},
-        {VKD3DSIH_MIN,             GLSLstd450FMin},
+        {VKD3DSIH_MAX,             GLSLstd450NMax},
+        {VKD3DSIH_MIN,             GLSLstd450NMin},
         {VKD3DSIH_ROUND_NI,        GLSLstd450Floor},
         {VKD3DSIH_ROUND_PI,        GLSLstd450Ceil},
         {VKD3DSIH_ROUND_Z,         GLSLstd450Trunc},




More information about the wine-cvs mailing list