SPV: Nested layouts: Recursively send around the top-level std140 or std430 packing.

This also distinguishes between the same struct included in multiple parent packings.
This commit is contained in:
John Kessenich
2015-12-19 13:57:10 -07:00
parent b62e693f74
commit f85e806e44
5 changed files with 216 additions and 34 deletions

View File

@@ -0,0 +1,31 @@
#version 450
// should get 3 SPV types: no layout, 140, and 430
struct S
{
highp uvec3 a;
mediump mat2 b[4];
lowp uint c;
};
layout(set = 0, binding = 0, std140) uniform Block140
{
mediump int u;
S s[2][3];
mediump vec2 v;
} inst140;
layout(set = 0, binding = 1, std430) buffer Block430
{
mediump int u;
S s[2][3];
mediump vec2 v;
} inst430;
S s;
void main()
{
s.c = inst140.u;
gl_Position = vec4(s.c);
}