From e22c0b72b8bedb330d8b20e488f6898f6c484187 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:18:17 -0600 Subject: Fix system semantics of SV_GroupIndex (#5496) Close the issue #4940. --- source/slang/slang-ir-wgsl-legalize.cpp | 7 +++++++ tests/compute/texture-simpler.slang | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/slang/slang-ir-wgsl-legalize.cpp b/source/slang/slang-ir-wgsl-legalize.cpp index 691810cbb..8ac58780d 100644 --- a/source/slang/slang-ir-wgsl-legalize.cpp +++ b/source/slang/slang-ir-wgsl-legalize.cpp @@ -154,6 +154,13 @@ WGSLSystemValueInfo LegalizeWGSLEntryPointContext::getSystemValueInfo( } break; + case SystemValueSemanticName::GroupIndex: + { + result.wgslSystemValueName = toSlice("local_invocation_index"); + result.permittedTypes.add(builder.getUIntType()); + } + break; + default: { m_sink->diagnose( diff --git a/tests/compute/texture-simpler.slang b/tests/compute/texture-simpler.slang index 777f13ef6..19803798f 100644 --- a/tests/compute/texture-simpler.slang +++ b/tests/compute/texture-simpler.slang @@ -5,7 +5,7 @@ //TEST(smoke,compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type -render-feature hardware-device //TEST(smoke,compute):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj -output-using-type //TEST(smoke,compute):COMPARE_COMPUTE:-slang -shaderobj -mtl -output-using-type -//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -wgpu +//TEST(smoke,compute):COMPARE_COMPUTE:-wgpu -slang -compute -shaderobj -output-using-type //TEST_INPUT: Texture2D(size=4, content = one):name t2D Texture2D t2D; -- cgit v1.2.3