From 08026880d6b11cf6efc4a00ed1feefc11f07b0a2 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 17 Oct 2025 09:01:33 +0200 Subject: [PATCH] vkd3d-shader/msl: Implement VSIR_OP_COUNTBITS. --- libs/vkd3d-shader/msl.c | 3 +++ tests/hlsl/bitwise.shader_test | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 32ae42d72..25a10145a 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -1444,6 +1444,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d case VSIR_OP_COS: msl_intrinsic(gen, ins, "cos"); break; + case VSIR_OP_COUNTBITS: + msl_intrinsic(gen, ins, "popcount"); + break; case VSIR_OP_DCL_INDEXABLE_TEMP: msl_dcl_indexable_temp(gen, ins); break; diff --git a/tests/hlsl/bitwise.shader_test b/tests/hlsl/bitwise.shader_test index 775b5568b..82a8d4630 100644 --- a/tests/hlsl/bitwise.shader_test +++ b/tests/hlsl/bitwise.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target [test] uniform 0 uint4 0 0xffffffff 0xcccccccc 0x31415926 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad if(sm>=4) probe (0, 0) f32(0, 32, 16, 12) if(sm<4) probe (0, 0) f32(0, 0, 0, 0)