diff --git a/Test/baseResults/150.geom.out b/Test/baseResults/150.geom.out index 1fb558940fb3383c0d784c3465988c817d9f77c9..f04a1f427a0c94237e14b3877277609391a78b7c 100644 --- a/Test/baseResults/150.geom.out +++ b/Test/baseResults/150.geom.out @@ -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: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: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices ERROR: 0:91: 'stream' : member cannot contradict block -ERROR: 28 compilation errors. No code generated. +ERROR: 29 compilation errors. No code generated. invocations = 4 -max_vertices = 127 +max_vertices = 300 input primitive = lines_adjancency output primitive = triangle_strip ERROR: node is still EOpNull! diff --git a/Test/baseResults/reflection.vert.out b/Test/baseResults/reflection.vert.out index bd96cd2fb410c86355381fe0f433234529e9b635..f1d0b54aa63ab6d53fb496f74ecbfbb1c00418f1 100644 --- a/Test/baseResults/reflection.vert.out +++ b/Test/baseResults/reflection.vert.out @@ -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].b: offset -1, type 8b56, 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 uf1: 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 named: offset -1, type ffffffff, size 304, index -1 c_nameless: offset -1, type ffffffff, size 112, 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 diff --git a/Test/reflection.vert b/Test/reflection.vert index 694ad13a767c55e946770ee018296cb800ec28ce..97eba57e9449a5b2ac85a4ae756a7032009ec4bc 100644 --- a/Test/reflection.vert +++ b/Test/reflection.vert @@ -119,6 +119,10 @@ void liveFunction1(uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray vec4 v = ablock.member3; } +uniform abl { + float foo; +} arrBl[4]; + void main() { liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray); @@ -156,4 +160,6 @@ void main() deep3 da[2] = deepD; } else f = ufDead3; + + f += arrBl[2].foo; } diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp index ad559e3a8b59597c0c23533f324221d3f776fa42..204e5d5c9bd40d1963962a4c0adb1cb2fcd49459 100644 --- a/glslang/MachineIndependent/reflection.cpp +++ b/glslang/MachineIndependent/reflection.cpp @@ -376,9 +376,19 @@ public: const TString& blockName = anonymous ? base->getType().getTypeName() : base->getType().getTypeName(); TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(blockName); if (it == reflection.nameToIndex.end()) { - blockIndex = reflection.indexToUniformBlock.size(); - reflection.nameToIndex[blockName] = blockIndex; - reflection.indexToUniformBlock.push_back(TObjectReflection(blockName, offset, -1, getBlockSize(base->getType()), -1)); + if (base->getType().isArray()) { + assert(! anonymous); + 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 blockIndex = it->second; offset = 0;