| 1 |
#version 450 |
| 2 |
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; |
| 3 |
|
| 4 |
struct Foo |
| 5 |
{ |
| 6 |
int a; |
| 7 |
int b; |
| 8 |
int c; |
| 9 |
}; |
| 10 |
|
| 11 |
layout(binding = 1, std140) buffer SSBO1 |
| 12 |
{ |
| 13 |
layout(offset = 4) int a; |
| 14 |
layout(offset = 8) int b; |
| 15 |
layout(offset = 16) Foo foo; |
| 16 |
layout(offset = 48) int c[8]; |
| 17 |
} ssbo1; |
| 18 |
|
| 19 |
layout(binding = 2, std430) buffer SSBO2 |
| 20 |
{ |
| 21 |
layout(offset = 4) int a; |
| 22 |
layout(offset = 8) int b; |
| 23 |
layout(offset = 16) Foo foo; |
| 24 |
layout(offset = 48) int c[8]; |
| 25 |
} ssbo2; |
| 26 |
|
| 27 |
layout(binding = 0, std140) uniform UBO |
| 28 |
{ |
| 29 |
layout(offset = 4) int a; |
| 30 |
layout(offset = 8) int b; |
| 31 |
layout(offset = 16) Foo foo; |
| 32 |
layout(offset = 48) int c[8]; |
| 33 |
} ubo; |
| 34 |
|
| 35 |
void main() |
| 36 |
{ |
| 37 |
ssbo1.a = ssbo2.a; |
| 38 |
ssbo1.b = ubo.b; |
| 39 |
} |
| 40 |
|