diff --git a/Test/450.frag b/Test/450.frag index 19772552..9df13912 100644 --- a/Test/450.frag +++ b/Test/450.frag @@ -58,8 +58,9 @@ float cull(int i) layout(location = 6) in bName1 { float f; layout(location = 7) float g; + mat4 m; } bInst1; -layout(location = 8) in bName2 { +layout(location = 12) in bName2 { float f; - layout(location = 9) float g; // ERROR, location on array + layout(location = 13) float g; // ERROR, location on array } bInst2[3]; diff --git a/Test/baseResults/330.frag.out b/Test/baseResults/330.frag.out index 4b5a84be..5919c76a 100644 --- a/Test/baseResults/330.frag.out +++ b/Test/baseResults/330.frag.out @@ -100,7 +100,7 @@ ERROR: node is still EOpNull! 0:? 'v20' ( smooth in 4-component vector of float) 0:? 'v21' (layout( location=60) smooth in float) 0:? 'v22' (layout( location=2) smooth in float) -0:? 'anon@1' ( in block{layout( location=1 component=0) in float f1, layout( location=3) in float f2}) +0:? 'anon@1' ( in block{layout( location=1) in float f1, layout( location=3) in float f2}) 0:? 'uinst' (layout( location=1 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) 0:? 'v3' (layout( location=6) smooth in 4-component vector of float) 0:? 'v4' ( smooth in 4-component vector of float) @@ -108,12 +108,12 @@ ERROR: node is still EOpNull! 0:? 'v6' (layout( location=30) smooth in 4-component vector of float) 0:? 'v23' (layout( location=61) smooth in float) 0:? 'v24' (layout( location=62) smooth in float) -0:? 'ininst2' ( in block{layout( location=28 component=0) in bool b1, layout( location=29 component=0) in float f1, layout( location=25) in float f2, layout( location=26 component=0) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23 component=0) in 4-component vector of float f4, layout( location=24 component=0) in 4-component vector of float f5}) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2, layout( location=26) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23) in 4-component vector of float f4, layout( location=24) in 4-component vector of float f5}) 0:? 'uinst2' (layout( location=13 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) 0:? 'in3' ( in block{ in float f1, layout( location=40) in float f2}) 0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) 0:? 's' (layout( location=33) smooth in structure{ global 3-component vector of float a, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c, temp 2-component vector of float A}) -0:? 'anon@2' ( in block{layout( location=44 component=0) in 4-component vector of float d, layout( location=45 component=0) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48 component=0) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42 component=0) in 4-component vector of float i, layout( location=43 component=0) in 4-component vector of float j, layout( location=44 component=0) in 4-component vector of float k}) +0:? 'anon@2' ( in block{layout( location=44) in 4-component vector of float d, layout( location=45) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42) in 4-component vector of float i, layout( location=43) in 4-component vector of float j, layout( location=44) in 4-component vector of float k}) 0:? 'outVar2' (layout( location=4095 index=0) out 4-component vector of float) 0:? 'outVar3' (layout( location=0 index=1) out 4-component vector of float) 0:? 'outVar4' (layout( location=0 index=1) out 4-component vector of float) @@ -165,7 +165,7 @@ ERROR: node is still EOpNull! 0:? 'v20' ( smooth in 4-component vector of float) 0:? 'v21' (layout( location=60) smooth in float) 0:? 'v22' (layout( location=2) smooth in float) -0:? 'anon@1' ( in block{layout( location=1 component=0) in float f1, layout( location=3) in float f2}) +0:? 'anon@1' ( in block{layout( location=1) in float f1, layout( location=3) in float f2}) 0:? 'uinst' (layout( location=1 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) 0:? 'v3' (layout( location=6) smooth in 4-component vector of float) 0:? 'v4' ( smooth in 4-component vector of float) @@ -173,12 +173,12 @@ ERROR: node is still EOpNull! 0:? 'v6' (layout( location=30) smooth in 4-component vector of float) 0:? 'v23' (layout( location=61) smooth in float) 0:? 'v24' (layout( location=62) smooth in float) -0:? 'ininst2' ( in block{layout( location=28 component=0) in bool b1, layout( location=29 component=0) in float f1, layout( location=25) in float f2, layout( location=26 component=0) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23 component=0) in 4-component vector of float f4, layout( location=24 component=0) in 4-component vector of float f5}) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2, layout( location=26) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23) in 4-component vector of float f4, layout( location=24) in 4-component vector of float f5}) 0:? 'uinst2' (layout( location=13 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) 0:? 'in3' ( in block{ in float f1, layout( location=40) in float f2}) 0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) 0:? 's' (layout( location=33) smooth in structure{ global 3-component vector of float a, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c, temp 2-component vector of float A}) -0:? 'anon@2' ( in block{layout( location=44 component=0) in 4-component vector of float d, layout( location=45 component=0) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48 component=0) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42 component=0) in 4-component vector of float i, layout( location=43 component=0) in 4-component vector of float j, layout( location=44 component=0) in 4-component vector of float k}) +0:? 'anon@2' ( in block{layout( location=44) in 4-component vector of float d, layout( location=45) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42) in 4-component vector of float i, layout( location=43) in 4-component vector of float j, layout( location=44) in 4-component vector of float k}) 0:? 'outVar2' (layout( location=4095 index=0) out 4-component vector of float) 0:? 'outVar3' (layout( location=0 index=1) out 4-component vector of float) 0:? 'outVar4' (layout( location=0 index=1) out 4-component vector of float) diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index a5898f24..78b16980 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -233,7 +233,7 @@ ERROR: node is still EOpNull! 0:? 'start2' ( const int) 0:? 5 (const int) 0:? 'v6' (layout( location=19) in 4-component vector of float) -0:? 'ininst2' ( in block{layout( location=28 component=0) in bool b1, layout( location=29 component=0) in float f1, layout( location=25) in float f2}) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2}) 0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) 0:? 'bbinst2g' ( out block{layout( xfb_buffer=3 xfb_offset=64) out 4-component vector of float bbv}) 0:? 'bg' (layout( xfb_buffer=1 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) @@ -308,7 +308,7 @@ ERROR: node is still EOpNull! 0:? 'start2' ( const int) 0:? 5 (const int) 0:? 'v6' (layout( location=19) in 4-component vector of float) -0:? 'ininst2' ( in block{layout( location=28 component=0) in bool b1, layout( location=29 component=0) in float f1, layout( location=25) in float f2}) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2}) 0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) 0:? 'bbinst2g' ( out block{layout( xfb_buffer=3 xfb_offset=64) out 4-component vector of float bbv}) 0:? 'bg' (layout( xfb_buffer=1 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) diff --git a/Test/baseResults/450.frag.out b/Test/baseResults/450.frag.out index 3e4ed5f9..11032310 100644 --- a/Test/baseResults/450.frag.out +++ b/Test/baseResults/450.frag.out @@ -1,6 +1,6 @@ 450.frag Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:62: 'location' : cannot use in a block array where new locations are needed for each block element +ERROR: 0:63: 'location' : cannot use in a block array where new locations are needed for each block element ERROR: 1 compilation errors. No code generated. @@ -163,8 +163,8 @@ ERROR: node is still EOpNull! 0:? 'us2dmsa' ( uniform usampler2DMSArray) 0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) 0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) -0:? 'bInst1' ( in block{layout( location=6 component=0) in float f, layout( location=7) in float g}) -0:? 'bInst2' ( in 3-element array of block{layout( location=8 component=0) in float f, layout( location=9) in float g}) +0:? 'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m}) +0:? 'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g}) Linked fragment stage: @@ -278,6 +278,6 @@ ERROR: node is still EOpNull! 0:? 'us2dmsa' ( uniform usampler2DMSArray) 0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) 0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) -0:? 'bInst1' ( in block{layout( location=6 component=0) in float f, layout( location=7) in float g}) -0:? 'bInst2' ( in 3-element array of block{layout( location=8 component=0) in float f, layout( location=9) in float g}) +0:? 'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m}) +0:? 'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g}) diff --git a/Test/baseResults/450.tesc.out b/Test/baseResults/450.tesc.out index 7e0918f6..88cbfdfc 100644 --- a/Test/baseResults/450.tesc.out +++ b/Test/baseResults/450.tesc.out @@ -33,8 +33,8 @@ ERROR: node is still EOpNull! 0:? Linker Objects 0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) 0:? 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) -0:? 'bInst1' ( out 2-element array of block{layout( location=4 component=0) out float f, layout( location=5) out float g}) -0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6 component=0) out float f, layout( location=7) out float g}) +0:? 'bInst1' ( out 2-element array of block{layout( location=4) out float f, layout( location=5) out float g}) +0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6) out float f, layout( location=7) out float g}) Linked tessellation control stage: @@ -70,6 +70,6 @@ ERROR: node is still EOpNull! 0:? Linker Objects 0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) 0:? 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) -0:? 'bInst1' ( out 2-element array of block{layout( location=4 component=0) out float f, layout( location=5) out float g}) -0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6 component=0) out float f, layout( location=7) out float g}) +0:? 'bInst1' ( out 2-element array of block{layout( location=4) out float f, layout( location=5) out float g}) +0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6) out float f, layout( location=7) out float g}) diff --git a/Test/baseResults/spv.450.tesc.out b/Test/baseResults/spv.450.tesc.out index a0bf3dd3..6244be12 100755 --- a/Test/baseResults/spv.450.tesc.out +++ b/Test/baseResults/spv.450.tesc.out @@ -47,12 +47,10 @@ Warning, version 450 is not yet complete; most version-specific features are pre Decorate 19(singleBlock) Location 2 MemberDecorate 20(bn) 0 Patch MemberDecorate 20(bn) 0 Location 20 - MemberDecorate 20(bn) 0 Component 0 MemberDecorate 20(bn) 1 Patch MemberDecorate 20(bn) 1 Location 24 MemberDecorate 20(bn) 2 Patch MemberDecorate 20(bn) 2 Location 25 - MemberDecorate 20(bn) 2 Component 0 Decorate 20(bn) Block 2: TypeVoid 3: TypeFunction 2 diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 5446a789..c1f0b30f 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -5893,7 +5893,7 @@ void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifi if (nextLocation >= (int)TQualifier::layoutLocationEnd) error(memberLoc, "location is too large", "location", ""); memberQualifier.layoutLocation = nextLocation; - memberQualifier.layoutComponent = 0; + memberQualifier.layoutComponent = TQualifier::layoutComponentEnd; } nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type); }