summaryrefslogtreecommitdiffstats
path: root/tests/metal/vector-argument-buffer-layout.slang
blob: 5e45e3a01c2bb1c5a996b63fe7b8f3d7f83e24cb (plain)
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
//TEST:REFLECTION(filecheck=CHECK): -target metal


//CHECK: "name": "o",
//CHECK: "binding": {"kind": "constantBuffer", "index": 0},

//CHECK: "name": "gParams",
//CHECK: "binding": {"kind": "constantBuffer", "index": 1},


//CHECK: "dir"
//CHECK: "binding": {"kind": "uniform", "offset": 0, "size": 16, "elementStride": 4}
//CHECK: "color"
//CHECK: "binding": {"kind": "uniform", "offset": 16, "size": 16, "elementStride": 4}

struct Params
{
    float3 dir;
    float4 color;
}

RWStructuredBuffer<float> o;
ParameterBlock<Params> gParams;

[numthreads(1,1,1)]
void computeMain()
{
    o[0] = gParams.dir.x;
}