From b7605f1c3414e2d8d519dc3a69f091019b7fe756 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_OR. --- libs/vkd3d-shader/msl.c | 3 +++ tests/hlsl/any.shader_test | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 5dd3b5d8..e08b1a36 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -455,6 +455,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d case VKD3DSIH_MUL: msl_binop(gen, ins, "*"); break; + case VKD3DSIH_OR: + msl_binop(gen, ins, "|"); + break; case VKD3DSIH_RET: msl_ret(gen, ins); break; diff --git a/tests/hlsl/any.shader_test b/tests/hlsl/any.shader_test index c49ff528..c939b7cd 100644 --- a/tests/hlsl/any.shader_test +++ b/tests/hlsl/any.shader_test @@ -8,25 +8,25 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 1.0 1.0 1.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 1.0 0.0 0.0 0.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 1.0 0.0 0.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 1.0 0.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 1.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 -1.0 -1.0 -1.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) [pixel shader] @@ -60,27 +60,27 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 1 1 1 1 if(sm>=4) uniform 0 uint4 1 1 1 1 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 1 0 0 if(sm>=4) uniform 0 uint4 0 1 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 1 0 if(sm>=4) uniform 0 uint4 0 0 1 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 0 1 if(sm>=4) uniform 0 uint4 0 0 0 1 -todo(msl) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader]