SPV: recursively propagate row/col majorness through nested structures.

This includes doing structure uniqueness modulo majorness, for shared nested structures.
This commit is contained in:
John Kessenich 2015-12-20 11:29:16 -07:00
parent f85e806e44
commit 3ac051e41d
9 changed files with 313 additions and 163 deletions

View file

@ -1,6 +1,6 @@
#version 450
// should get 3 SPV types: no layout, 140, and 430
// should get 3 SPV types for S: no layout, 140, and 430
struct S
{
highp uvec3 a;
@ -24,8 +24,50 @@ layout(set = 0, binding = 1, std430) buffer Block430
S s;
// should get 5 SPV types for T: no layout, 140/row, 140/col, 430/row, and 430/col
struct T {
mat2 m;
int a;
};
T t;
struct Nestor {
T nestorT;
};
layout(set = 1, binding = 0, std140) uniform Bt1
{
layout(row_major) Nestor nt;
} Btn1;
layout(set = 1, binding = 0, std140) uniform Bt2
{
layout(column_major) Nestor nt;
} Btn2;
layout(row_major, set = 1, binding = 0, std140) uniform Bt3
{
layout(column_major) Nestor ntcol;
Nestor ntrow; // should be row major decoration version of Nestor
} Btn3;
layout(set = 1, binding = 0, std430) buffer bBt1
{
layout(row_major) Nestor nt;
} bBtn1;
layout(set = 1, binding = 0, std430) buffer bBt2
{
layout(column_major) Nestor nt;
} bBtn2;
layout(set = 1, binding = 0, std430) buffer bBt3
{
layout(row_major) Nestor ntcol;
Nestor ntrow; // should be col major decoration version of Nestor
} bBtn3;
void main()
{
s.c = inst140.u;
gl_Position = vec4(s.c);
}