yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Harsh Aggarwal (NVIDIA)Updated support to enable batch3 (#8219)e0c20a076

master
1.3 KiB29 linesraw
1//TEST:SIMPLE(filecheck=CHECK_GLSL):-stage compute -entry computeMain -target glsl -line-directive-mode none
2// We can't enable because output source includes path to prelude.
3//DISABLE_TEST:SIMPLE:-stage compute -entry computeMain -target cpp -line-directive-mode none
4//TEST:SIMPLE(filecheck=CHECK_CUDA):-stage compute -entry computeMain -target cuda -line-directive-mode none
5// Not currently supported on HLSL
6//DISABLE_TEST:SIMPLE:-stage compute -entry computeMain -target hlsl -line-directive-mode none
7// With `slang-llvm` this will crash, but the call stack isn't really usable.
8// With downstream host compilers this should break into the debugger. It's not enabled as that isn't testable.
9//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -shaderobj -Xslang... -O0 -g -X.
10
11//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer
12
13// CHECK_GLSL: spirv_instruction(id = 1, set = "NonSemantic.DebugBreak")
14// CHECK_GLSL: glslDebugBreak{{.*}}();
15// CHECK_GLSL: void main
16// CHECK_GLSL: glslDebugBreak{{.*}}();
17
18// CHECK_CUDA:__brkpt()
19RWStructuredBuffer<int> outputBuffer;
20
21[numthreads(4, 1, 1)]
22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
23{
24    const int idx = int(dispatchThreadID.x);
25
26    debugBreak();
27
28    outputBuffer[idx] = idx;    
29}