summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-11-05 15:18:17 -0600
committerGitHub <noreply@github.com>2024-11-05 13:18:17 -0800
commite22c0b72b8bedb330d8b20e488f6898f6c484187 (patch)
treeed532eab1a86f0a8dcdf694f386a343659485fb8
parent0336a3a8db7f50dcbb21b11a94fb1e4f31d946eb (diff)
Fix system semantics of SV_GroupIndex (#5496)
Close the issue #4940.
-rw-r--r--source/slang/slang-ir-wgsl-legalize.cpp7
-rw-r--r--tests/compute/texture-simpler.slang2
2 files changed, 8 insertions, 1 deletions
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<float> t2D;