diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-01-18 00:01:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-17 21:01:58 -0800 |
| commit | a0994a8da142e54362e9ec1fdb5e5abc708ec3d2 (patch) | |
| tree | 363e75df065338fdb1da29286d932733fdb6b3c4 /tests/spirv/spirv-debug-break.slang | |
| parent | 1a486813ef0bc7f7a2eb6eaeec2921fd71a2bd05 (diff) | |
Add `set` to spirv_instruction (#2597)
Diffstat (limited to 'tests/spirv/spirv-debug-break.slang')
| -rw-r--r-- | tests/spirv/spirv-debug-break.slang | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/spirv/spirv-debug-break.slang b/tests/spirv/spirv-debug-break.slang new file mode 100644 index 000000000..18e8c8597 --- /dev/null +++ b/tests/spirv/spirv-debug-break.slang @@ -0,0 +1,22 @@ +// spirv-instruction.slang +//TEST(compute, vulkan):SIMPLE:-target glsl -entry computeMain -stage compute + +[[vk::spirv_instruction(1, "NonSemantic.DebugBreak")]] +void _spvDebugBreak(int v); + +[ForceInline] +void _debugBreak() { _spvDebugBreak(1); } + + +//TEST_INPUT:set resultBuffer = out ubuffer(data=[0 0 0 0], stride=4) +RWStructuredBuffer<uint> resultBuffer; + +[numthreads(4,1,1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint threadId = dispatchThreadID.x; + + _debugBreak(); + + resultBuffer[threadId] = threadId + threadId; +} |
