diff options
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; +} |
