diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-06-28 09:44:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-28 09:44:33 -0400 |
| commit | 0b5190226b3061597f0fd88ca6b1f304f2c6af38 (patch) | |
| tree | 3efc2c495b6d5c7eb95a02137c650b51fe054b9f /tests | |
| parent | e49419b0637a357d2e713a0435f0c5ad0c102487 (diff) | |
fix `WorkgroupSize()` compiler failiure (#4505)
in some cases was not destroying the hoisted to global `WorkgroupSize()` function
removed capability requirement on `gl_WorkGroupSize` since no longer appies (kIROp of `WorkgroupSize` is implemented for all targets)
change when destroying inst
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/gh-4504.slang | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bugs/gh-4504.slang b/tests/bugs/gh-4504.slang new file mode 100644 index 000000000..d6fc28e0c --- /dev/null +++ b/tests/bugs/gh-4504.slang @@ -0,0 +1,23 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-slang -dx12 -compute -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -compute -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -glsl -compute -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-mtl -compute -shaderobj + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer +RWStructuredBuffer<uint> outputBuffer; + +// note: `WorkgroupSize()` resolves into a compile time constant, +// it is possible `size.x == 5` and others will resolve into `true` +// at compile time. A compute test is required. +[shader("compute")] +[numthreads(5, 2, 1)] +void computeMain(uint3 threadId: SV_DispatchThreadID) +{ + // CHECK: 1 + int3 size = WorkgroupSize(); + outputBuffer[0] = true + && size.x == 5 + && size.y == 2 + && size.z == 1 + ; +}
\ No newline at end of file |
