From ab41fe5df6dd7e357ec29009352d66ffa480d014 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Thu, 24 Oct 2013 01:25:40 +0000 Subject: [PATCH] Add redeclarations of built-in blocks. Note: lots of test results changed due to listing the members of a block when printing types. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23682 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- Test/330.frag | 13 +++- Test/410.geom | 26 +++++++ Test/430.vert | 9 +++ Test/baseResults/100.frag.out | 16 ++--- Test/baseResults/100scope.vert.out | 6 +- Test/baseResults/120.frag.out | 12 ++-- Test/baseResults/150.geom.out | 44 ++++++------ Test/baseResults/150.vert.out | 8 +-- Test/baseResults/300.frag.out | 10 +-- Test/baseResults/300.vert.out | 8 +-- Test/baseResults/300block.frag.out | 26 +++---- Test/baseResults/300layout.vert.out | 20 +++--- Test/baseResults/300operations.frag.out | 32 ++++----- Test/baseResults/300scope.vert.out | 6 +- Test/baseResults/330.frag.out | 12 +++- Test/baseResults/400.geom.out | 2 +- Test/baseResults/410.geom.out | 30 +++++++- Test/baseResults/420.tese.out | 26 +++---- Test/baseResults/420.vert.out | 8 +-- Test/baseResults/430.vert.out | 18 ++++- Test/baseResults/430scope.vert.out | 8 +-- Test/baseResults/aggOps.frag.out | 38 +++++----- Test/baseResults/constErrors.frag.out | 8 +-- Test/baseResults/constFold.frag.out | 2 +- Test/baseResults/deepRvalue.frag.out | 4 +- Test/baseResults/functionSemantics.frag.out | 6 +- Test/baseResults/link1.frag.out | 18 ++--- Test/baseResults/localAggregates.frag.out | 40 +++++------ Test/baseResults/prepost.frag.out | 14 ++-- Test/baseResults/specExamples.frag.out | 16 ++--- Test/baseResults/specExamples.vert.out | 26 +++---- Test/baseResults/structAssignment.frag.out | 28 ++++---- Test/baseResults/structDeref.frag.out | 96 ++++++++++++------------- Test/baseResults/structure.frag.out | 24 +++---- Test/baseResults/variableArrayIndex.frag.out | 38 +++++----- Test/baseResults/versionsClean.vert.out | 2 +- Test/baseResults/versionsErrors.vert.out | 2 +- Todo.txt | 4 +- glslang/Include/Types.h | 11 +++ glslang/MachineIndependent/Initialize.cpp | 2 +- glslang/MachineIndependent/ParseHelper.cpp | 101 ++++++++++++++++++++++++--- glslang/MachineIndependent/ParseHelper.h | 5 +- glslang/MachineIndependent/SymbolTable.h | 21 ++++-- glslang/MachineIndependent/glslang.y | 6 +- 44 files changed, 528 insertions(+), 324 deletions(-) diff --git a/Test/330.frag b/Test/330.frag index 4f73fc2..c96cf40 100644 --- a/Test/330.frag +++ b/Test/330.frag @@ -1,4 +1,4 @@ -#version 330 +#version 330 compatibility in vec4 inVar; out vec4 outVar; @@ -11,3 +11,14 @@ void main() gl_FragData[1] = inVar; int buffer = 4; } + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerFragment { + vec4 gl_Color; +}; + +void foo() +{ + vec4 c = gl_Color; +} diff --git a/Test/410.geom b/Test/410.geom index 2e5eeeb..af3dbac 100644 --- a/Test/410.geom +++ b/Test/410.geom @@ -4,3 +4,29 @@ void main() { gl_ViewportIndex = 7; } + +in gl_PerVertex { + float gl_PointSize; +} myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; // ERROR, can't do it again + +out gl_PerVertex { + float gl_PointSize; +}; + +void foo() +{ + float p = gl_in[1].gl_PointSize; // use of redeclared + gl_PointSize = p; // use of redeclared +} diff --git a/Test/430.vert b/Test/430.vert index 217eb23..54cf775 100644 --- a/Test/430.vert +++ b/Test/430.vert @@ -6,3 +6,12 @@ layout(location = 3) uniform vec4 uv4; layout(location = 2) in inb1 { vec4 v; } b1; // ERROR layout(location = 2) out outb1 { vec4 v; } b2; // ERROR + +out gl_PerVertex { + float gl_ClipDistance[]; +}; + +void foo() +{ + gl_ClipDistance[2] = 3.7; +} diff --git a/Test/baseResults/100.frag.out b/Test/baseResults/100.frag.out index ffa4adf..5c376eb 100644 --- a/Test/baseResults/100.frag.out +++ b/Test/baseResults/100.frag.out @@ -80,20 +80,20 @@ ERROR: node is still EOpNull! 0:29 'b' (mediump int) 0:29 Constant: 0:29 3 (const int) -0:36 move second child to first child (structure) -0:36 's1' (structure) -0:36 's2' (structure) +0:36 move second child to first child (structure{f,a}) +0:36 's1' (structure{f,a}) +0:36 's2' (structure{f,a}) 0:37 Test condition and select (void) 0:37 Condition 0:37 Compare Equal (bool) -0:37 's1' (structure) -0:37 's2' (structure) +0:37 's1' (structure{f,a}) +0:37 's2' (structure{f,a}) 0:37 true case is null 0:38 Test condition and select (void) 0:38 Condition 0:38 Compare Not Equal (bool) -0:38 's1' (structure) -0:38 's2' (structure) +0:38 's1' (structure{f,a}) +0:38 's2' (structure{f,a}) 0:38 true case is null 0:40 'b' (mediump int) 0:? Linker Objects @@ -101,6 +101,6 @@ ERROR: node is still EOpNull! 0:? 'uint' (mediump int) 0:? 'v' (smooth in 3-element array of mediump 4-component vector of float) 0:? 'f' (mediump float) -0:? '__anon__0' (layout(column_major shared ) uniform block) +0:? '__anon__0' (layout(column_major shared ) uniform block{x}) 0:? 'fa' (unsized array of mediump float) diff --git a/Test/baseResults/100scope.vert.out b/Test/baseResults/100scope.vert.out index 97ca557..7926670 100644 --- a/Test/baseResults/100scope.vert.out +++ b/Test/baseResults/100scope.vert.out @@ -91,12 +91,12 @@ ERROR: node is still EOpNull! 0:53 'x' (highp int) 0:61 Sequence 0:61 Sequence -0:61 move second child to first child (structure) -0:61 'S' (structure) +0:61 move second child to first child (structure{x}) +0:61 'S' (structure{x}) 0:61 Constant: 0:61 0 (const int) 0:62 x: direct index for structure (highp int) -0:62 'S' (structure) +0:62 'S' (structure{x}) 0:62 Constant: 0:62 0 (const int) 0:? Linker Objects diff --git a/Test/baseResults/120.frag.out b/Test/baseResults/120.frag.out index 0fdafa2..340639f 100644 --- a/Test/baseResults/120.frag.out +++ b/Test/baseResults/120.frag.out @@ -42,9 +42,9 @@ ERROR: node is still EOpNull! 0:23 Construct mat2x3 (2X3 matrix of float) 0:23 'm' (uniform 4X2 matrix of float) 0:27 Sequence -0:27 move second child to first child (structure) -0:27 'sv' (structure) -0:27 Construct structure (structure) +0:27 move second child to first child (structure{f}) +0:27 'sv' (structure{f}) +0:27 Construct structure (structure{f}) 0:27 Convert int to float (float) 0:27 'a' (int) 0:28 Sequence @@ -191,9 +191,9 @@ ERROR: node is still EOpNull! 0:51 false case 0:51 'a' (int) 0:52 Sequence -0:52 move second child to first child (structure) -0:52 'news' (structure) -0:52 'sv' (structure) +0:52 move second child to first child (structure{f}) +0:52 'news' (structure{f}) +0:52 'sv' (structure{f}) 0:54 vector swizzle (2-component vector of float) 0:54 'i' (smooth in 4-component vector of float) 0:54 Sequence diff --git a/Test/baseResults/150.geom.out b/Test/baseResults/150.geom.out index c17460f..2a22ff5 100644 --- a/Test/baseResults/150.geom.out +++ b/Test/baseResults/150.geom.out @@ -45,25 +45,25 @@ ERROR: node is still EOpNull! 0:30 0.000000 0:32 move second child to first child (3-component vector of float) 0:32 color: direct index for structure (layout(stream=0 ) 3-component vector of float) -0:32 '__anon__0' (layout(stream=0 ) out block) +0:32 '__anon__0' (layout(stream=0 ) out block{color}) 0:32 Constant: 0:32 0 (const uint) 0:32 color: direct index for structure (3-component vector of float) -0:32 'fromV' (in block) +0:32 'fromV' (in block{color}) 0:32 Constant: 0:32 0 (const int) 0:33 move second child to first child (float) 0:33 direct index (layout(stream=0 ) float) 0:33 gl_ClipDistance: direct index for structure (layout(stream=0 ) unsized array of float) -0:33 '__anon__1' (layout(stream=0 ) out block) +0:33 '__anon__1' (layout(stream=0 ) out block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:33 Constant: 0:33 2 (const uint) 0:33 Constant: 0:33 3 (const int) 0:33 direct index (float) 0:33 gl_ClipDistance: direct index for structure (unsized array of float) -0:33 direct index (in block) -0:33 'gl_in' (in unsized array of block) +0:33 direct index (in block{gl_Position,gl_PointSize,gl_ClipDistance}) +0:33 'gl_in' (in unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -72,24 +72,24 @@ ERROR: node is still EOpNull! 0:33 2 (const int) 0:34 move second child to first child (4-component vector of float) 0:34 gl_Position: direct index for structure (layout(stream=0 ) 4-component vector of float) -0:34 '__anon__1' (layout(stream=0 ) out block) +0:34 '__anon__1' (layout(stream=0 ) out block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:34 Constant: 0:34 0 (const uint) 0:34 gl_Position: direct index for structure (4-component vector of float) -0:34 direct index (in block) -0:34 'gl_in' (in unsized array of block) +0:34 direct index (in block{gl_Position,gl_PointSize,gl_ClipDistance}) +0:34 'gl_in' (in unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:34 Constant: 0:34 0 (const int) 0:34 Constant: 0:34 0 (const int) 0:35 move second child to first child (float) 0:35 gl_PointSize: direct index for structure (layout(stream=0 ) float) -0:35 '__anon__1' (layout(stream=0 ) out block) +0:35 '__anon__1' (layout(stream=0 ) out block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:35 Constant: 0:35 1 (const uint) 0:35 gl_PointSize: direct index for structure (float) -0:35 direct index (in block) -0:35 'gl_in' (in unsized array of block) +0:35 direct index (in block{gl_Position,gl_PointSize,gl_ClipDistance}) +0:35 'gl_in' (in unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:35 Constant: 0:35 3 (const int) 0:35 Constant: @@ -107,7 +107,7 @@ ERROR: node is still EOpNull! 0:67 Sequence 0:67 move second child to first child (4-component vector of float) 0:67 a: direct index for structure (layout(stream=6 ) 4-component vector of float) -0:67 'ouuaa6' (layout(stream=6 ) out block) +0:67 'ouuaa6' (layout(stream=6 ) out block{a}) 0:67 Constant: 0:67 0 (const int) 0:67 Constant: @@ -116,22 +116,22 @@ ERROR: node is still EOpNull! 0:67 1.000000 0:67 1.000000 0:? Linker Objects -0:? 'fromV' (in block) -0:? 'toF' (layout(stream=0 ) out block) -0:? '__anon__0' (layout(stream=0 ) out block) +0:? 'fromV' (in block{color}) +0:? 'toF' (layout(stream=0 ) out block{color}) +0:? '__anon__0' (layout(stream=0 ) out block{color}) 0:? 'ov0' (layout(stream=0 ) out 4-component vector of float) 0:? 'ov4' (layout(stream=4 ) out 4-component vector of float) 0:? 'o1v0' (layout(stream=0 ) out 4-component vector of float) 0:? 'ua' (layout(stream=3 ) uniform int) -0:? 'ibb' (layout(stream=3 column_major shared ) uniform block) +0:? 'ibb' (layout(stream=3 column_major shared ) uniform block{ua}) 0:? 'ov3' (layout(stream=3 ) out 4-component vector of float) -0:? 'ouuaa6' (layout(stream=6 ) out block) -0:? 'ouua6' (layout(stream=6 ) out block) -0:? 'ouua7' (layout(stream=7 ) out block) +0:? 'ouuaa6' (layout(stream=6 ) out block{a}) +0:? 'ouua6' (layout(stream=6 ) out block{a}) +0:? 'ouua7' (layout(stream=7 ) out block{a}) 0:? 'ov2s3' (layout(stream=3 ) out 4-component vector of float) 0:? 'badv4' (layout(stream=3 ) out 4-component vector of float) 0:? 'bad2v4' (in 4-component vector of float) -0:? '__anon__1' (layout(stream=3 ) out block) -0:? 'outbi' (layout(stream=3 ) out block) -0:? 'inbi' (in block) +0:? '__anon__1' (layout(stream=3 ) out block{a}) +0:? 'outbi' (layout(stream=3 ) out block{a,b,c}) +0:? 'inbi' (in block{a}) diff --git a/Test/baseResults/150.vert.out b/Test/baseResults/150.vert.out index 760e60e..b9d9699 100644 --- a/Test/baseResults/150.vert.out +++ b/Test/baseResults/150.vert.out @@ -8,20 +8,20 @@ ERROR: node is still EOpNull! 0:11 Sequence 0:11 move second child to first child (4-component vector of float) 0:11 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float) -0:11 '__anon__0' (out block) +0:11 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:11 Constant: 0:11 0 (const uint) 0:11 'iv4' (in 4-component vector of float) 0:12 move second child to first child (float) 0:12 gl_PointSize: direct index for structure (gl_PointSize float) -0:12 '__anon__0' (out block) +0:12 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:12 Constant: 0:12 1 (const uint) 0:12 'ps' (uniform float) 0:13 move second child to first child (float) 0:13 direct index (float) 0:13 gl_ClipDistance: direct index for structure (4-element array of float) -0:13 '__anon__0' (out block) +0:13 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:13 Constant: 0:13 2 (const uint) 0:13 Constant: @@ -33,7 +33,7 @@ ERROR: node is still EOpNull! 0:? Linker Objects 0:? 'iv4' (in 4-component vector of float) 0:? 'ps' (uniform float) -0:? '__anon__1' (layout(column_major shared ) uniform block) +0:? '__anon__1' (layout(column_major shared ) uniform block{a}) 0:? 'gl_VertexID' (gl_VertexId int) 0:? 'gl_InstanceID' (gl_InstanceId int) diff --git a/Test/baseResults/300.frag.out b/Test/baseResults/300.frag.out index 19960f5..6c08d74 100644 --- a/Test/baseResults/300.frag.out +++ b/Test/baseResults/300.frag.out @@ -184,13 +184,13 @@ ERROR: node is still EOpNull! 0:91 move second child to first child (lowp 3-component vector of float) 0:91 'sc' (out lowp 3-component vector of float) 0:91 c: direct index for structure (lowp 3-component vector of float) -0:91 's2' (smooth in structure) +0:91 's2' (smooth in structure{c,f}) 0:91 Constant: 0:91 0 (const int) 0:92 move second child to first child (lowp float) 0:92 'sf' (out lowp float) 0:92 f: direct index for structure (lowp float) -0:92 's2' (smooth in structure) +0:92 's2' (smooth in structure{c,f}) 0:92 Constant: 0:92 1 (const int) 0:94 add (lowp 2-component vector of float) @@ -234,10 +234,10 @@ ERROR: node is still EOpNull! 0:? 'ic4D' (flat in mediump 4-component vector of int) 0:? 'badv' (noperspective in lowp 4-component vector of float) 0:? 'bads' (smooth in lowp sampler2D) -0:? 'badout' (out structure) -0:? 's2' (smooth in structure) +0:? 'badout' (out structure{i,s}) +0:? 's2' (smooth in structure{c,f}) 0:? 'sc' (out lowp 3-component vector of float) 0:? 'sf' (out lowp float) 0:? 'arrayedSampler' (uniform 5-element array of lowp sampler2D) -0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of block) +0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of block{a,b,c}) diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out index eda5460..934b6cd 100644 --- a/Test/baseResults/300.vert.out +++ b/Test/baseResults/300.vert.out @@ -120,13 +120,13 @@ ERROR: node is still EOpNull! 0:50 1 (const int) 0:52 move second child to first child (highp 3-component vector of float) 0:52 c: direct index for structure (highp 3-component vector of float) -0:52 's' (smooth out structure) +0:52 's' (smooth out structure{c,f}) 0:52 Constant: 0:52 0 (const int) 0:52 'v3' (in highp 3-component vector of float) 0:53 move second child to first child (highp float) 0:53 f: direct index for structure (highp float) -0:53 's' (smooth out structure) +0:53 's' (smooth out structure{c,f}) 0:53 Constant: 0:53 1 (const int) 0:53 'dm' (highp float) @@ -150,10 +150,10 @@ ERROR: node is still EOpNull! 0:? 'rep' (smooth flat out highp 4-component vector of float) 0:? 'rep2' (centroid smooth sample out highp 4-component vector of float) 0:? 'rep3' (in highp 4-component vector of float) -0:? 's' (smooth out structure) +0:? 's' (smooth out structure{c,f}) 0:? 'badsize' (unsized array of highp float) 0:? 'badsize2' (unsized array of highp float) -0:? 'ubInst' (layout(column_major shared ) uniform unsized array of block) +0:? 'ubInst' (layout(column_major shared ) uniform unsized array of block{a}) 0:? 'okayA' (2-element array of highp float) 0:? 'gl_VertexID' (gl_VertexId highp int) 0:? 'gl_InstanceID' (gl_InstanceId highp int) diff --git a/Test/baseResults/300block.frag.out b/Test/baseResults/300block.frag.out index cefa5e4..a64693b 100644 --- a/Test/baseResults/300block.frag.out +++ b/Test/baseResults/300block.frag.out @@ -10,19 +10,19 @@ ERROR: node is still EOpNull! 0:44 Sequence 0:44 Function Call: texture(is31;vf3; (mediump 4-component vector of int) 0:44 sampler: direct index for structure (lowp isampler3D) -0:44 's' (uniform structure) +0:44 's' (uniform structure{u,v,sampler,w,t}) 0:44 Constant: 0:44 2 (const int) 0:44 Construct vec3 (3-component vector of float) 0:44 Convert int to float (float) 0:44 ni: direct index for structure (layout(column_major shared ) mediump int) -0:44 'inst' (layout(column_major shared ) uniform block) +0:44 'inst' (layout(column_major shared ) uniform block{nbv,ni}) 0:44 Constant: 0:44 1 (const int) 0:44 Convert uint to float (float) 0:44 direct index (mediump uint) 0:44 bv: direct index for structure (layout(column_major shared ) mediump 4-component vector of uint) -0:44 '__anon__0' (layout(column_major shared ) uniform block) +0:44 '__anon__0' (layout(column_major shared ) uniform block{bv,bm2,sampler,t,fbs}) 0:44 Constant: 0:44 0 (const uint) 0:44 Constant: @@ -30,27 +30,27 @@ ERROR: node is still EOpNull! 0:44 Convert uint to float (float) 0:44 direct index (mediump uint) 0:44 nbv: direct index for structure (layout(column_major shared ) mediump 4-component vector of uint) -0:44 direct index (layout(column_major shared ) uniform block) -0:44 'insts' (layout(column_major shared ) uniform 4-element array of block) +0:44 direct index (layout(column_major shared ) uniform block{nbv,ni}) +0:44 'insts' (layout(column_major shared ) uniform 4-element array of block{nbv,ni}) 0:44 Constant: 0:44 2 (const int) 0:44 Constant: 0:44 0 (const int) 0:44 Constant: 0:44 2 (const int) -0:45 indirect index (layout(column_major shared ) uniform block) -0:45 'insts' (layout(column_major shared ) uniform 4-element array of block) +0:45 indirect index (layout(column_major shared ) uniform block{nbv,ni}) +0:45 'insts' (layout(column_major shared ) uniform 4-element array of block{nbv,ni}) 0:45 direct index (mediump uint) 0:45 v: direct index for structure (mediump 4-component vector of uint) -0:45 's' (uniform structure) +0:45 's' (uniform structure{u,v,sampler,w,t}) 0:45 Constant: 0:45 1 (const int) 0:45 Constant: 0:45 0 (const int) 0:? Linker Objects -0:? 's' (uniform structure) -0:? '__anon__0' (layout(column_major shared ) uniform block) -0:? 'inst' (layout(column_major shared ) uniform block) -0:? 'insts' (layout(column_major shared ) uniform 4-element array of block) -0:? '__anon__1' (layout(column_major shared ) uniform block) +0:? 's' (uniform structure{u,v,sampler,w,t}) +0:? '__anon__0' (layout(column_major shared ) uniform block{bv,bm2,sampler,t,fbs}) +0:? 'inst' (layout(column_major shared ) uniform block{nbv,ni}) +0:? 'insts' (layout(column_major shared ) uniform 4-element array of block{nbv,ni}) +0:? '__anon__1' (layout(column_major shared ) uniform block{f,u}) diff --git a/Test/baseResults/300layout.vert.out b/Test/baseResults/300layout.vert.out index 631e69b..445e794 100644 --- a/Test/baseResults/300layout.vert.out +++ b/Test/baseResults/300layout.vert.out @@ -25,23 +25,23 @@ ERROR: node is still EOpNull! 0:43 add (highp 4X4 matrix of float) 0:43 add (highp 4X4 matrix of float) 0:43 M1: direct index for structure (layout(row_major std140 ) highp 4X4 matrix of float) -0:43 'tblock' (layout(row_major std140 ) uniform block) +0:43 'tblock' (layout(row_major std140 ) uniform block{M1,M2,N1,badf,badg}) 0:43 Constant: 0:43 0 (const int) 0:43 M2: direct index for structure (layout(column_major std140 ) highp 4X4 matrix of float) -0:43 'tblock' (layout(row_major std140 ) uniform block) +0:43 'tblock' (layout(row_major std140 ) uniform block{M1,M2,N1,badf,badg}) 0:43 Constant: 0:43 1 (const int) 0:43 M4: direct index for structure (layout(row_major shared ) highp 4X4 matrix of float) -0:43 '__anon__1' (layout(column_major shared ) uniform block) +0:43 '__anon__1' (layout(column_major shared ) uniform block{M3,M4,N2,b}) 0:43 Constant: 0:43 1 (const uint) 0:43 M3: direct index for structure (layout(column_major shared ) highp 4X4 matrix of float) -0:43 '__anon__1' (layout(column_major shared ) uniform block) +0:43 '__anon__1' (layout(column_major shared ) uniform block{M3,M4,N2,b}) 0:43 Constant: 0:43 0 (const uint) 0:43 t2m: direct index for structure (layout(row_major shared ) highp 4X4 matrix of float) -0:43 '__anon__0' (layout(row_major shared ) uniform block) +0:43 '__anon__0' (layout(row_major shared ) uniform block{b,t2m}) 0:43 Constant: 0:43 1 (const uint) 0:44 move second child to first child (highp 3-component vector of float) @@ -49,20 +49,20 @@ ERROR: node is still EOpNull! 0:44 vector-times-matrix (highp 3-component vector of float) 0:44 'c' (layout(location=7 ) in highp 3-component vector of float) 0:44 N1: direct index for structure (layout(row_major std140 ) highp 3X3 matrix of float) -0:44 'tblock' (layout(row_major std140 ) uniform block) +0:44 'tblock' (layout(row_major std140 ) uniform block{M1,M2,N1,badf,badg}) 0:44 Constant: 0:44 2 (const int) 0:? Linker Objects 0:? 'c' (layout(location=7 ) in highp 3-component vector of float) 0:? 'p' (layout(location=3 ) in highp 4-component vector of float) 0:? 'q' (layout(location=9 ) in 4-element array of highp 4-component vector of float) -0:? 'r' (layout(location=10 ) in 4-element array of structure) +0:? 'r' (layout(location=10 ) in 4-element array of structure{v}) 0:? 'pos' (smooth out highp 4-component vector of float) 0:? 'color' (smooth out highp 3-component vector of float) 0:? 'badm4' (layout(column_major shared ) uniform highp 4X4 matrix of float) -0:? 'tblock' (layout(row_major std140 ) uniform block) -0:? '__anon__0' (layout(row_major shared ) uniform block) -0:? '__anon__2' (out block) +0:? 'tblock' (layout(row_major std140 ) uniform block{M1,M2,N1,badf,badg}) +0:? '__anon__0' (layout(row_major shared ) uniform block{b,t2m}) +0:? '__anon__2' (out block{f}) 0:? 'badoutA' (layout(location=10 ) smooth out highp 4-component vector of float) 0:? 'compute_only' (shared highp 4-component vector of float) 0:? 'gl_VertexID' (gl_VertexId highp int) diff --git a/Test/baseResults/300operations.frag.out b/Test/baseResults/300operations.frag.out index b694cd9..9b986a1 100644 --- a/Test/baseResults/300operations.frag.out +++ b/Test/baseResults/300operations.frag.out @@ -1,6 +1,6 @@ ERROR: 0:11: 'float' : type requires declaration of default precision qualifier -ERROR: 0:30: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout(column_major shared ) uniform block' and a right operand of type 'layout(column_major shared ) uniform block' (or there is no acceptable conversion) -ERROR: 0:31: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'structure' and a right operand of type 'structure' (or there is no acceptable conversion) +ERROR: 0:30: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout(column_major shared ) uniform block{f}' and a right operand of type 'layout(column_major shared ) uniform block{f}' (or there is no acceptable conversion) +ERROR: 0:31: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'structure{i}' and a right operand of type 'structure{i}' (or there is no acceptable conversion) ERROR: 0:32: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'mediump int' and a right operand of type 'mediump float' (or there is no acceptable conversion) ERROR: 0:33: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'mediump uint' and a right operand of type 'mediump float' (or there is no acceptable conversion) ERROR: 0:34: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'mediump uint' and a right operand of type 'mediump int' (or there is no acceptable conversion) @@ -14,8 +14,8 @@ ERROR: 0:42: '%' : wrong operand types: no operation '%' exists that takes a le ERROR: 0:43: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type 'mediump int' and a right operand of type 'mediump float' (or there is no acceptable conversion) ERROR: 0:44: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type 'mediump float' and a right operand of type 'mediump uint' (or there is no acceptable conversion) ERROR: 0:45: '++' : l-value required "instanceName" (can't modify a uniform) -ERROR: 0:45: '++' : wrong operand type no operation '++' exists that takes an operand of type layout(column_major shared ) uniform block (or there is no acceptable conversion) -ERROR: 0:46: '++' : wrong operand type no operation '++' exists that takes an operand of type structure (or there is no acceptable conversion) +ERROR: 0:45: '++' : wrong operand type no operation '++' exists that takes an operand of type layout(column_major shared ) uniform block{f} (or there is no acceptable conversion) +ERROR: 0:46: '++' : wrong operand type no operation '++' exists that takes an operand of type structure{i} (or there is no acceptable conversion) ERROR: 0:47: '--' : wrong operand type no operation '--' exists that takes an operand of type 5-element array of mediump float (or there is no acceptable conversion) ERROR: 0:48: '++' : wrong operand type no operation '++' exists that takes an operand of type 3-component vector of bool (or there is no acceptable conversion) ERROR: 0:50: '<' : wrong operand types: no operation '<' exists that takes a left-hand operand of type 'mediump 3-component vector of int' and a right operand of type 'mediump 3-component vector of uint' (or there is no acceptable conversion) @@ -39,7 +39,7 @@ ERROR: 0:70: '~' : wrong operand type no operation '~' exists that takes an ope ERROR: 0:71: '~' : wrong operand type no operation '~' exists that takes an operand of type mediump 4X4 matrix of float (or there is no acceptable conversion) ERROR: 0:72: '~' : wrong operand type no operation '~' exists that takes an operand of type mediump 3-component vector of float (or there is no acceptable conversion) ERROR: 0:73: '~' : wrong operand type no operation '~' exists that takes an operand of type 5-element array of mediump float (or there is no acceptable conversion) -ERROR: 0:74: '~' : wrong operand type no operation '~' exists that takes an operand of type layout(column_major shared ) uniform block (or there is no acceptable conversion) +ERROR: 0:74: '~' : wrong operand type no operation '~' exists that takes an operand of type layout(column_major shared ) uniform block{f} (or there is no acceptable conversion) ERROR: 0:76: '<<' : wrong operand types: no operation '<<' exists that takes a left-hand operand of type 'mediump int' and a right operand of type 'mediump 3-component vector of int' (or there is no acceptable conversion) ERROR: 0:77: '<<' : wrong operand types: no operation '<<' exists that takes a left-hand operand of type 'mediump uint' and a right operand of type 'mediump 3-component vector of uint' (or there is no acceptable conversion) ERROR: 0:78: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type 'mediump int' and a right operand of type 'mediump float' (or there is no acceptable conversion) @@ -52,7 +52,7 @@ ERROR: 0:85: '^' : wrong operand types: no operation '^' exists that takes a le ERROR: 0:86: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type 'mediump int' and a right operand of type 'mediump 3-component vector of uint' (or there is no acceptable conversion) ERROR: 0:87: '&' : wrong operand types: no operation '&' exists that takes a left-hand operand of type 'mediump uint' and a right operand of type 'mediump float' (or there is no acceptable conversion) ERROR: 0:88: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type 'mediump 2X2 matrix of float' and a right operand of type 'mediump 2X2 matrix of float' (or there is no acceptable conversion) -ERROR: 0:89: '^' : wrong operand types: no operation '^' exists that takes a left-hand operand of type 'structure' and a right operand of type 'structure' (or there is no acceptable conversion) +ERROR: 0:89: '^' : wrong operand types: no operation '^' exists that takes a left-hand operand of type 'structure{i}' and a right operand of type 'structure{i}' (or there is no acceptable conversion) ERROR: 0:90: 'assign' : l-value required ERROR: 56 compilation errors. No code generated. @@ -60,8 +60,8 @@ ERROR: node is still EOpNull! 0:13 Function Definition: main( (void) 0:13 Function Parameters: 0:? Sequence -0:30 'instanceName' (layout(column_major shared ) uniform block) -0:31 's' (structure) +0:30 'instanceName' (layout(column_major shared ) uniform block{f}) +0:31 's' (structure{i}) 0:32 'i' (mediump int) 0:33 'u' (mediump uint) 0:34 'u' (mediump uint) @@ -74,8 +74,8 @@ ERROR: node is still EOpNull! 0:42 'f' (mediump float) 0:43 'i' (mediump int) 0:44 'f' (mediump float) -0:45 'instanceName' (layout(column_major shared ) uniform block) -0:46 's' (structure) +0:45 'instanceName' (layout(column_major shared ) uniform block{f}) +0:46 's' (structure{i}) 0:47 'a' (5-element array of mediump float) 0:48 'b3' (3-component vector of bool) 0:50 Constant: @@ -111,7 +111,7 @@ ERROR: node is still EOpNull! 0:71 'm4' (mediump 4X4 matrix of float) 0:72 'v3' (mediump 3-component vector of float) 0:73 'a' (5-element array of mediump float) -0:74 'instanceName' (layout(column_major shared ) uniform block) +0:74 'instanceName' (layout(column_major shared ) uniform block{f}) 0:76 'i' (mediump int) 0:77 'u' (mediump uint) 0:78 'i' (mediump int) @@ -124,7 +124,7 @@ ERROR: node is still EOpNull! 0:86 'i' (mediump int) 0:87 'u' (mediump uint) 0:88 'm2' (mediump 2X2 matrix of float) -0:89 's' (structure) +0:89 's' (structure{i}) 0:90 move second child to first child (mediump float) 0:90 move second child to first child (mediump float) 0:90 'f' (mediump float) @@ -167,8 +167,8 @@ ERROR: node is still EOpNull! 0:106 'a' (5-element array of mediump float) 0:106 'a' (5-element array of mediump float) 0:107 Compare Not Equal (bool) -0:107 's' (structure) -0:107 's' (structure) +0:107 's' (structure{i}) +0:107 's' (structure{i}) 0:109 logical-and (bool) 0:109 'b' (bool) 0:109 'b' (bool) @@ -212,7 +212,7 @@ ERROR: node is still EOpNull! 0:127 'iv3' (mediump 3-component vector of int) 0:127 'iv3' (mediump 3-component vector of int) 0:? Linker Objects -0:? 'instanceName' (layout(column_major shared ) uniform block) -0:? 's' (structure) +0:? 'instanceName' (layout(column_major shared ) uniform block{f}) +0:? 's' (structure{i}) 0:? 'a' (5-element array of mediump float) diff --git a/Test/baseResults/300scope.vert.out b/Test/baseResults/300scope.vert.out index fc5bf6c..27b43d0 100644 --- a/Test/baseResults/300scope.vert.out +++ b/Test/baseResults/300scope.vert.out @@ -93,12 +93,12 @@ ERROR: node is still EOpNull! 0:53 'x' (highp int) 0:61 Sequence 0:61 Sequence -0:61 move second child to first child (structure) -0:61 'S' (structure) +0:61 move second child to first child (structure{x}) +0:61 'S' (structure{x}) 0:61 Constant: 0:61 0 (const int) 0:62 x: direct index for structure (highp int) -0:62 'S' (structure) +0:62 'S' (structure{x}) 0:62 Constant: 0:62 0 (const int) 0:? Linker Objects diff --git a/Test/baseResults/330.frag.out b/Test/baseResults/330.frag.out index dc93262..435cc08 100644 --- a/Test/baseResults/330.frag.out +++ b/Test/baseResults/330.frag.out @@ -1,5 +1,4 @@ Warning, version 330 is not yet complete; some version-specific features are present, but many are missing. -WARNING: 0:6: varying deprecated in version 130; may be removed in future release 0:? Sequence 0:8 Function Definition: main( (void) 0:8 Function Parameters: @@ -18,8 +17,19 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:12 'buffer' (int) 0:12 Constant: 0:12 4 (const int) +0:21 Function Definition: foo( (void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child (4-component vector of float) +0:23 'c' (4-component vector of float) +0:23 gl_Color: direct index for structure (in 4-component vector of float) +0:23 '__anon__0' (in block{gl_Color}) +0:23 Constant: +0:23 0 (const uint) 0:? Linker Objects 0:? 'inVar' (smooth in 4-component vector of float) 0:? 'outVar' (out 4-component vector of float) 0:? 'varyingVar' (smooth in 4-component vector of float) +0:? '__anon__0' (in block{gl_Color}) diff --git a/Test/baseResults/400.geom.out b/Test/baseResults/400.geom.out index 5c41c3e..93d603d 100644 --- a/Test/baseResults/400.geom.out +++ b/Test/baseResults/400.geom.out @@ -23,5 +23,5 @@ ERROR: node is still EOpNull! 0:10 'id' (int) 0:10 'gl_InvocationID' (in int) 0:? Linker Objects -0:? '__anon__0' (layout(stream=0 ) out block) +0:? '__anon__0' (layout(stream=0 ) out block{a}) diff --git a/Test/baseResults/410.geom.out b/Test/baseResults/410.geom.out index c8c6cb8..f922453 100644 --- a/Test/baseResults/410.geom.out +++ b/Test/baseResults/410.geom.out @@ -1,9 +1,16 @@ Warning, version 410 is not yet complete; some version-specific features are present, but many are missing. +ERROR: 0:8: 'myIn' : cannot redeclare a built-in block with a user name +ERROR: 0:8: 'gl_' : reserved built-in name +ERROR: 0:12: 'gl_' : reserved built-in name +ERROR: 0:20: 'gl_PerVertex' : can only redeclare a built-in block once +ERROR: 0:20: 'gl_' : reserved built-in name +ERROR: 5 compilation errors. No code generated. + invocations = 0 max_vertices = 0 input primitive = none output primitive = none -0:? Sequence +ERROR: node is still EOpNull! 0:3 Function Definition: main( (void) 0:3 Function Parameters: 0:5 Sequence @@ -11,5 +18,26 @@ output primitive = none 0:5 'gl_ViewportIndex' (layout(stream=0 ) out int) 0:5 Constant: 0:5 7 (const int) +0:28 Function Definition: foo( (void) +0:28 Function Parameters: +0:30 Sequence +0:30 Sequence +0:30 move second child to first child (float) +0:30 'p' (float) +0:30 gl_PointSize: direct index for structure (float) +0:30 direct index (in block{gl_PointSize}) +0:30 'gl_in' (in unsized array of block{gl_PointSize}) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child (float) +0:31 gl_PointSize: direct index for structure (layout(stream=0 ) float) +0:31 '__anon__0' (layout(stream=0 ) out block{gl_PointSize}) +0:31 Constant: +0:31 0 (const uint) +0:31 'p' (float) 0:? Linker Objects +0:? 'gl_in' (in unsized array of block{gl_PointSize}) +0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize}) diff --git a/Test/baseResults/420.tese.out b/Test/baseResults/420.tese.out index 2b5af43..fe778bc 100644 --- a/Test/baseResults/420.tese.out +++ b/Test/baseResults/420.tese.out @@ -10,7 +10,7 @@ ERROR: 0:29: 'constructor' : cannot convert parameter 2 from 'const 2X2 matrix ERROR: 0:29: 'const 2-element array of 4-component vector of float' : cannot construct with these arguments ERROR: 0:29: '=' : cannot convert from 'const float' to '2-element array of 4-component vector of float' ERROR: 0:30: 'initializer list' : wrong number of matrix columns: 4X2 matrix of float -ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'float' to 'structure' +ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'float' to 'structure{s,t}' ERROR: 0:58: 'initializer list' : wrong number of structure members ERROR: 13 compilation errors. No code generated. @@ -24,14 +24,14 @@ ERROR: node is still EOpNull! 0:4 0.000000 0:4 1.000000 0:15 Sequence -0:15 move second child to first child (structure) -0:15 'e' (structure) +0:15 move second child to first child (structure{a,b}) +0:15 'e' (structure{a,b}) 0:15 Constant: 0:15 1.200000 0:15 2 (const int) 0:20 Sequence -0:20 move second child to first child (structure) -0:20 'e2' (structure) +0:20 move second child to first child (structure{a,b}) +0:20 'e2' (structure{a,b}) 0:20 Constant: 0:20 1.000000 0:20 3 (const int) @@ -82,7 +82,7 @@ ERROR: node is still EOpNull! 0:74 0.000000 0:74 6.000000 0:74 0.000000 -0:74 'curlybad1' (structure) +0:74 'curlybad1' (structure{uv2,s}) 0:74 true case is null 0:76 Test condition and select (void) 0:76 Condition @@ -105,16 +105,16 @@ ERROR: node is still EOpNull! 0:? 'b2' (2-component vector of float) 0:? 'c2' (3X3 matrix of float) 0:? 'd' (2X2 matrix of float) -0:? 'e' (structure) -0:? 'e2' (structure) -0:? 'e3' (structure) +0:? 'e' (structure{a,b}) +0:? 'e2' (structure{a,b}) +0:? 'e3' (structure{a,b}) 0:? 'a3' (int) 0:? 'b3' (2-element array of 4-component vector of float) 0:? 'b4' (2-element array of 4-component vector of float) 0:? 'c3' (4X2 matrix of float) -0:? 'd2' (unsized array of structure) +0:? 'd2' (unsized array of structure{s,t}) 0:? 'b5' (5-element array of float) -0:? 'constructed' (const structure) +0:? 'constructed' (const structure{uv2,s}) 0:? 1 (const uint) 0:? 2 (const uint) 0:? 3.000000 @@ -131,8 +131,8 @@ ERROR: node is still EOpNull! 0:? 0.000000 0:? 6.000000 0:? 0.000000 -0:? 'curlybad1' (structure) -0:? 'curlyInit' (const structure) +0:? 'curlybad1' (structure{uv2,s}) +0:? 'curlyInit' (const structure{uv2,s}) 0:? 1 (const uint) 0:? 2 (const uint) 0:? 3.000000 diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index d5eeb52..e76430e 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -116,10 +116,10 @@ ERROR: node is still EOpNull! 0:? 4.200000 0:? 'dx' (const float) 0:? 4.200000 -0:? 'boundInst' (layout(binding=3 column_major shared ) uniform block) -0:? '__anon__0' (layout(binding=7 column_major shared ) uniform block) -0:? '__anon__1' (layout(binding=1 ) in block) -0:? '__anon__2' (layout(column_major shared ) uniform block) +0:? 'boundInst' (layout(binding=3 column_major shared ) uniform block{aoeu}) +0:? '__anon__0' (layout(binding=7 column_major shared ) uniform block{aoeu}) +0:? '__anon__1' (layout(binding=1 ) in block{aoeua}) +0:? '__anon__2' (layout(column_major shared ) uniform block{aooeu}) 0:? 'sampb1' (layout(binding=4 ) uniform sampler2D) 0:? 'sampb2' (layout(binding=5 ) uniform 10-element array of sampler2D) 0:? 'gl_VertexID' (gl_VertexId int) diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index 26ca75e..166d047 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -5,11 +5,25 @@ ERROR: 0:8: 'location qualifier on output block' : not supported for this versio ERROR: 3 compilation errors. No code generated. ERROR: node is still EOpNull! +0:14 Function Definition: foo( (void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child (float) +0:16 direct index (float) +0:16 gl_ClipDistance: direct index for structure (unsized array of float) +0:16 '__anon__0' (out block{gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 3.700000 0:? Linker Objects 0:? 'v4' (layout(location=3 ) 4-component vector of float) 0:? 'uv4' (layout(location=3 ) uniform 4-component vector of float) -0:? 'b1' (layout(location=2 ) in block) -0:? 'b2' (layout(location=2 ) out block) +0:? 'b1' (layout(location=2 ) in block{v}) +0:? 'b2' (layout(location=2 ) out block{v}) +0:? '__anon__0' (out block{gl_ClipDistance}) 0:? 'gl_VertexID' (gl_VertexId int) 0:? 'gl_InstanceID' (gl_InstanceId int) diff --git a/Test/baseResults/430scope.vert.out b/Test/baseResults/430scope.vert.out index 9a0427a..62dd94a 100644 --- a/Test/baseResults/430scope.vert.out +++ b/Test/baseResults/430scope.vert.out @@ -49,7 +49,7 @@ ERROR: node is still EOpNull! 0:40 3.000000 0:42 move second child to first child (4-component vector of float) 0:42 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float) -0:42 '__anon__0' (out block) +0:42 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:42 Constant: 0:42 0 (const uint) 0:42 Construct vec4 (4-component vector of float) @@ -93,12 +93,12 @@ ERROR: node is still EOpNull! 0:53 'x' (int) 0:61 Sequence 0:61 Sequence -0:61 move second child to first child (structure) -0:61 'S' (structure) +0:61 move second child to first child (structure{x}) +0:61 'S' (structure{x}) 0:61 Constant: 0:61 0 (const int) 0:62 x: direct index for structure (int) -0:62 'S' (structure) +0:62 'S' (structure{x}) 0:62 Constant: 0:62 0 (const int) 0:? Linker Objects diff --git a/Test/baseResults/aggOps.frag.out b/Test/baseResults/aggOps.frag.out index c2f1a63..382d30d 100644 --- a/Test/baseResults/aggOps.frag.out +++ b/Test/baseResults/aggOps.frag.out @@ -5,10 +5,10 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:23 Function Definition: main( (void) 0:23 Function Parameters: 0:? Sequence -0:27 move second child to first child (3-element array of structure) -0:27 'a' (3-element array of structure) -0:27 Construct structure (3-element array of structure) -0:27 Construct structure (structure) +0:27 move second child to first child (3-element array of structure{i,f}) +0:27 'a' (3-element array of structure{i,f}) +0:27 Construct structure (3-element array of structure{i,f}) +0:27 Construct structure (structure{i,f}) 0:27 Convert float to int (int) 0:27 direct index (float) 0:27 'u' (smooth in 4-component vector of float) @@ -18,7 +18,7 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:27 'u' (smooth in 4-component vector of float) 0:27 Constant: 0:27 1 (const int) -0:27 Construct structure (structure) +0:27 Construct structure (structure{i,f}) 0:27 Convert float to int (int) 0:27 direct index (float) 0:27 'u' (smooth in 4-component vector of float) @@ -31,13 +31,13 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:27 Constant: 0:27 14 (const int) 0:27 14.000000 -0:28 move second child to first child (3-element array of structure) -0:28 'b' (3-element array of structure) -0:28 Construct structure (3-element array of structure) +0:28 move second child to first child (3-element array of structure{i,f}) +0:28 'b' (3-element array of structure{i,f}) +0:28 Construct structure (3-element array of structure{i,f}) 0:28 Constant: 0:28 17 (const int) 0:28 17.000000 -0:28 Construct structure (structure) +0:28 Construct structure (structure{i,f}) 0:28 Convert float to int (int) 0:28 direct index (float) 0:28 'w' (smooth in 4-component vector of float) @@ -47,7 +47,7 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:28 'w' (smooth in 4-component vector of float) 0:28 Constant: 0:28 1 (const int) -0:28 Construct structure (structure) +0:28 Construct structure (structure{i,f}) 0:28 Convert float to int (int) 0:28 direct index (float) 0:28 'w' (smooth in 4-component vector of float) @@ -60,8 +60,8 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:30 Test condition and select (void) 0:30 Condition 0:30 Compare Equal (bool) -0:30 'foo2a' (uniform structure) -0:30 'foo2b' (uniform structure) +0:30 'foo2a' (uniform structure{i,f,s1_1}) +0:30 'foo2b' (uniform structure{i,f,s1_1}) 0:30 true case 0:31 move second child to first child (4-component vector of float) 0:31 'v' (4-component vector of float) @@ -116,8 +116,8 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:44 Test condition and select (void) 0:44 Condition 0:44 Compare Equal (bool) -0:44 'a' (3-element array of structure) -0:44 'b' (3-element array of structure) +0:44 'a' (3-element array of structure{i,f}) +0:44 'b' (3-element array of structure{i,f}) 0:44 true case 0:45 vector scale second child into first child (4-component vector of float) 0:45 'v' (4-component vector of float) @@ -126,8 +126,8 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:47 Test condition and select (void) 0:47 Condition 0:47 Compare Not Equal (bool) -0:47 'a' (3-element array of structure) -0:47 'b' (3-element array of structure) +0:47 'a' (3-element array of structure{i,f}) +0:47 'b' (3-element array of structure{i,f}) 0:47 true case 0:48 vector scale second child into first child (4-component vector of float) 0:48 'v' (4-component vector of float) @@ -141,7 +141,7 @@ WARNING: 0:6: varying deprecated in version 130; may be removed in future releas 0:? 'coord' (smooth in 2-component vector of float) 0:? 'u' (smooth in 4-component vector of float) 0:? 'w' (smooth in 4-component vector of float) -0:? 'foo1' (uniform structure) -0:? 'foo2a' (uniform structure) -0:? 'foo2b' (uniform structure) +0:? 'foo1' (uniform structure{i,f}) +0:? 'foo2a' (uniform structure{i,f,s1_1}) +0:? 'foo2b' (uniform structure{i,f,s1_1}) diff --git a/Test/baseResults/constErrors.frag.out b/Test/baseResults/constErrors.frag.out index 48ec249..c099f84 100644 --- a/Test/baseResults/constErrors.frag.out +++ b/Test/baseResults/constErrors.frag.out @@ -6,8 +6,8 @@ ERROR: 0:18: '' : constant expression required ERROR: 0:18: '' : array size must be a constant integer expression ERROR: 0:19: '' : constant expression required ERROR: 0:19: '' : array size must be a constant integer expression -ERROR: 0:27: '=' : global const initializers must be constant 'const structure' -ERROR: 0:33: '=' : global const initializers must be constant 'const structure' +ERROR: 0:27: '=' : global const initializers must be constant 'const structure{v3,iv2}' +ERROR: 0:33: '=' : global const initializers must be constant 'const structure{v3,iv2,m}' ERROR: 9 compilation errors. No code generated. ERROR: node is still EOpNull! @@ -24,8 +24,8 @@ ERROR: node is still EOpNull! 0:? 'constInt' (const int) 0:? 3 (const int) 0:? 'uniformInt' (uniform int) -0:? 's' (structure) -0:? 's2' (structure) +0:? 's' (structure{v3,iv2}) +0:? 's2' (structure{v3,iv2,m}) 0:? 'f' (const float) 0:? 3.000000 diff --git a/Test/baseResults/constFold.frag.out b/Test/baseResults/constFold.frag.out index 8b227c0..e70ee55 100644 --- a/Test/baseResults/constFold.frag.out +++ b/Test/baseResults/constFold.frag.out @@ -195,7 +195,7 @@ Warning, version 430 is not yet complete; some version-specific features are pre 0:? 'out11' (out 4-component vector of float) 0:? 'out12' (out 2-component vector of int) 0:? 'out13' (out 3-component vector of uint) -0:? 's' (const structure) +0:? 's' (const structure{v3,iv2,m}) 0:? 3.000000 0:? 3.000000 0:? 3.000000 diff --git a/Test/baseResults/deepRvalue.frag.out b/Test/baseResults/deepRvalue.frag.out index e1e5975..97a20f8 100644 --- a/Test/baseResults/deepRvalue.frag.out +++ b/Test/baseResults/deepRvalue.frag.out @@ -107,8 +107,8 @@ Warning, version 120 is not yet complete; most features are present, but a few a 0:33 direct index (float) 0:33 direct index (2-component vector of float) 0:33 b: direct index for structure (3-element array of 2-component vector of float) -0:33 move second child to first child (structure) -0:33 't' (structure) +0:33 move second child to first child (structure{a,b,c}) +0:33 't' (structure{a,b,c}) 0:33 Constant: 0:33 1 (const int) 0:33 2.000000 diff --git a/Test/baseResults/functionSemantics.frag.out b/Test/baseResults/functionSemantics.frag.out index dd431a6..2208bc1 100644 --- a/Test/baseResults/functionSemantics.frag.out +++ b/Test/baseResults/functionSemantics.frag.out @@ -68,7 +68,7 @@ 0:28 move second child to first child (mediump int) 0:28 direct index (mediump int) 0:28 t: direct index for structure (mediump 4-component vector of int) -0:28 'f' (structure) +0:28 'f' (structure{t}) 0:28 Constant: 0:28 0 (const int) 0:28 Constant: @@ -91,7 +91,7 @@ 0:30 'e' (mediump int) 0:30 direct index (mediump int) 0:30 t: direct index for structure (mediump 4-component vector of int) -0:30 'f' (structure) +0:30 'f' (structure{t}) 0:30 Constant: 0:30 0 (const int) 0:30 Constant: @@ -105,7 +105,7 @@ 0:32 'e' (mediump int) 0:32 direct index (mediump int) 0:32 t: direct index for structure (mediump 4-component vector of int) -0:32 'f' (structure) +0:32 'f' (structure{t}) 0:32 Constant: 0:32 0 (const int) 0:32 Constant: diff --git a/Test/baseResults/link1.frag.out b/Test/baseResults/link1.frag.out index d6e8d8d..6827be3 100644 --- a/Test/baseResults/link1.frag.out +++ b/Test/baseResults/link1.frag.out @@ -71,11 +71,11 @@ Warning, version 130 is not yet complete; most features are present, but a few a 0:? 0.000000 0:? 0.000000 0:? 4.000000 -0:? 's' (uniform structure) +0:? 's' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 -0:? 'sn' (uniform structure) -0:? 'se' (uniform structure) +0:? 'sn' (uniform structure{a,b}) +0:? 'se' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 @@ -139,13 +139,13 @@ Warning, version 130 is not yet complete; most features are present, but a few a 0:? 0.000000 0:? 0.000000 0:? 3.000000 -0:? 's' (uniform structure) +0:? 's' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 -0:? 'sn' (uniform structure) +0:? 'sn' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 -0:? 'se' (uniform structure) +0:? 'se' (uniform structure{a,b}) 0:? 81 (const int) 0:? 3.900000 @@ -271,13 +271,13 @@ ERROR: Linking fragment stage: Precision qualifiers must match: 0:? 0.000000 0:? 0.000000 0:? 4.000000 -0:? 's' (uniform structure) +0:? 's' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 -0:? 'sn' (uniform structure) +0:? 'sn' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 -0:? 'se' (uniform structure) +0:? 'se' (uniform structure{a,b}) 0:? 82 (const int) 0:? 3.900000 0:? 'd' (4-component vector of float) diff --git a/Test/baseResults/localAggregates.frag.out b/Test/baseResults/localAggregates.frag.out index bf638b3..5dd201b 100644 --- a/Test/baseResults/localAggregates.frag.out +++ b/Test/baseResults/localAggregates.frag.out @@ -5,18 +5,18 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:34 Function Definition: main( (void) 0:34 Function Parameters: 0:? Sequence -0:41 move second child to first child (structure) -0:41 'locals2' (structure) -0:41 s2_1: direct index for structure (structure) -0:41 'foo3' (uniform structure) +0:41 move second child to first child (structure{i,f,s1_1,bleh}) +0:41 'locals2' (structure{i,f,s1_1,bleh}) +0:41 s2_1: direct index for structure (structure{i,f,s1_1,bleh}) +0:41 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:41 Constant: 0:41 0 (const int) 0:43 Test condition and select (void) 0:43 Condition 0:43 Compare Greater Than (bool) 0:43 i: direct index for structure (int) -0:43 s2_1: direct index for structure (structure) -0:43 'foo3' (uniform structure) +0:43 s2_1: direct index for structure (structure{i,f,s1_1,bleh}) +0:43 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:43 Constant: 0:43 0 (const int) 0:43 Constant: @@ -27,8 +27,8 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:44 Sequence 0:44 move second child to first child (float) 0:44 f: direct index for structure (float) -0:44 s1_1: direct index for structure (structure) -0:44 'locals2' (structure) +0:44 s1_1: direct index for structure (structure{i,f}) +0:44 'locals2' (structure{i,f,s1_1,bleh}) 0:44 Constant: 0:44 2 (const int) 0:44 Constant: @@ -50,8 +50,8 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:46 Constant: 0:46 2 (const int) 0:46 i: direct index for structure (int) -0:46 s2_1: direct index for structure (structure) -0:46 'foo3' (uniform structure) +0:46 s2_1: direct index for structure (structure{i,f,s1_1,bleh}) +0:46 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:46 Constant: 0:46 0 (const int) 0:46 Constant: @@ -60,8 +60,8 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:48 Sequence 0:48 move second child to first child (float) 0:48 f: direct index for structure (float) -0:48 s1_1: direct index for structure (structure) -0:48 'locals2' (structure) +0:48 s1_1: direct index for structure (structure{i,f}) +0:48 'locals2' (structure{i,f,s1_1,bleh}) 0:48 Constant: 0:48 2 (const int) 0:48 Constant: @@ -146,14 +146,14 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:66 'localArray' (16-element array of float) 0:68 move second child to first child (4-component vector of float) 0:68 bleh: direct index for structure (4-component vector of float) -0:68 'locals2' (structure) +0:68 'locals2' (structure{i,f,s1_1,bleh}) 0:68 Constant: 0:68 3 (const int) 0:68 'color' (smooth in 4-component vector of float) 0:69 move second child to first child (float) 0:69 direct index (float) 0:69 bleh: direct index for structure (4-component vector of float) -0:69 'locals2' (structure) +0:69 'locals2' (structure{i,f,s1_1,bleh}) 0:69 Constant: 0:69 3 (const int) 0:69 Constant: @@ -167,7 +167,7 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:71 component-wise multiply (4-component vector of float) 0:71 vector-scale (4-component vector of float) 0:71 bleh: direct index for structure (4-component vector of float) -0:71 'locals2' (structure) +0:71 'locals2' (structure{i,f,s1_1,bleh}) 0:71 Constant: 0:71 3 (const int) 0:71 add (float) @@ -178,8 +178,8 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:71 Constant: 0:71 4 (const int) 0:71 f: direct index for structure (float) -0:71 s1_1: direct index for structure (structure) -0:71 'locals2' (structure) +0:71 s1_1: direct index for structure (structure{i,f}) +0:71 'locals2' (structure{i,f,s1_1,bleh}) 0:71 Constant: 0:71 2 (const int) 0:71 Constant: @@ -197,9 +197,9 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas 0:? 'sampler' (uniform sampler2D) 0:? 'coord' (smooth in 2-component vector of float) 0:? 'color' (smooth in 4-component vector of float) -0:? 'foo' (uniform structure) -0:? 'foo2' (uniform structure) -0:? 'foo3' (uniform structure) +0:? 'foo' (uniform structure{i,f}) +0:? 'foo2' (uniform structure{i,f,s1_1,bleh}) +0:? 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:? 'uFloatArray' (uniform 16-element array of float) 0:? 'condition' (uniform int) diff --git a/Test/baseResults/prepost.frag.out b/Test/baseResults/prepost.frag.out index 71c41d3..a6b0fae 100644 --- a/Test/baseResults/prepost.frag.out +++ b/Test/baseResults/prepost.frag.out @@ -11,7 +11,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:12 move second child to first child (float) 0:12 direct index (float) 0:12 y: direct index for structure (5-element array of float) -0:12 'str' (structure) +0:12 'str' (structure{y}) 0:12 Constant: 0:12 0 (const int) 0:12 Constant: @@ -23,7 +23,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:13 Pre-Increment (float) 0:13 indirect index (float) 0:13 y: direct index for structure (5-element array of float) -0:13 'str' (structure) +0:13 'str' (structure{y}) 0:13 Constant: 0:13 0 (const int) 0:13 Pre-Decrement (int) @@ -31,7 +31,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:14 add second child into first child (float) 0:14 direct index (float) 0:14 y: direct index for structure (5-element array of float) -0:14 'str' (structure) +0:14 'str' (structure{y}) 0:14 Constant: 0:14 0 (const int) 0:14 Constant: @@ -42,7 +42,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:15 Post-Decrement (float) 0:15 direct index (float) 0:15 y: direct index for structure (5-element array of float) -0:15 'str' (structure) +0:15 'str' (structure{y}) 0:15 Constant: 0:15 0 (const int) 0:15 Constant: @@ -50,7 +50,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:16 add second child into first child (float) 0:16 indirect index (float) 0:16 y: direct index for structure (5-element array of float) -0:16 'str' (structure) +0:16 'str' (structure{y}) 0:16 Constant: 0:16 0 (const int) 0:16 Post-Increment (int) @@ -59,7 +59,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:17 Pre-Decrement (float) 0:17 indirect index (float) 0:17 y: direct index for structure (5-element array of float) -0:17 'str' (structure) +0:17 'str' (structure{y}) 0:17 Constant: 0:17 0 (const int) 0:17 Pre-Decrement (int) @@ -69,7 +69,7 @@ Warning, version 140 is not yet complete; most features are present, but a few a 0:19 'x' (float) 0:19 direct index (float) 0:19 y: direct index for structure (5-element array of float) -0:19 'str' (structure) +0:19 'str' (structure{y}) 0:19 Constant: 0:19 0 (const int) 0:19 Constant: diff --git a/Test/baseResults/specExamples.frag.out b/Test/baseResults/specExamples.frag.out index d2ee6bc..7c15508 100644 --- a/Test/baseResults/specExamples.frag.out +++ b/Test/baseResults/specExamples.frag.out @@ -196,8 +196,8 @@ ERROR: node is still EOpNull! 0:178 Constant: 0:178 0.000000 0:193 Sequence -0:193 move second child to first child (structure) -0:193 'e' (structure) +0:193 move second child to first child (structure{a,b}) +0:193 'e' (structure{a,b}) 0:193 Constant: 0:193 1.200000 0:193 2 (const int) @@ -266,10 +266,10 @@ ERROR: node is still EOpNull! 0:? 'm' (3X2 matrix of float) 0:? 'highPrecisionMVP' (4X4 matrix of double) 0:? 'dm' (2X4 matrix of double) -0:? 'lightVar' (structure) +0:? 'lightVar' (structure{intensity,position}) 0:? 'frequencies' (3-element array of float) 0:? 'lightPosition' (uniform 4-element array of 4-component vector of float) -0:? 'lights' (2-element array of structure) +0:? 'lights' (2-element array of structure{intensity,position}) 0:? 'numLights' (const int) 0:? 2 (const int) 0:? 'normal' (smooth in 3-component vector of float) @@ -282,12 +282,12 @@ ERROR: node is still EOpNull! 0:? 0.700000 0:? 0.700000 0:? 0.200000 -0:? '__anon__0' (in block) -0:? '__anon__1' (in block) -0:? 'Materiala' (in block) +0:? '__anon__0' (in block{Color1,Color2,TexCoordA,Atten}) +0:? '__anon__1' (in block{LightPos,LightColor}) +0:? 'Materiala' (in block{Color,TexCoord}) 0:? 'gl_FragCoord' (gl_FragCoord 4-component vector of float) 0:? 'factor' (layout(location=3 ) out 4-component vector of float) 0:? 'colors' (layout(location=2 ) out 3-element array of 4-component vector of float) 0:? 'gl_FragDepth' (gl_FragDepth float) -0:? '__anon__2' (in block) +0:? '__anon__2' (in block{gl_FogFragCoord,gl_TexCoord,gl_Color,gl_SecondaryColor}) diff --git a/Test/baseResults/specExamples.vert.out b/Test/baseResults/specExamples.vert.out index 1de3092..cfebc5a 100644 --- a/Test/baseResults/specExamples.vert.out +++ b/Test/baseResults/specExamples.vert.out @@ -223,8 +223,8 @@ ERROR: node is still EOpNull! 0:170 'img2' (coherent uniform image2D) 0:? Sequence 0:178 Sequence -0:178 move second child to first child (structure) -0:178 'lightVar' (structure) +0:178 move second child to first child (structure{intensity,position}) +0:178 'lightVar' (structure{intensity,position}) 0:178 Constant: 0:178 3.000000 0:178 1.000000 @@ -274,26 +274,26 @@ ERROR: node is still EOpNull! 0:194 Constant: 0:194 0.000000 0:? Linker Objects -0:? 'Coords' (out block) -0:? '__anon__0' (out block) -0:? 'transforms' (layout(column_major shared ) uniform 4-element array of block) +0:? 'Coords' (out block{Position,Texture}) +0:? '__anon__0' (out block{Color}) +0:? 'transforms' (layout(column_major shared ) uniform 4-element array of block{ModelViewMatrix,ModelViewProjectionMatrix,a,Deformation}) 0:? 'normal' (layout(location=3 ) in 4-component vector of float) 0:? 'colors' (layout(location=6 ) in 3-element array of 4-component vector of float) -0:? 's' (layout(location=3 ) structure) +0:? 's' (layout(location=3 ) structure{a1,b,c}) 0:? 'var1' (smooth out 4-component vector of float) -0:? '__anon__1' (out block) +0:? '__anon__1' (out block{var2,var3,var4}) 0:? 'var5' (smooth out 4-component vector of float) -0:? '__anon__2' (out block) +0:? '__anon__2' (out block{var6}) 0:? 'var7' (smooth out 4-component vector of float) -0:? '__anon__3' (layout(row_major std140 ) uniform block) -0:? '__anon__4' (layout(column_major shared ) uniform block) +0:? '__anon__3' (layout(row_major std140 ) uniform block{M1,M2,N1}) +0:? '__anon__4' (layout(column_major shared ) uniform block{M13,m14,N12}) 0:? 's17' (layout(binding=3 ) uniform sampler2D) 0:? 'a2' (layout(binding=2 ) uniform int) 0:? 'bar' (layout(binding=2 ) uniform int) 0:? 'b2' (layout(binding=2 ) uniform int) 0:? 'c2' (layout(binding=3 ) uniform int) 0:? 'd2' (layout(binding=2 ) uniform int) -0:? '__anon__5' (out block) +0:? '__anon__5' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:? 'ColorInv' (smooth out 3-component vector of float) 0:? 'Color4' (invariant centroid smooth out 3-component vector of float) 0:? 'position' (smooth out 4-component vector of float) @@ -303,8 +303,8 @@ ERROR: node is still EOpNull! 0:? 'c' (in 4-component vector of float) 0:? 'd' (in 4-component vector of float) 0:? 'v' (smooth out 4-component vector of float) -0:? '__anon__6' (layout(row_major shared ) coherent uniform block) -0:? '__anon__7' (layout(row_major shared ) uniform block) +0:? '__anon__6' (layout(row_major shared ) coherent uniform block{member1,member2}) +0:? '__anon__7' (layout(row_major shared ) uniform block{member1A,member2A}) 0:? 'shv' (shared 4-component vector of float) 0:? 'img1' (uniform image2D) 0:? 'img2' (coherent uniform image2D) diff --git a/Test/baseResults/structAssignment.frag.out b/Test/baseResults/structAssignment.frag.out index 8dbb2e8..9779743 100644 --- a/Test/baseResults/structAssignment.frag.out +++ b/Test/baseResults/structAssignment.frag.out @@ -8,8 +8,8 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:33 Condition 0:33 Compare Greater Than (bool) 0:33 i: direct index for structure (int) -0:33 s2_1: direct index for structure (structure) -0:33 'foo3' (uniform structure) +0:33 s2_1: direct index for structure (structure{i,f,s1_1}) +0:33 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:33 Constant: 0:33 0 (const int) 0:33 Constant: @@ -17,22 +17,22 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:33 Constant: 0:33 0 (const int) 0:33 true case -0:34 move second child to first child (structure) -0:34 'locals2' (structure) -0:34 s2_1: direct index for structure (structure) -0:34 'foo3' (uniform structure) +0:34 move second child to first child (structure{i,f,s1_1}) +0:34 'locals2' (structure{i,f,s1_1}) +0:34 s2_1: direct index for structure (structure{i,f,s1_1}) +0:34 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:34 Constant: 0:34 0 (const int) 0:33 false case -0:36 move second child to first child (structure) -0:36 'locals2' (structure) -0:36 'foo2' (uniform structure) +0:36 move second child to first child (structure{i,f,s1_1}) +0:36 'locals2' (structure{i,f,s1_1}) +0:36 'foo2' (uniform structure{i,f,s1_1}) 0:38 move second child to first child (4-component vector of float) 0:38 'gl_FragColor' (fragColor 4-component vector of float) 0:38 vector-scale (4-component vector of float) 0:38 f: direct index for structure (float) -0:38 s1_1: direct index for structure (structure) -0:38 'locals2' (structure) +0:38 s1_1: direct index for structure (structure{i,f}) +0:38 'locals2' (structure{i,f,s1_1}) 0:38 Constant: 0:38 2 (const int) 0:38 Constant: @@ -43,7 +43,7 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:? Linker Objects 0:? 'sampler' (uniform sampler2D) 0:? 'coord' (smooth in 2-component vector of float) -0:? 'foo' (uniform structure) -0:? 'foo2' (uniform structure) -0:? 'foo3' (uniform structure) +0:? 'foo' (uniform structure{i,f}) +0:? 'foo2' (uniform structure{i,f,s1_1}) +0:? 'foo3' (uniform structure{s2_1,i,f,s1_1}) diff --git a/Test/baseResults/structDeref.frag.out b/Test/baseResults/structDeref.frag.out index ea556ad..75b74e4 100644 --- a/Test/baseResults/structDeref.frag.out +++ b/Test/baseResults/structDeref.frag.out @@ -8,9 +8,9 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:51 Condition 0:51 Compare Greater Than (bool) 0:51 i: direct index for structure (int) -0:51 direct index (structure) -0:51 s2_1: direct index for structure (12-element array of structure) -0:51 'foo3' (uniform structure) +0:51 direct index (structure{i,f,s1_1}) +0:51 s2_1: direct index for structure (12-element array of structure{i,f,s1_1}) +0:51 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:51 Constant: 0:51 0 (const int) 0:51 Constant: @@ -23,14 +23,14 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:52 Sequence 0:52 move second child to first child (float) 0:52 f: direct index for structure (float) -0:52 'locals2' (structure) +0:52 'locals2' (structure{i,f,s1_1}) 0:52 Constant: 0:52 1 (const int) 0:52 Constant: 0:52 1.000000 -0:53 move second child to first child (structure) -0:53 s1_1: direct index for structure (structure) -0:53 'locals2' (structure) +0:53 move second child to first child (structure{i,f,s0_1}) +0:53 s1_1: direct index for structure (structure{i,f,s0_1}) +0:53 'locals2' (structure{i,f,s1_1}) 0:53 Constant: 0:53 2 (const int) 0:53 Constant: @@ -46,44 +46,44 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:54 0.000000 0:54 0.000000 0:54 0.000000 -0:55 move second child to first child (structure) -0:55 direct index (structure) -0:55 'locals1Array' (10-element array of structure) +0:55 move second child to first child (structure{i,f,s0_1}) +0:55 direct index (structure{i,f,s0_1}) +0:55 'locals1Array' (10-element array of structure{i,f,s0_1}) 0:55 Constant: 0:55 6 (const int) -0:55 'foo1' (uniform structure) -0:56 move second child to first child (structure) -0:56 'locals0' (structure) +0:55 'foo1' (uniform structure{i,f,s0_1}) +0:56 move second child to first child (structure{i}) +0:56 'locals0' (structure{i}) 0:56 Constant: 0:56 0 (const int) -0:57 move second child to first child (structure) -0:57 'locals00' (structure) +0:57 move second child to first child (structure{s0_0}) +0:57 'locals00' (structure{s0_0}) 0:57 Constant: 0:57 0 (const int) 0:51 false case 0:59 Sequence 0:59 move second child to first child (float) 0:59 f: direct index for structure (float) -0:59 'locals2' (structure) +0:59 'locals2' (structure{i,f,s1_1}) 0:59 Constant: 0:59 1 (const int) 0:59 direct index (float) 0:59 'coord' (smooth in 2-component vector of float) 0:59 Constant: 0:59 0 (const int) -0:60 move second child to first child (structure) -0:60 s1_1: direct index for structure (structure) -0:60 'locals2' (structure) +0:60 move second child to first child (structure{i,f,s0_1}) +0:60 s1_1: direct index for structure (structure{i,f,s0_1}) +0:60 'locals2' (structure{i,f,s1_1}) 0:60 Constant: 0:60 2 (const int) -0:60 Construct structure (structure) +0:60 Construct structure (structure{i,f,s0_1}) 0:60 Constant: 0:60 1 (const int) 0:60 direct index (float) 0:60 'coord' (smooth in 2-component vector of float) 0:60 Constant: 0:60 1 (const int) -0:60 'foo0' (uniform structure) +0:60 'foo0' (uniform structure{i}) 0:61 move second child to first child (6-element array of float) 0:61 'fArray' (6-element array of float) 0:61 Constant: @@ -93,38 +93,38 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:61 3.000000 0:61 4.000000 0:61 5.000000 -0:62 move second child to first child (structure) -0:62 direct index (structure) -0:62 'locals1Array' (10-element array of structure) +0:62 move second child to first child (structure{i,f,s0_1}) +0:62 direct index (structure{i,f,s0_1}) +0:62 'locals1Array' (10-element array of structure{i,f,s0_1}) 0:62 Constant: 0:62 6 (const int) -0:62 s1_1: direct index for structure (structure) -0:62 'locals2' (structure) +0:62 s1_1: direct index for structure (structure{i,f,s0_1}) +0:62 'locals2' (structure{i,f,s1_1}) 0:62 Constant: 0:62 2 (const int) -0:63 move second child to first child (structure) -0:63 'locals0' (structure) -0:63 s0_1: direct index for structure (structure) -0:63 'foo1' (uniform structure) +0:63 move second child to first child (structure{i}) +0:63 'locals0' (structure{i}) +0:63 s0_1: direct index for structure (structure{i}) +0:63 'foo1' (uniform structure{i,f,s0_1}) 0:63 Constant: 0:63 2 (const int) -0:64 move second child to first child (structure) -0:64 'locals00' (structure) -0:64 'foo00' (uniform structure) +0:64 move second child to first child (structure{s0_0}) +0:64 'locals00' (structure{s0_0}) +0:64 'foo00' (uniform structure{s0_0}) 0:67 Test condition and select (void) 0:67 Condition 0:67 Compare Greater Than (bool) 0:67 i: direct index for structure (int) -0:67 'locals0' (structure) +0:67 'locals0' (structure{i}) 0:67 Constant: 0:67 0 (const int) 0:67 Constant: 0:67 5 (const int) 0:67 true case -0:68 move second child to first child (structure) -0:68 'locals0' (structure) -0:68 s0_0: direct index for structure (structure) -0:68 'locals00' (structure) +0:68 move second child to first child (structure{i}) +0:68 'locals0' (structure{i}) +0:68 s0_0: direct index for structure (structure{i}) +0:68 'locals00' (structure{s0_0}) 0:68 Constant: 0:68 0 (const int) 0:70 move second child to first child (4-component vector of float) @@ -135,12 +135,12 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:70 add (float) 0:70 Convert int to float (float) 0:70 i: direct index for structure (int) -0:70 'locals0' (structure) +0:70 'locals0' (structure{i}) 0:70 Constant: 0:70 0 (const int) 0:70 f: direct index for structure (float) -0:70 direct index (structure) -0:70 'locals1Array' (10-element array of structure) +0:70 direct index (structure{i,f,s0_1}) +0:70 'locals1Array' (10-element array of structure{i,f,s0_1}) 0:70 Constant: 0:70 6 (const int) 0:70 Constant: @@ -150,8 +150,8 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:70 Constant: 0:70 3 (const int) 0:70 f: direct index for structure (float) -0:70 s1_1: direct index for structure (structure) -0:70 'locals2' (structure) +0:70 s1_1: direct index for structure (structure{i,f,s0_1}) +0:70 'locals2' (structure{i,f,s1_1}) 0:70 Constant: 0:70 2 (const int) 0:70 Constant: @@ -162,9 +162,9 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas 0:? Linker Objects 0:? 'sampler' (uniform sampler2D) 0:? 'coord' (smooth in 2-component vector of float) -0:? 'foo0' (uniform structure) -0:? 'foo1' (uniform structure) -0:? 'foo2' (uniform structure) -0:? 'foo3' (uniform structure) -0:? 'foo00' (uniform structure) +0:? 'foo0' (uniform structure{i}) +0:? 'foo1' (uniform structure{i,f,s0_1}) +0:? 'foo2' (uniform structure{i,f,s1_1}) +0:? 'foo3' (uniform structure{s2_1,i,f,s1_1}) +0:? 'foo00' (uniform structure{s0_0}) diff --git a/Test/baseResults/structure.frag.out b/Test/baseResults/structure.frag.out index 5d0719d..1c5f9fd 100644 --- a/Test/baseResults/structure.frag.out +++ b/Test/baseResults/structure.frag.out @@ -14,8 +14,8 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:24 Compare Greater Than (bool) 0:24 direct index (int) 0:24 i: direct index for structure (5-element array of int) -0:24 direct index (uniform structure) -0:24 'foo2' (uniform 5-element array of structure) +0:24 direct index (uniform structure{i,f,s1_1}) +0:24 'foo2' (uniform 5-element array of structure{i,f,s1_1}) 0:24 Constant: 0:24 3 (const int) 0:24 Constant: @@ -30,10 +30,10 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:25 direct index (float) 0:25 direct index (4-component vector of float) 0:25 color: direct index for structure (5-element array of 4-component vector of float) -0:25 direct index (structure) -0:25 s1_1: direct index for structure (7-element array of structure) -0:25 direct index (uniform structure) -0:25 'foo2' (uniform 5-element array of structure) +0:25 direct index (structure{i,f,color}) +0:25 s1_1: direct index for structure (7-element array of structure{i,f,color}) +0:25 direct index (uniform structure{i,f,s1_1}) +0:25 'foo2' (uniform 5-element array of structure{i,f,s1_1}) 0:25 Constant: 0:25 3 (const int) 0:25 Constant: @@ -51,10 +51,10 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:27 'scale' (float) 0:27 direct index (float) 0:27 f: direct index for structure (4-element array of float) -0:27 direct index (structure) -0:27 s1_1: direct index for structure (7-element array of structure) -0:27 direct index (uniform structure) -0:27 'foo2' (uniform 5-element array of structure) +0:27 direct index (structure{i,f,color}) +0:27 s1_1: direct index for structure (7-element array of structure{i,f,color}) +0:27 direct index (uniform structure{i,f,s1_1}) +0:27 'foo2' (uniform 5-element array of structure{i,f,s1_1}) 0:27 Constant: 0:27 3 (const int) 0:27 Constant: @@ -75,6 +75,6 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:? Linker Objects 0:? 'sampler' (uniform sampler2D) 0:? 'coord' (smooth in 2-component vector of float) -0:? 'foo' (uniform structure) -0:? 'foo2' (uniform 5-element array of structure) +0:? 'foo' (uniform structure{i,f,color}) +0:? 'foo2' (uniform 5-element array of structure{i,f,s1_1}) diff --git a/Test/baseResults/variableArrayIndex.frag.out b/Test/baseResults/variableArrayIndex.frag.out index 4a223b0..7f32727 100644 --- a/Test/baseResults/variableArrayIndex.frag.out +++ b/Test/baseResults/variableArrayIndex.frag.out @@ -12,9 +12,9 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:34 Condition 0:34 Compare Greater Than (bool) 0:34 i: direct index for structure (int) -0:34 direct index (structure) -0:34 s2_1: direct index for structure (3-element array of structure) -0:34 'foo3' (uniform structure) +0:34 direct index (structure{i,f,s1_1}) +0:34 s2_1: direct index for structure (3-element array of structure{i,f,s1_1}) +0:34 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:34 Constant: 0:34 0 (const int) 0:34 Constant: @@ -27,19 +27,19 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:35 move second child to first child (float) 0:35 'scale' (float) 0:35 f: direct index for structure (float) -0:35 s1_1: direct index for structure (structure) -0:35 indirect index (uniform structure) -0:35 'foo2' (uniform 5-element array of structure) +0:35 s1_1: direct index for structure (structure{i,f}) +0:35 indirect index (uniform structure{i,f,s1_1}) +0:35 'foo2' (uniform 5-element array of structure{i,f,s1_1}) 0:35 add (int) 0:35 add (int) 0:35 i: direct index for structure (int) -0:35 indirect index (structure) -0:35 s2_1: direct index for structure (3-element array of structure) -0:35 'foo3' (uniform structure) +0:35 indirect index (structure{i,f,s1_1}) +0:35 s2_1: direct index for structure (3-element array of structure{i,f,s1_1}) +0:35 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:35 Constant: 0:35 0 (const int) 0:35 i: direct index for structure (int) -0:35 'foo' (uniform structure) +0:35 'foo' (uniform structure{i,f}) 0:35 Constant: 0:35 0 (const int) 0:35 Constant: @@ -56,10 +56,10 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:37 move second child to first child (float) 0:37 'scale' (float) 0:37 f: direct index for structure (float) -0:37 s1_1: direct index for structure (structure) -0:37 direct index (structure) -0:37 s2_1: direct index for structure (3-element array of structure) -0:37 'foo3' (uniform structure) +0:37 s1_1: direct index for structure (structure{i,f}) +0:37 direct index (structure{i,f,s1_1}) +0:37 s2_1: direct index for structure (3-element array of structure{i,f,s1_1}) +0:37 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:37 Constant: 0:37 0 (const int) 0:37 Constant: @@ -91,20 +91,20 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas 0:46 indirect index (2-component vector of float) 0:46 'constructed' (3-element array of 2-component vector of float) 0:46 i: direct index for structure (int) -0:46 'foo' (uniform structure) +0:46 'foo' (uniform structure{i,f}) 0:46 Constant: 0:46 0 (const int) 0:46 indirect index (2-component vector of float) 0:46 'constructed' (3-element array of 2-component vector of float) 0:46 i: direct index for structure (int) -0:46 'foo' (uniform structure) +0:46 'foo' (uniform structure{i,f}) 0:46 Constant: 0:46 0 (const int) 0:? Linker Objects 0:? 'sampler' (uniform sampler2D) 0:? 'coord' (smooth in 2-component vector of float) -0:? 'foo' (uniform structure) -0:? 'foo2' (uniform 5-element array of structure) -0:? 'foo3' (uniform structure) +0:? 'foo' (uniform structure{i,f}) +0:? 'foo2' (uniform 5-element array of structure{i,f,s1_1}) +0:? 'foo3' (uniform structure{s2_1,i,f,s1_1}) 0:? 'Count' (uniform int) diff --git a/Test/baseResults/versionsClean.vert.out b/Test/baseResults/versionsClean.vert.out index 2312bb4..8d83c61 100644 --- a/Test/baseResults/versionsClean.vert.out +++ b/Test/baseResults/versionsClean.vert.out @@ -5,7 +5,7 @@ Warning, version 420 is not yet complete; some version-specific features are pre 0:42 Sequence 0:42 move second child to first child (4-component vector of float) 0:42 gl_Position: direct index for structure (gl_Position 4-component vector of float) -0:42 '__anon__1' (out block) +0:42 '__anon__1' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:42 Constant: 0:42 0 (const uint) 0:42 Construct vec4 (4-component vector of float) diff --git a/Test/baseResults/versionsErrors.vert.out b/Test/baseResults/versionsErrors.vert.out index 68ddaaa..0b6ac18 100644 --- a/Test/baseResults/versionsErrors.vert.out +++ b/Test/baseResults/versionsErrors.vert.out @@ -10,7 +10,7 @@ ERROR: node is still EOpNull! 0:44 Sequence 0:44 move second child to first child (4-component vector of float) 0:44 gl_Position: direct index for structure (gl_Position 4-component vector of float) -0:44 '__anon__1' (out block) +0:44 '__anon__1' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord}) 0:44 Constant: 0:44 0 (const uint) 0:44 Construct vec4 (4-component vector of float) diff --git a/Todo.txt b/Todo.txt index a69618a..1e6be18 100644 --- a/Todo.txt +++ b/Todo.txt @@ -132,7 +132,7 @@ Shader Functionality to Implement/Finish - redeclaration of input/output blocks - ... - Add 64-bit floating-point attributes for vertex shader inputs. - - Support viewport arrays so where the geometry shader selects which viewport array will transform its output. + + Support viewport arrays so where the geometry shader selects which viewport array will transform its output. GLSL 4.2 + Move these previously deprecated features to be only in the compatibility profile: + The keyword attribute for vertex shader inputs. (Use in instead.) @@ -211,7 +211,7 @@ Shader Functionality to Implement/Finish - make indexes outside the range [0,1] a compile-time error. - Add textureQueryLevels() built-ins to query the number of mipmap levels, as per the GL_ARB_texture_query_levels extension. - - Make gl_Layer and gl_ViewportIndex also be inputs to the fragment shader, as per the + + Make gl_Layer and gl_ViewportIndex also be inputs to the fragment shader, as per the GL_ARB_fragment_layer_viewport extension. - Add more examples and rules to be more specific about the required behavior of the precise qualifier. diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index 98e1197..e7e4bc3 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -755,6 +755,17 @@ public: TString s(buf); s.append(getCompleteTypeString()); + // Add struct/block members + if (structure) { + s.append("{"); + for (size_t i = 0; i < structure->size(); ++i) { + s.append((*structure)[i].type->getFieldName()); + if (i < structure->size()-1) + s.append(","); + } + s.append("}"); + } + return s; } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 1329a5c..f59a1df 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1328,7 +1328,7 @@ void TBuiltIns::initialize(int version, EProfile profile) ); if (IncludeLegacy(version, profile)) { - if (version < 410) + if (version < 150) stageBuiltins[EShLangFragment].append( "in float gl_FogFragCoord;" "in vec4 gl_TexCoord[];" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 451c25c..1b12ce7 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1881,7 +1881,7 @@ void TParseContext::nonInitConstCheck(TSourceLoc loc, TString& identifier, TType // // Returns a redeclared and type-modified variable if a redeclarated occurred. // -TSymbol* TParseContext::redeclareBuiltin(TSourceLoc loc, const TString& identifier, bool& newDeclaration) +TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString& identifier, bool& newDeclaration) { if (profile == EEsProfile || identifier.compare(0, 3, "gl_") != 0 || symbolTable.atBuiltInLevel()) return 0; @@ -1889,8 +1889,6 @@ TSymbol* TParseContext::redeclareBuiltin(TSourceLoc loc, const TString& identifi // Potentially redeclaring a built-in variable... if ((identifier == "gl_FragDepth" && version >= 420) || - (identifier == "gl_PerVertex" && version >= 410) || - (identifier == "gl_PerFragment" && version >= 410) || (identifier == "gl_FragCoord" && version >= 150) || (identifier == "gl_ClipDistance" && version >= 130) || (identifier == "gl_FrontColor" && version >= 130) || @@ -1928,6 +1926,90 @@ TSymbol* TParseContext::redeclareBuiltin(TSourceLoc loc, const TString& identifi return 0; } +bool TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes) +{ + // just a quick out, not everything that must be checked: + if (symbolTable.atBuiltInLevel() || profile == EEsProfile || blockName.compare(0, 3, "gl_") != 0) + return false; + + if (instanceName && instanceName->compare(0, 3, "gl_") != 0) { + error(loc, "cannot redeclare a built-in block with a user name", instanceName->c_str(), ""); + return false; + } + + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 410, GL_ARB_separate_shader_objects, "built-in block redeclaration"); + + // Potentially redeclaring a built-in block... + + if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment") + return false; + + + // Blocks with instance names are easy to find, lookup the instance name, + // Anonymous blocks need to be found via a member. copyUp()?? will work + // just fine for either find. + + bool builtIn; + TSymbol* block; + if (instanceName) + block = symbolTable.find(*instanceName, &builtIn); + else + block = symbolTable.find(typeList.front().type->getFieldName(), &builtIn); + + // If the block was not found, this must be a version/profile/stage + // that doesn't have it. + if (! block) + return false; + + // Built-in blocks cannot be redeclared more than once, which if happened, + // we'd be finding the already redeclared one here, rather than the built in. + if (! builtIn) { + error(loc, "can only redeclare a built-in block once", blockName.c_str(), ""); + return false; + } + + // Copy the to make a writable version, to insert into the block table after editing + block = symbolTable.copyUpDeferredInsert(block); + + if (block->getType().getBasicType() != EbtBlock) { + error(loc, "cannot redeclare a non block as a block", blockName.c_str(), ""); + return false; + } + + // TODO: semantics: block redeclaration: instance array size matching? + + // Edit and error check the container against the redeclaration + // - remove unused members + // - ensure remaining qualifiers match + TType& type = block->getWritableType(); + TTypeList::iterator member = type.getStruct()->begin(); + while (member != type.getStruct()->end()) { + // look for match + bool found = false; + for (TTypeList::iterator newMember = typeList.begin(); newMember != typeList.end(); ++newMember) { + if (member->type->getFieldName() == newMember->type->getFieldName()) { + found = true; + break; + } + } + + // remove non-redeclared members + if (found) + ++member; + else + member = type.getStruct()->erase(member); + + // TODO: semantics: block redeclaration: member type/qualifier matching + } + + symbolTable.insert(*block); + + // Save it in the AST for linker use. + intermediate.addSymbolLinkageNode(linkage, *block); + + return true; +} + void TParseContext::paramCheck(TSourceLoc loc, const TStorageQualifier& qualifier, TType* type) { switch (qualifier) { @@ -2418,12 +2500,9 @@ TIntermNode* TParseContext::declareVariable(TSourceLoc loc, TString& identifier, if (! type.getQualifier().hasStream() && language == EShLangGeometry && type.getQualifier().storage == EvqVaryingOut) type.getQualifier().layoutStream = globalOutputDefaults.layoutStream; - if (publicType.geometry != ElgNone) - error(loc, "geometry primitive qualifier cannot be applied to a variable declaration", TQualifier::getGeometryString(publicType.geometry), ""); - // Check for redeclaration of built-ins and/or attempting to declare a reserved name bool newDeclaration = false; // true if a new entry gets added to the symbol table - TSymbol* symbol = redeclareBuiltin(loc, identifier, newDeclaration); + TSymbol* symbol = redeclareBuiltinVariable(loc, identifier, newDeclaration); if (! symbol) reservedErrorCheck(loc, identifier); @@ -2848,10 +2927,14 @@ TIntermTyped* TParseContext::constructStruct(TIntermNode* node, const TType& typ // // Do everything needed to add an interface block. // -void TParseContext::addBlock(TSourceLoc loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) +void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) { - // First, error checks + // This might be a redeclaration of a built-in block, find out, and get + // a modifiable copy if so. + if (redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes)) + return; + // Basic error checks if (reservedErrorCheck(loc, *blockName)) return; diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index ef92129..9504e51 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -115,7 +115,8 @@ public: void precisionQualifierCheck(TSourceLoc, TPublicType&); void parameterSamplerCheck(TSourceLoc, TStorageQualifier qualifier, const TType& type); bool containsSampler(const TType& type); - TSymbol* redeclareBuiltin(TSourceLoc, const TString&, bool& newDeclaration); + TSymbol* redeclareBuiltinVariable(TSourceLoc, const TString&, bool& newDeclaration); + bool redeclareBuiltinBlock(TSourceLoc, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); void paramCheck(TSourceLoc, const TStorageQualifier&, TType* type); void nestedBlockCheck(TSourceLoc); void nestedStructCheck(TSourceLoc); @@ -137,7 +138,7 @@ public: TIntermTyped* addConstructor(TSourceLoc, TIntermNode*, const TType&, TOperator); TIntermTyped* constructStruct(TIntermNode*, const TType&, int, TSourceLoc); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermNode*, TSourceLoc, bool subset); - void addBlock(TSourceLoc, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); + void declareBlock(TSourceLoc, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); void addQualifierToExisting(TSourceLoc, TQualifier, const TString& identifier); void addQualifierToExisting(TSourceLoc, TQualifier, TIdentifierList&); void updateStandaloneQualifierDefaults(TSourceLoc, const TPublicType&); diff --git a/glslang/MachineIndependent/SymbolTable.h b/glslang/MachineIndependent/SymbolTable.h index 0758a1c..9da4626 100644 --- a/glslang/MachineIndependent/SymbolTable.h +++ b/glslang/MachineIndependent/SymbolTable.h @@ -463,13 +463,11 @@ public: // to the current level, so it can be modified without impacting other users // of the shared table. // - TSymbol* copyUp(TSymbol* shared) + TSymbol* copyUpDeferredInsert(TSymbol* shared) { - TSymbol* copy; if (shared->getAsVariable()) { - copy = shared->clone(); + TSymbol* copy = shared->clone(); copy->setUniqueId(shared->getUniqueId()); - table[currentLevel()]->insert(*copy); return copy; } else { const TAnonMember* anon = shared->getAsAnonMember(); @@ -477,7 +475,20 @@ public: TVariable* container = anon->getAnonContainer().clone(); container->changeName(NewPoolTString("")); container->setUniqueId(anon->getAnonContainer().getUniqueId()); - table[currentLevel()]->insert(*container); + return container; + } + } + + TSymbol* copyUp(TSymbol* shared) + { + TSymbol* copy = copyUpDeferredInsert(shared); + table[currentLevel()]->insert(*copy); + if (shared->getAsVariable()) + return copy; + else { + // get copy of an anonymous member's container + table[currentLevel()]->insert(*copy); + // return the copy of the anonymous member return table[currentLevel()]->find(shared->getName()); } } diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 20b8028..56bb3a5 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -761,15 +761,15 @@ declaration $$ = 0; } | block_structure SEMICOLON { - parseContext.addBlock($1.loc, *$1.typeList); + parseContext.declareBlock($1.loc, *$1.typeList); $$ = 0; } | block_structure IDENTIFIER SEMICOLON { - parseContext.addBlock($1.loc, *$1.typeList, $2.string); + parseContext.declareBlock($1.loc, *$1.typeList, $2.string); $$ = 0; } | block_structure IDENTIFIER array_specifier SEMICOLON { - parseContext.addBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes); + parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes); $$ = 0; } | type_qualifier SEMICOLON { -- 2.7.4