SPIRV-Cross/shaders/desktop-only/comp/enhanced-layouts.comp

40 lines
611 B
Plaintext
Raw Normal View History

2017-10-10 09:30:29 +00:00
#version 450
struct Foo
{
int a;
int b;
int c;
};
layout(std140, binding = 0) uniform UBO
{
layout(offset = 4) int a;
layout(offset = 8) int b;
layout(offset = 16) Foo foo;
layout(offset = 48) int c[8];
} ubo;
layout(std140, binding = 1) buffer SSBO1
{
layout(offset = 4) int a;
layout(offset = 8) int b;
layout(offset = 16) Foo foo;
layout(offset = 48) int c[8];
} ssbo1;
layout(std430, binding = 2) buffer SSBO2
{
layout(offset = 4) int a;
layout(offset = 8) int b;
layout(offset = 16) Foo foo;
layout(offset = 48) int c[8];
} ssbo2;
void main()
{
2017-10-10 14:25:47 +00:00
ssbo1.a = ssbo2.a;
ssbo1.b = ubo.b;
2017-10-10 09:30:29 +00:00
}