yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVSupport derivative functions in compute & capabilities adjustments (#4014)366a947cd

master
764 B25 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target glsl -DSLANG
2//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target spirv -DSLANG
3
4//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target glsl -DGLSL
5//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target spirv -DGLSL
6// CHECK: error 31212
7
8buffer MyBlockName
9{
10    int result;
11} outputBuffer;
12
13#ifdef SLANG
14[DerivativeGroupQuad]
15[DerivativeGroupLinear]
16#endif
17#ifdef GLSL
18layout(derivative_group_quadsNV) in;
19layout(derivative_group_linearNV) in;
20#endif
21[numthreads(2, 2, 1)]
22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
23{
24    outputBuffer.result = asint(ddx(1));
25}