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 | |
| parent | 1a486813ef0bc7f7a2eb6eaeec2921fd71a2bd05 (diff) | |
Add `set` to spirv_instruction (#2597)
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/spirv-debug-break.slang | 22 | ||||
| -rw-r--r-- | tests/spirv/spirv-debug-break.slang.expected | 35 |
2 files changed, 57 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; +} diff --git a/tests/spirv/spirv-debug-break.slang.expected b/tests/spirv/spirv-debug-break.slang.expected new file mode 100644 index 000000000..d8ac8e010 --- /dev/null +++ b/tests/spirv/spirv-debug-break.slang.expected @@ -0,0 +1,35 @@ +result code = 0 +standard error = { +} +standard output = { +#version 450 +#extension GL_EXT_spirv_intrinsics : require +layout(row_major) uniform; +layout(row_major) buffer; + +#line 5 0 +spirv_instruction(id = 1, set = "NonSemantic.DebugBreak") +void _spvDebugBreak_0(int _0); + + +#line 12 +layout(std430, binding = 0) buffer _S1 { + uint _data[]; +} resultBuffer_0; +layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; +void main() +{ + +#line 17 + uint threadId_0 = gl_GlobalInvocationID.x; + + _spvDebugBreak_0(1); + + uint _S2 = threadId_0 + threadId_0; + +#line 21 + ((resultBuffer_0)._data[(threadId_0)]) = _S2; + return; +} + +} |
