glslang/Test/spv.multiStruct.comp
John Kessenich 4bf7155051 SPV: Flatten structs for copy when they are GLSL type aliases.
Addresses issue #304 and issue #307 by replacing unmatched type OpStores with
per-member copies. Covers assignment statements and most argument passing, but
does not yet cover r-value-based argument passing.
2016-09-02 16:35:01 -06:00

49 lines
650 B
Plaintext

#version 450 core
struct MyStruct
{
vec4 foo;
bool sb;
};
layout(binding = 0, std430) buffer SSBO0
{
MyStruct a;
} inBuf;
layout(binding = 1, std430) buffer SSBO1
{
MyStruct b;
} outBuf;
layout(binding = 2, std140) uniform UBO
{
MyStruct c;
} uBuf;
struct Nested {
float f;
MyStruct S;
};
layout(binding = 2, std140) uniform UBON
{
Nested N1;
} uBufN;
layout(binding = 1, std430) buffer SSBO1N
{
Nested N2;
} outBufN;
void main()
{
MyStruct t = inBuf.a;
outBuf.b = t;
t = uBuf.c;
outBuf.b = t;
Nested n = uBufN.N1;
outBufN.N2 = n;
}