Skip to content

Commit

Permalink
Fix system semantics of SV_GroupIndex (shader-slang#5496)
Browse files Browse the repository at this point in the history
Close the issue shader-slang#4940.
  • Loading branch information
kaizhangNV authored Nov 5, 2024
1 parent 0336a3a commit e22c0b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions source/slang/slang-ir-wgsl-legalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/compute/texture-simpler.slang
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e22c0b7

Please sign in to comment.