From 4dec4e995908710f7462cbc4ff9c9b50bc1c2bd5 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 29 Sep 2024 22:47:21 +0200 Subject: [PATCH] vkd3d-shader/glsl: Implement VKD3DSIH_ILT. --- libs/vkd3d-shader/glsl.c | 7 ++++--- tests/hlsl/conditional.shader_test | 6 +++--- tests/hlsl/logic-operations.shader_test | 4 ++-- tests/hlsl/vertex-shader-ops.shader_test | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index 6b7d1e89..6a8a5628 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -1073,6 +1073,10 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen, case VKD3DSIH_MAD: shader_glsl_intrinsic(gen, ins, "fma"); break; + case VKD3DSIH_ILT: + case VKD3DSIH_LTO: + shader_glsl_relop(gen, ins, "<", "lessThan"); + break; case VKD3DSIH_ISHL: shader_glsl_binop(gen, ins, "<<"); break; @@ -1080,9 +1084,6 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen, case VKD3DSIH_USHR: shader_glsl_binop(gen, ins, ">>"); break; - case VKD3DSIH_LTO: - shader_glsl_relop(gen, ins, "<", "lessThan"); - break; case VKD3DSIH_MAX: shader_glsl_intrinsic(gen, ins, "max"); break; diff --git a/tests/hlsl/conditional.shader_test b/tests/hlsl/conditional.shader_test index 32967d91..cfc2d1e0 100644 --- a/tests/hlsl/conditional.shader_test +++ b/tests/hlsl/conditional.shader_test @@ -145,19 +145,19 @@ if(sm<4) uniform 0 float 8 if(sm<4) uniform 4 float 9 if(sm>=4) uniform 0 int 8 if(sm>=4) uniform 1 int 9 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0) if(sm<4) uniform 0 float -3 if(sm<4) uniform 4 float -4 if(sm>=4) uniform 0 int -3 if(sm>=4) uniform 1 int -4 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float 7 if(sm<4) uniform 4 float 7 if(sm>=4) uniform 0 int 7 if(sm>=4) uniform 1 int 7 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) diff --git a/tests/hlsl/logic-operations.shader_test b/tests/hlsl/logic-operations.shader_test index 931d8010..e6b65b18 100644 --- a/tests/hlsl/logic-operations.shader_test +++ b/tests/hlsl/logic-operations.shader_test @@ -171,11 +171,11 @@ if(sm<4) uniform 0 float 5 if(sm<4) uniform 4 float 0 if(sm>=4) uniform 0 int 5 if(sm>=4) uniform 1 int 0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 0.0, 1.0) if(sm<4) uniform 0 float -1 if(sm<4) uniform 4 float 3 if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 int 3 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (0.0, 1.0, 0.0, 0.0) diff --git a/tests/hlsl/vertex-shader-ops.shader_test b/tests/hlsl/vertex-shader-ops.shader_test index 3f4f1f31..0bbbf706 100644 --- a/tests/hlsl/vertex-shader-ops.shader_test +++ b/tests/hlsl/vertex-shader-ops.shader_test @@ -49,12 +49,12 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos if(sm<4) uniform 0 float 3 if(sm<4) uniform 4 float 4 if(sm>=4) uniform 0 int4 3 4 0 0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0) if(sm<4) uniform 0 float -2 if(sm<4) uniform 4 float -2 if(sm>=4) uniform 0 int4 -2 -2 0 0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (1.0, 0.0, 0.0, 1.0)