forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgh-4305.slang
40 lines (35 loc) · 1.48 KB
/
gh-4305.slang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target glsl -allow-glsl -DQUAD -DMODIFIER
//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target glsl -allow-glsl -DMODIFIER
//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target glsl -allow-glsl -DQUAD
//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target glsl -allow-glsl
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -output-using-type -emit-spirv-via-glsl -allow-glsl -xslang -DQUAD
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -output-using-type -emit-spirv-via-glsl -allow-glsl
//TEST_INPUT: ubuffer(data=[0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;
//TEST_INPUT: Texture2D(size=4, content = one):name t2D
Texture2D<float> t2D;
//TEST_INPUT: Sampler:name samplerState
SamplerState samplerState;
// "local_size_x" must appear before "derivative_group_"
//CHECK:local_size_x
//CHECK:derivative_group_{{.*}}NV
#ifndef MODIFIER
#ifdef QUAD
layout(derivative_group_quadsNV) in;
#else
layout(derivative_group_linearNV) in;
#endif // #ifdef QUAD
layout(local_size_x = 2, local_size_y = 2, local_size_z = 1) in;
#else
#ifdef QUAD
[DerivativeGroupQuad]
#else
[DerivativeGroupLinear]
#endif // #ifdef QUAD
[numthreads(2, 2, 1)]
#endif //#ifndef MODIFIER
void computeMain()
{
//BUF:1
outputBuffer[0] = t2D.Sample(samplerState, float2(0.5, 0.5));
}