From 9fd7f4f1ec4d38ca03bcfd4271a752cee6185cee Mon Sep 17 00:00:00 2001 From: Feifan He Date: Fri, 22 Nov 2024 15:45:54 +0800 Subject: [PATCH] vkd3d-shader/msl: Implement VKD3DSIH_UTOF. --- libs/vkd3d-shader/msl.c | 1 + tests/hlsl/asint.shader_test | 2 +- tests/hlsl/asuint.shader_test | 4 ++-- tests/hlsl/cast-to-float.shader_test | 2 +- tests/hlsl/cast-to-half.shader_test | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index a600eef9..e108e805 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -524,6 +524,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d msl_relop(gen, ins, "!="); break; case VKD3DSIH_ITOF: + case VKD3DSIH_UTOF: msl_cast(gen, ins, "float"); break; case VKD3DSIH_MOV: diff --git a/tests/hlsl/asint.shader_test b/tests/hlsl/asint.shader_test index 83e84d49..9a7d8205 100644 --- a/tests/hlsl/asint.shader_test +++ b/tests/hlsl/asint.shader_test @@ -20,7 +20,7 @@ float4 main() : sv_target [test] uniform 0 int4 123 0xc00000 456 0x7fd69345 -todo(msl) draw quad +draw quad probe (320,240) rgba (123.0, 12582912.0, 456.0, 2144768896.0) [pixel shader] diff --git a/tests/hlsl/asuint.shader_test b/tests/hlsl/asuint.shader_test index b67fd8ea..50b0895e 100644 --- a/tests/hlsl/asuint.shader_test +++ b/tests/hlsl/asuint.shader_test @@ -20,7 +20,7 @@ float4 main() : sv_target [test] uniform 0 uint4 123 0xc0000000 456 0x7fd69345 -todo(msl) draw quad +draw quad probe (320,240) rgba (123.0, 3221225472.0, 456.0, 2144768896.0) @@ -37,7 +37,7 @@ float4 main() : sv_target uniform 0 uint4 11 12 0 0 uniform 4 uint4 13 14 0 0 uniform 8 uint4 20 21 22 23 -todo(msl) draw quad +draw quad probe (320,240) rgba (13.0, 21.0, 0.0, 0.0) diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index 812d0bb1..e1f9f9cd 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 uint 3 if(sm>=4) uniform 2 int -2 if(sm>=4) uniform 3 float 0.5 -todo(msl) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index 042e7aab..4df5f6ab 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 uint 3 if(sm>=4) uniform 2 int -2 if(sm>=4) uniform 3 float 0.5 -todo(msl) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5)