diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 9e28dc0c0..565f67e90 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -1585,6 +1585,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d case VSIR_OP_IF: msl_if(gen, ins); break; + case VSIR_OP_UREM: + msl_binop(gen, ins, "%"); + break; case VSIR_OP_ISHL: msl_binop(gen, ins, "<<"); break; diff --git a/tests/hlsl/arithmetic-int-uniform.shader_test b/tests/hlsl/arithmetic-int-uniform.shader_test index c6bc9a8c4..5b0378025 100644 --- a/tests/hlsl/arithmetic-int-uniform.shader_test +++ b/tests/hlsl/arithmetic-int-uniform.shader_test @@ -25,8 +25,8 @@ float4 main() : SV_TARGET [test] uniform 0 float4 5.0 16.0 0.0 0.0 -todo(msl) draw quad -probe (0, 0) rgba (5.0, 5.0, -5.0, 3.0) +todo(msl & sm>=6) draw quad +probe (0, 0) f32(5.0, 5.0, -5.0, 3.0) [pixel shader] uniform float2 a; @@ -55,8 +55,8 @@ float4 main() : SV_TARGET [test] uniform 0 float4 42.0 5.0 0.0 0.0 -todo(msl) draw quad -bug(mvk<1.2.11) probe (0, 0) rgba (2.0, -2.0, 2.0, -2.0) +todo(msl & sm>=6) draw quad +bug(mvk<1.2.11) probe (0, 0) f32(2.0, -2.0, 2.0, -2.0) [pixel shader] uniform float2 a; @@ -85,8 +85,8 @@ float4 main() : SV_TARGET [test] uniform 0 float4 45.0 5.0 0.0 0.0 -todo(msl) draw quad -bug(mvk<1.2.11) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) +todo(msl & sm>=6) draw quad +bug(mvk<1.2.11) probe (0, 0) f32(0.0, 0.0, 0.0, 0.0) [pixel shader] uniform float4 a; @@ -117,8 +117,8 @@ float4 main() : sv_target [test] uniform 0 float4 45.0 5.0 50.0 10.0 uniform 4 float4 3.0 8.0 2.0 5.0 -todo(msl) draw quad -probe (0, 0) rgba (9.0, 5.0, 1.0, 3.0) +todo(msl & sm>=6) draw quad +probe (0, 0) f32(9.0, 5.0, 1.0, 3.0) [pixel shader] float f; @@ -133,9 +133,9 @@ float4 main() : sv_target [test] uniform 0 float 10.0 -todo(msl) draw quad -if(sm<4) probe (0, 0) rgba(6, 6, -6, -6) -if(sm>=4) bug(mvk<1.2.11) probe (0, 0) rgba(7, 7, -7, -7) +todo(msl & sm>=6) draw quad +if(sm<4) probe (0, 0) f32(6, 6, -6, -6) +if(sm>=4) bug(mvk<1.2.11) probe (0, 0) f32(7, 7, -7, -7) [pixel shader] float f; diff --git a/tests/hlsl/arithmetic-uint.shader_test b/tests/hlsl/arithmetic-uint.shader_test index f7c9f95de..8b1ea5f92 100644 --- a/tests/hlsl/arithmetic-uint.shader_test +++ b/tests/hlsl/arithmetic-uint.shader_test @@ -67,20 +67,20 @@ void main(out uint4 dst : sv_target) [test] uniform 0 uint4 0 0 1 0 -todo(msl) draw quad +draw quad % Integer division by zero is undefined for shader model 6 targets. if(sm<6) probe (0, 0) u32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff) uniform 0 uint4 1 1 7 1 -todo(msl) draw quad +draw quad probe (0, 0) u32(1, 7, 0, 0) uniform 0 uint4 7 2 7 3 -todo(msl) draw quad +draw quad probe (0, 0) u32(3, 2, 1, 1) uniform 0 uint4 7 4 7 5 -todo(msl) draw quad +draw quad probe (0, 0) u32(1, 1, 3, 2) uniform 0 uint4 7 6 7 7 -todo(msl) draw quad +draw quad probe (0, 0) u32(1, 1, 1, 0) % Test expression normalization and simplification.