summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile/glsl-texturegather.slang
blob: 1647faaacb2f9746a17f1eb9ed4586ea099f29f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//TEST:SIMPLE(filecheck=CHECK): -stage fragment -entry main -target spirv -emit-spirv-directly
//TEST:SIMPLE(filecheck=CHECK): -stage fragment -entry main -target spirv

// CHECK: OpImageDrefGather
// CHECK: OpImageDrefGather
// CHECK: OpImageDrefGather
// CHECK: OpImageDrefGather

Texture2D t;
SamplerState s;
SamplerComparisonState sc;
float4 main()
{
    const float2 loc = float2(1,2);
    const float cmp = 3;
    const int2 off = int2(4,5);
    return t.GatherCmp(sc, loc, cmp)
         + t.GatherCmp(sc, loc, cmp, off)
         + t.GatherCmp(sc, loc, cmp, off, off, off, off)
         + t.GatherCmpRed(sc, loc, cmp, int2(6,6), int2(7,7), int2(8,8), int2(9,9));
}