Skip to content
Snippets Groups Projects
Commit 04884e42 authored by John Kessenich's avatar John Kessenich
Browse files

Reflection: Expand out block arrays to N different blocks.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24159 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 1d1132d9
No related branches found
No related tags found
No related merge requests found
...@@ -27,12 +27,13 @@ ERROR: 0:83: 'lines' : does not only apply to output ...@@ -27,12 +27,13 @@ ERROR: 0:83: 'lines' : does not only apply to output
ERROR: 0:85: 'triangles' : cannot change previously set input primitive ERROR: 0:85: 'triangles' : cannot change previously set input primitive
ERROR: 0:86: 'triangles_adjacency' : cannot change previously set input primitive ERROR: 0:86: 'triangles_adjacency' : cannot change previously set input primitive
ERROR: 0:88: 'invocations' : not supported for this version or the enabled extensions ERROR: 0:88: 'invocations' : not supported for this version or the enabled extensions
ERROR: 0:88: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices
ERROR: 0:91: 'stream' : member cannot contradict block ERROR: 0:91: 'stream' : member cannot contradict block
ERROR: 28 compilation errors. No code generated. ERROR: 29 compilation errors. No code generated.
invocations = 4 invocations = 4
max_vertices = 127 max_vertices = 300
input primitive = lines_adjancency input primitive = lines_adjancency
output primitive = triangle_strip output primitive = triangle_strip
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
......
...@@ -76,6 +76,7 @@ deepD[1].d2.d1[2].b: offset -1, type 8b56, size 1, index -1 ...@@ -76,6 +76,7 @@ deepD[1].d2.d1[2].b: offset -1, type 8b56, size 1, index -1
deepD[1].d2.d1[3].va: offset -1, type 8b50, size 3, index -1 deepD[1].d2.d1[3].va: offset -1, type 8b50, size 3, index -1
deepD[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1 deepD[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1
deepD[1].v3: offset -1, type 8b54, size 1, index -1 deepD[1].v3: offset -1, type 8b54, size 1, index -1
arrBl[2].foo: offset 0, type 1406, size 1, index 7
anonMember1: offset 0, type 8b51, size 1, index 0 anonMember1: offset 0, type 8b51, size 1, index 0
uf1: offset -1, type 1406, size 1, index -1 uf1: offset -1, type 1406, size 1, index -1
uf2: offset -1, type 1406, size 1, index -1 uf2: offset -1, type 1406, size 1, index -1
...@@ -86,4 +87,8 @@ nameless: offset -1, type ffffffff, size 496, index -1 ...@@ -86,4 +87,8 @@ nameless: offset -1, type ffffffff, size 496, index -1
named: offset -1, type ffffffff, size 304, index -1 named: offset -1, type ffffffff, size 304, index -1
c_nameless: offset -1, type ffffffff, size 112, index -1 c_nameless: offset -1, type ffffffff, size 112, index -1
nested: offset -1, type ffffffff, size 28, index -1 nested: offset -1, type ffffffff, size 28, index -1
abl[0]: offset -1, type ffffffff, size 4, index -1
abl[1]: offset -1, type ffffffff, size 4, index -1
abl[2]: offset -1, type ffffffff, size 4, index -1
abl[3]: offset -1, type ffffffff, size 4, index -1
...@@ -119,6 +119,10 @@ void liveFunction1(uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray ...@@ -119,6 +119,10 @@ void liveFunction1(uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray
vec4 v = ablock.member3; vec4 v = ablock.member3;
} }
uniform abl {
float foo;
} arrBl[4];
void main() void main()
{ {
liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray); liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);
...@@ -156,4 +160,6 @@ void main() ...@@ -156,4 +160,6 @@ void main()
deep3 da[2] = deepD; deep3 da[2] = deepD;
} else } else
f = ufDead3; f = ufDead3;
f += arrBl[2].foo;
} }
...@@ -376,9 +376,19 @@ public: ...@@ -376,9 +376,19 @@ public:
const TString& blockName = anonymous ? base->getType().getTypeName() : base->getType().getTypeName(); const TString& blockName = anonymous ? base->getType().getTypeName() : base->getType().getTypeName();
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(blockName); TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(blockName);
if (it == reflection.nameToIndex.end()) { if (it == reflection.nameToIndex.end()) {
blockIndex = reflection.indexToUniformBlock.size(); if (base->getType().isArray()) {
reflection.nameToIndex[blockName] = blockIndex; assert(! anonymous);
reflection.indexToUniformBlock.push_back(TObjectReflection(blockName, offset, -1, getBlockSize(base->getType()), -1)); for (int e = 0; e < base->getType().getArraySize(); ++e) {
TString elementName = blockName + "[" + String(e) + "]";
blockIndex = reflection.indexToUniformBlock.size();
reflection.nameToIndex[elementName] = blockIndex;
reflection.indexToUniformBlock.push_back(TObjectReflection(elementName, offset, -1, getBlockSize(base->getType()), -1));
}
} else {
blockIndex = reflection.indexToUniformBlock.size();
reflection.nameToIndex[blockName] = blockIndex;
reflection.indexToUniformBlock.push_back(TObjectReflection(blockName, offset, -1, getBlockSize(base->getType()), -1));
}
} else } else
blockIndex = it->second; blockIndex = it->second;
offset = 0; offset = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment