From d8ea8894ab68a82269f65da59901af6dc06f7ea4 Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Tue, 26 Aug 2025 22:06:13 -0400 Subject: [PATCH] vkd3d-shader/hlsl: Support SM1 non-floating point CMP expressions. --- libs/vkd3d-shader/hlsl_codegen.c | 2 -- tests/hlsl/ternary.shader_test | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 4b27c6108..3fede7dcb 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -9772,8 +9772,6 @@ static bool sm1_generate_vsir_instr_expr(struct hlsl_ctx *ctx, struct vsir_progr break; case HLSL_OP3_CMP: - if (!hlsl_type_is_floating_point(type)) - goto err; generate_vsir_instr_expr_single_instr_op(ctx, program, expr, VSIR_OP_CMP, 0, 0, true); break; diff --git a/tests/hlsl/ternary.shader_test b/tests/hlsl/ternary.shader_test index 648e94ffd..6da1973f7 100644 --- a/tests/hlsl/ternary.shader_test +++ b/tests/hlsl/ternary.shader_test @@ -70,7 +70,7 @@ uniform 8 float4 5.0 6.0 7.0 8.0 draw quad probe (0, 0) rgba (5.0, 2.0, 7.0, 4.0) -[pixel shader todo(sm<4)] +[pixel shader] int4 x, y, z; float4 main() : sv_target @@ -85,10 +85,10 @@ if(sm<4) uniform 8 float4 5.0 6.0 7.0 8.0 if(sm>=4) uniform 0 int4 0 1 0 -3 if(sm>=4) uniform 4 int4 1 2 3 4 if(sm>=4) uniform 8 int4 5 6 7 8 -todo(sm<4) draw quad +draw quad probe (0, 0) f32(5.0, 2.0, 7.0, 4.0) -[pixel shader todo(sm<4)] +[pixel shader] uint4 x, y, z; float4 main() : sv_target @@ -103,7 +103,7 @@ if(sm<4) uniform 8 float4 5.0 6.0 7.0 8.0 if(sm>=4) uniform 0 uint4 0 1 0 3 if(sm>=4) uniform 4 uint4 1 2 3 4 if(sm>=4) uniform 8 uint4 5 6 7 8 -todo(sm<4) draw quad +draw quad probe (0, 0) f32(5.0, 2.0, 7.0, 4.0) % The usual type conversion is applied to the first and second expression, as @@ -222,7 +222,7 @@ uniform 0 float4 1.0 2.0 0.0 0.0 draw quad probe (0, 0) f32(2.0, 1.0, 0.0, 0.0) -[pixel shader todo(sm<4)] +[pixel shader] uniform float c; float4 main() : sv_target @@ -233,7 +233,7 @@ float4 main() : sv_target [test] uniform 0 float -1.0 -todo(sm<4) draw quad +draw quad probe (0, 0) f32(0.0, 1.0, 0.0, 0.0) [pixel shader]