yum-mirror/slang

Making it easier to work with shaders

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

Jay KwakPrepare VulkanSDK release Oct 2025 (#8525)db44c1b73

master
930 B35 linesraw
1//TEST:SIMPLE(filecheck=CHECK_SPV_SYNTAX): -allow-glsl -fvk-use-entrypoint-name -target spirv
2// CHECK_SPV_SYNTAX: DerivativeGroupQuads{{NV|KHR}}
3// CHECK_SPV_SYNTAX: DerivativeGroupLinear{{NV|KHR}}
4
5//TEST:SIMPLE(filecheck=CHECK_GLSL_SYNTAX): -allow-glsl -fvk-use-entrypoint-name -target spirv -DGLSL_SYNTAX
6// CHECK_GLSL_SYNTAX: DerivativeGroupQuads{{NV|KHR}}
7// CHECK_GLSL_SYNTAX: DerivativeGroupQuads{{NV|KHR}}
8#ifdef GLSL_SYNTAX
9layout(derivative_group_quadsNV) in;
10#endif
11
12buffer MyBlockName
13{
14    int result;
15} outputBuffer;
16
17#if !defined(GLSL_SYNTAX)
18[DerivativeGroupQuad]
19#endif
20[shader("compute")]
21[numthreads(2,2,1)]
22void main1(uint3 dispatchThreadID : SV_DispatchThreadID)
23{
24    outputBuffer.result = asint(ddx(1));
25}
26
27#if !defined(GLSL_SYNTAX)
28[DerivativeGroupLinear]
29[shader("compute")]
30[numthreads(4,1,1)]
31void main2(uint3 dispatchThreadID : SV_DispatchThreadID)
32{
33    outputBuffer.result = asint(ddx(1));
34}
35#endif