From c770efc530581de422b916e6954e5311c71354ab Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 18 Apr 2024 10:59:08 +1000 Subject: [PATCH] vkd3d-shader/spirv: Handle the WAVELANEINDEX register. --- libs/vkd3d-shader/spirv.c | 5 +++++ tests/hlsl/wave-ops-uint.shader_test | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index e76aa894..1da883b3 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3157,6 +3157,9 @@ static bool spirv_compiler_get_register_name(char *buffer, unsigned int buffer_s case VKD3DSPR_WAVELANECOUNT: snprintf(buffer, buffer_size, "vWaveLaneCount"); break; + case VKD3DSPR_WAVELANEINDEX: + snprintf(buffer, buffer_size, "vWaveLaneIndex"); + break; default: FIXME("Unhandled register %#x.\n", reg->type); snprintf(buffer, buffer_size, "unrecognized_%#x", reg->type); @@ -4543,6 +4546,7 @@ static void spirv_compiler_decorate_builtin(struct spirv_compiler *compiler, vkd3d_spirv_enable_capability(builder, SpvCapabilityCullDistance); break; case SpvBuiltInSubgroupSize: + case SpvBuiltInSubgroupLocalInvocationId: vkd3d_spirv_enable_capability(builder, SpvCapabilityGroupNonUniform); break; default: @@ -4736,6 +4740,7 @@ vkd3d_register_builtins[] = {VKD3DSPR_OUTSTENCILREF, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInFragStencilRefEXT}}, {VKD3DSPR_WAVELANECOUNT, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInSubgroupSize}}, + {VKD3DSPR_WAVELANEINDEX, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInSubgroupLocalInvocationId}}, }; static void spirv_compiler_emit_register_execution_mode(struct spirv_compiler *compiler, diff --git a/tests/hlsl/wave-ops-uint.shader_test b/tests/hlsl/wave-ops-uint.shader_test index de65e47d..666cf4d3 100644 --- a/tests/hlsl/wave-ops-uint.shader_test +++ b/tests/hlsl/wave-ops-uint.shader_test @@ -63,7 +63,7 @@ void main(uint id : SV_GroupIndex) } [test] -todo dispatch 4 1 1 +dispatch 4 1 1 probe uav 1 (0) rui (0) probe uav 1 (1) rui (1) probe uav 1 (2) rui (2)