File: copy_struct_1.slang

package info (click to toggle)
spirv-reflect 1.4.328.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,260 kB
  • sloc: ansic: 13,975; cpp: 5,963; python: 140; sh: 76; makefile: 12
file content (28 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (2)
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
struct Bar {
    uint x;
    uint y;
    uint z[2];
};

struct FooBuffer1 {
    float4 a;
    Bar b;
    uint d;
};

struct FooBuffer2 {
    float4 d;
    Bar e;
    uint f;
};

[[vk::binding(0, 0)]]
RWStructuredBuffer<FooBuffer1> foo1;

[[vk::binding(0, 1)]]
RWStructuredBuffer<FooBuffer2> foo2;

[shader("compute")]
void main() {
    foo1[0].b = foo2[0].e;
}