Skip to content

Commit e22c0b7

Browse files
authored
Fix system semantics of SV_GroupIndex (shader-slang#5496)
Close the issue shader-slang#4940.
1 parent 0336a3a commit e22c0b7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

source/slang/slang-ir-wgsl-legalize.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ WGSLSystemValueInfo LegalizeWGSLEntryPointContext::getSystemValueInfo(
154154
}
155155
break;
156156

157+
case SystemValueSemanticName::GroupIndex:
158+
{
159+
result.wgslSystemValueName = toSlice("local_invocation_index");
160+
result.permittedTypes.add(builder.getUIntType());
161+
}
162+
break;
163+
157164
default:
158165
{
159166
m_sink->diagnose(

tests/compute/texture-simpler.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//TEST(smoke,compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type -render-feature hardware-device
66
//TEST(smoke,compute):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj -output-using-type
77
//TEST(smoke,compute):COMPARE_COMPUTE:-slang -shaderobj -mtl -output-using-type
8-
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -wgpu
8+
//TEST(smoke,compute):COMPARE_COMPUTE:-wgpu -slang -compute -shaderobj -output-using-type
99

1010
//TEST_INPUT: Texture2D(size=4, content = one):name t2D
1111
Texture2D<float> t2D;

0 commit comments

Comments
 (0)