Add interface blocks as a basic type and handle uniform blocks that have an instance name. Includes handling qualifiers on structure members.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21093 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-04-10 02:06:46 +00:00
parent e9942d26f5
commit f6648dc12c
8 changed files with 139 additions and 54 deletions

View File

@@ -1,30 +1,30 @@
#version 300 es
layout(location = 7) in vec4 c;
layout(location = 7) in vec3 c;
layout(LocatioN = 3) in vec4 p;
out vec4 pos;
out vec4 color;
out vec3 color;
layout(shared, column_major, row_major) uniform mat4 m4; // default is now shared and row_major
//layout(std140) uniform Transform { // layout of this block is std140
// mat4 M1; // row_major
// layout(column_major) mat4 M2; // column major
// mat3 N1; // row_major
//};
//
layout(std140) uniform Transform { // layout of this block is std140
mat4 M1; // row_major
layout(column_major) mat4 M2; // column major
mat3 N1; // row_major
} tblock;
//uniform T2 { // layout of this block is shared
//...
//};
//
//layout(column_major) uniform T3 { // shared and column_major
// mat4 M3; // column_major
// layout(row_major) mat4 m4; // row major
// mat3 N2; // column_major
//};
layout(column_major) uniform T3 { // shared and column_major
mat4 M3; // column_major
layout(row_major) mat4 m4; // row major
mat3 N2; // column_major
};
void main()
{
pos = p * m4;
color = c;
pos = p * (m4 + tblock.M1 + tblock.M2);
color = c * tblock.N1;
}

View File

@@ -61,7 +61,7 @@ layout(row_major, column_major)
layout(shared, row_major) uniform; // default is now shared and row_major
layout(std140) uniform Transform { // layout of this block is std140
layout(std140) uniform Transform2 { // layout of this block is std140
mat4 M1; // row_major
layout(column_major) mat4 M2; // column major
mat3 N1; // row_major
@@ -124,7 +124,7 @@ coherent buffer Block {
vec4 member2;
};
buffer Block {
buffer Block2 {
coherent readonly vec4 member1;
coherent vec4 member2;
};