SPIRV-Cross/shaders/desktop-only/comp/enhanced-layouts.comp
2017-10-10 16:25:47 +02:00

40 lines
611 B
Plaintext

#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()
{
ssbo1.a = ssbo2.a;
ssbo1.b = ubo.b;
}