From e818a197e272291a2e5b48e37a5e14e2da417015 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Mon, 23 Mar 2020 23:09:37 -0400 Subject: [PATCH 1/5] rework how shader interface block naming rules are handled * Fixes 2136 According to the spec, shader interfaces (uniform blocks, buffer blocks, input blocks, output blocks) all should be matched up via their block names across all compilation units, not instance names. Also, all block names can be re-used between all 4 interface types without conflict. This change makes it so all of these blocks are matched and remapped using block name and not by instance name. Additional the rule that matched uniform and buffer blocks must either be anonymous or named (but not nessearily the same name) is now imposed. --- .../link.multiAnonBlocksInvalid.0.0.vert.out | 176 +++++++ .../link.multiAnonBlocksValid.0.0.vert.out | 157 +++++++ .../link.multiBlocksInvalid.0.0.vert.out | 163 +++++++ .../link.multiBlocksValid.1.0.vert.out | 157 +++++++ .../link.vk.multiBlocksValid.0.0.vert.out | 313 +++++++++++++ .../link.vk.multiBlocksValid.1.0.geom.out | 441 ++++++++++++++++++ .../link.vk.pcNamingInvalid.0.0.vert.out | 111 +++++ Test/link.multiAnonBlocksInvalid.0.0.vert | 52 +++ Test/link.multiAnonBlocksInvalid.0.1.vert | 48 ++ Test/link.multiAnonBlocksValid.0.0.vert | 38 ++ Test/link.multiAnonBlocksValid.0.1.vert | 34 ++ Test/link.multiBlocksInvalid.0.0.vert | 33 ++ Test/link.multiBlocksInvalid.0.1.vert | 31 ++ Test/link.multiBlocksValid.1.0.vert | 32 ++ Test/link.multiBlocksValid.1.1.vert | 34 ++ Test/link.vk.multiBlocksValid.0.0.vert | 51 ++ Test/link.vk.multiBlocksValid.0.1.vert | 46 ++ Test/link.vk.multiBlocksValid.1.0.geom | 62 +++ Test/link.vk.multiBlocksValid.1.1.geom | 54 +++ Test/link.vk.pcNamingInvalid.0.0.vert | 21 + Test/link.vk.pcNamingInvalid.0.1.vert | 22 + glslang/Include/Types.h | 30 ++ glslang/MachineIndependent/linkValidate.cpp | 90 +++- .../MachineIndependent/localintermediate.h | 13 +- gtests/Link.FromFile.Vk.cpp | 3 + gtests/Link.FromFile.cpp | 6 +- 26 files changed, 2191 insertions(+), 27 deletions(-) create mode 100755 Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out create mode 100755 Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out create mode 100755 Test/baseResults/link.multiBlocksInvalid.0.0.vert.out create mode 100755 Test/baseResults/link.multiBlocksValid.1.0.vert.out create mode 100755 Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out create mode 100755 Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out create mode 100755 Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out create mode 100755 Test/link.multiAnonBlocksInvalid.0.0.vert create mode 100755 Test/link.multiAnonBlocksInvalid.0.1.vert create mode 100755 Test/link.multiAnonBlocksValid.0.0.vert create mode 100755 Test/link.multiAnonBlocksValid.0.1.vert create mode 100755 Test/link.multiBlocksInvalid.0.0.vert create mode 100755 Test/link.multiBlocksInvalid.0.1.vert create mode 100755 Test/link.multiBlocksValid.1.0.vert create mode 100755 Test/link.multiBlocksValid.1.1.vert create mode 100755 Test/link.vk.multiBlocksValid.0.0.vert create mode 100755 Test/link.vk.multiBlocksValid.0.1.vert create mode 100755 Test/link.vk.multiBlocksValid.1.0.geom create mode 100755 Test/link.vk.multiBlocksValid.1.1.geom create mode 100755 Test/link.vk.pcNamingInvalid.0.0.vert create mode 100755 Test/link.vk.pcNamingInvalid.0.1.vert mode change 100644 => 100755 glslang/MachineIndependent/linkValidate.cpp mode change 100644 => 100755 gtests/Link.FromFile.Vk.cpp mode change 100644 => 100755 gtests/Link.FromFile.cpp diff --git a/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out b/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out new file mode 100755 index 0000000000..02ed84ed2c --- /dev/null +++ b/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out @@ -0,0 +1,176 @@ +link.multiAnonBlocksInvalid.0.0.vert +ERROR: 0:22: 'ColorBlock' : nameless block contains a member that already has a name at global scope +ERROR: 0:42: 'v1' : redefinition +ERROR: 0:43: 'uProj' : redefinition +ERROR: 3 compilation errors. No code generated. + + +Shader version: 430 +ERROR: node is still EOpNull! +0:46 Function Definition: main( ( global void) +0:46 Function Parameters: +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'oColor' ( smooth out 4-component vector of float) +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:48 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:48 Constant: +0:48 0 (const uint) +0:48 Function Call: getColor2( ( global 4-component vector of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 v1: direct index for structure ( out 4-component vector of float) +0:49 'anon@2' ( out block{ out 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:49 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:49 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:51 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:51 Constant: +0:51 0 (const uint) +0:51 matrix-times-vector ( temp 4-component vector of float) +0:51 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:51 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:51 Constant: +0:51 0 (const uint) +0:51 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1}) +0:? 'myName' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiAnonBlocksInvalid.0.1.vert +Shader version: 430 +0:? Sequence +0:38 Function Definition: getColor2( ( global 4-component vector of float) +0:38 Function Parameters: +0:40 Sequence +0:40 Branch: Return with expression +0:40 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:40 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:40 Constant: +0:40 0 (const uint) +0:43 Function Definition: getWorld( ( global 4-component vector of float) +0:43 Function Parameters: +0:45 Sequence +0:45 Branch: Return with expression +0:45 matrix-times-vector ( temp 4-component vector of float) +0:45 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:45 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:45 Constant: +0:45 1 (const uint) +0:45 'P' ( in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 v2: direct index for structure ( out 4-component vector of float) +0:46 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@3' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float a}) +0:? 'anon@4' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Types must match: + anon@0: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus anon@1: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" +ERROR: Linking vertex stage: Types must match: + anon@2: " out block{ out 4-component vector of float v1}" versus " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" +ERROR: Linking vertex stage: Types must match: + anon@1: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}" versus anon@3: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float a}" +ERROR: Linking vertex stage: Matched Uniform or Storage blocks must all be anonymous, or all be named: + myName: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" versus anon@4: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" + +Shader version: 430 +ERROR: node is still EOpNull! +0:46 Function Definition: main( ( global void) +0:46 Function Parameters: +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'oColor' ( smooth out 4-component vector of float) +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:48 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:48 Constant: +0:48 0 (const uint) +0:48 Function Call: getColor2( ( global 4-component vector of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 v1: direct index for structure ( out 4-component vector of float) +0:49 'anon@2' ( out block{ out 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:49 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:49 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:51 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:51 Constant: +0:51 0 (const uint) +0:51 matrix-times-vector ( temp 4-component vector of float) +0:51 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:51 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:51 Constant: +0:51 0 (const uint) +0:51 Function Call: getWorld( ( global 4-component vector of float) +0:38 Function Definition: getColor2( ( global 4-component vector of float) +0:38 Function Parameters: +0:40 Sequence +0:40 Branch: Return with expression +0:40 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:40 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:40 Constant: +0:40 0 (const uint) +0:43 Function Definition: getWorld( ( global 4-component vector of float) +0:43 Function Parameters: +0:45 Sequence +0:45 Branch: Return with expression +0:45 matrix-times-vector ( temp 4-component vector of float) +0:45 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:45 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:45 Constant: +0:45 1 (const uint) +0:45 'P' ( in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 v2: direct index for structure ( out 4-component vector of float) +0:46 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1}) +0:? 'myName' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'P' ( in 4-component vector of float) + diff --git a/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out b/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out new file mode 100755 index 0000000000..87c31b1eb1 --- /dev/null +++ b/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out @@ -0,0 +1,157 @@ +link.multiAnonBlocksValid.0.0.vert +Shader version: 430 +0:? Sequence +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'oColor' ( smooth out 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:34 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:34 Constant: +0:34 0 (const uint) +0:34 Function Call: getColor2( ( global 4-component vector of float) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 v1: direct index for structure ( out 4-component vector of float) +0:35 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:35 Constant: +0:35 0 (const uint) +0:35 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:35 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:35 Constant: +0:35 0 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:37 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:37 Constant: +0:37 0 (const uint) +0:37 matrix-times-vector ( temp 4-component vector of float) +0:37 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:37 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:37 Constant: +0:37 0 (const uint) +0:37 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiAnonBlocksValid.0.1.vert +Shader version: 430 +0:? Sequence +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const uint) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const uint) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +0:? Sequence +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'oColor' ( smooth out 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:34 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:34 Constant: +0:34 0 (const uint) +0:34 Function Call: getColor2( ( global 4-component vector of float) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 v1: direct index for structure ( out 4-component vector of float) +0:35 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:35 Constant: +0:35 0 (const uint) +0:35 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:35 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:35 Constant: +0:35 0 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:37 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:37 Constant: +0:37 0 (const uint) +0:37 matrix-times-vector ( temp 4-component vector of float) +0:37 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:37 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:37 Constant: +0:37 0 (const uint) +0:37 Function Call: getWorld( ( global 4-component vector of float) +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const uint) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const uint) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out new file mode 100755 index 0000000000..9ce6f18fb9 --- /dev/null +++ b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out @@ -0,0 +1,163 @@ +link.multiBlocksInvalid.0.0.vert +Shader version: 430 +0:? Sequence +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'oColor' ( smooth out 4-component vector of float) +0:29 component-wise multiply ( temp 4-component vector of float) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:29 Constant: +0:29 0 (const int) +0:29 Function Call: getColor2( ( global 4-component vector of float) +0:30 move second child to first child ( temp 4-component vector of float) +0:30 v1: direct index for structure ( out 4-component vector of float) +0:30 'oV' ( out block{ out 4-component vector of float v1}) +0:30 Constant: +0:30 0 (const int) +0:30 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:30 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:30 Constant: +0:30 0 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:32 Constant: +0:32 0 (const uint) +0:32 matrix-times-vector ( temp 4-component vector of float) +0:32 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:32 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:32 Constant: +0:32 0 (const int) +0:32 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'oV' ( out block{ out 4-component vector of float v1}) +0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiBlocksInvalid.0.1.vert +Shader version: 430 +0:? Sequence +0:21 Function Definition: getColor2( ( global 4-component vector of float) +0:21 Function Parameters: +0:23 Sequence +0:23 Branch: Return with expression +0:23 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:23 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:23 Constant: +0:23 0 (const int) +0:26 Function Definition: getWorld( ( global 4-component vector of float) +0:26 Function Parameters: +0:28 Sequence +0:28 Branch: Return with expression +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 uWorld: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:28 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:28 Constant: +0:28 0 (const int) +0:28 'P' ( in 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v2: direct index for structure ( out 4-component vector of float) +0:29 'oVert' ( out block{ out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:? Linker Objects +0:? 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:? 'oVert' ( out block{ out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Types must match: + uC: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" +ERROR: Linking vertex stage: Types must match: + uD: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus uDefaultB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}" +ERROR: Linking vertex stage: Types must match: + oV: " out block{ out 4-component vector of float v1}" versus oVert: " out block{ out 4-component vector of float v2}" + +Shader version: 430 +0:? Sequence +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'oColor' ( smooth out 4-component vector of float) +0:29 component-wise multiply ( temp 4-component vector of float) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:29 Constant: +0:29 0 (const int) +0:29 Function Call: getColor2( ( global 4-component vector of float) +0:30 move second child to first child ( temp 4-component vector of float) +0:30 v1: direct index for structure ( out 4-component vector of float) +0:30 'oV' ( out block{ out 4-component vector of float v1}) +0:30 Constant: +0:30 0 (const int) +0:30 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:30 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:30 Constant: +0:30 0 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:32 Constant: +0:32 0 (const uint) +0:32 matrix-times-vector ( temp 4-component vector of float) +0:32 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:32 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:32 Constant: +0:32 0 (const int) +0:32 Function Call: getWorld( ( global 4-component vector of float) +0:21 Function Definition: getColor2( ( global 4-component vector of float) +0:21 Function Parameters: +0:23 Sequence +0:23 Branch: Return with expression +0:23 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:23 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:23 Constant: +0:23 0 (const int) +0:26 Function Definition: getWorld( ( global 4-component vector of float) +0:26 Function Parameters: +0:28 Sequence +0:28 Branch: Return with expression +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 uWorld: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:28 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:28 Constant: +0:28 0 (const int) +0:28 'P' ( in 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v2: direct index for structure ( out 4-component vector of float) +0:29 'oVert' ( out block{ out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:? Linker Objects +0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'oV' ( out block{ out 4-component vector of float v1}) +0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/Test/baseResults/link.multiBlocksValid.1.0.vert.out b/Test/baseResults/link.multiBlocksValid.1.0.vert.out new file mode 100755 index 0000000000..7f1ee5bf54 --- /dev/null +++ b/Test/baseResults/link.multiBlocksValid.1.0.vert.out @@ -0,0 +1,157 @@ +link.multiBlocksValid.1.0.vert +Shader version: 430 +0:? Sequence +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'oColor' ( smooth out 4-component vector of float) +0:28 component-wise multiply ( temp 4-component vector of float) +0:28 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:28 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:28 Constant: +0:28 0 (const int) +0:28 Function Call: getColor2( ( global 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v1: direct index for structure ( out 4-component vector of float) +0:29 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:29 Constant: +0:29 0 (const int) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:31 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:31 Constant: +0:31 0 (const uint) +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:31 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 0 (const int) +0:31 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiBlocksValid.1.1.vert +Shader version: 430 +0:? Sequence +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const int) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +0:? Sequence +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'oColor' ( smooth out 4-component vector of float) +0:28 component-wise multiply ( temp 4-component vector of float) +0:28 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:28 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:28 Constant: +0:28 0 (const int) +0:28 Function Call: getColor2( ( global 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v1: direct index for structure ( out 4-component vector of float) +0:29 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:29 Constant: +0:29 0 (const int) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:31 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:31 Constant: +0:31 0 (const uint) +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:31 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 0 (const int) +0:31 Function Call: getWorld( ( global 4-component vector of float) +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const int) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out new file mode 100755 index 0000000000..9fd7f9e6c3 --- /dev/null +++ b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out @@ -0,0 +1,313 @@ +link.vk.multiBlocksValid.0.0.vert +Shader version: 430 +0:? Sequence +0:45 Function Definition: main( ( global void) +0:45 Function Parameters: +0:47 Sequence +0:47 move second child to first child ( temp highp 4-component vector of float) +0:47 'oColor' ( smooth out highp 4-component vector of float) +0:47 component-wise multiply ( temp highp 4-component vector of float) +0:47 component-wise multiply ( temp highp 4-component vector of float) +0:47 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:47 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:47 Constant: +0:47 0 (const int) +0:47 Function Call: getColor2( ( global highp 4-component vector of float) +0:47 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:47 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:47 Constant: +0:47 0 (const int) +0:48 move second child to first child ( temp highp 4-component vector of float) +0:48 v1: direct index for structure ( out highp 4-component vector of float) +0:48 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:48 Constant: +0:48 0 (const int) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:48 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:48 Constant: +0:48 0 (const int) +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:50 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:50 Constant: +0:50 0 (const uint) +0:50 matrix-times-vector ( temp highp 4-component vector of float) +0:50 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:50 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) + +link.vk.multiBlocksValid.0.1.vert +Shader version: 430 +0:? Sequence +0:36 Function Definition: getColor2( ( global highp 4-component vector of float) +0:36 Function Parameters: +0:38 Sequence +0:38 Branch: Return with expression +0:38 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:38 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:38 Constant: +0:38 2 (const int) +0:41 Function Definition: getWorld( ( global highp 4-component vector of float) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 v1: direct index for structure ( out highp 4-component vector of float) +0:43 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:43 Constant: +0:43 0 (const uint) +0:43 Constant: +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:44 Branch: Return with expression +0:44 matrix-times-vector ( temp highp 4-component vector of float) +0:44 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:44 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:44 Constant: +0:44 1 (const int) +0:44 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuffer' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'P' ( in highp 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 430 +0:? Sequence +0:45 Function Definition: main( ( global void) +0:45 Function Parameters: +0:47 Sequence +0:47 move second child to first child ( temp highp 4-component vector of float) +0:47 'oColor' ( smooth out highp 4-component vector of float) +0:47 component-wise multiply ( temp highp 4-component vector of float) +0:47 component-wise multiply ( temp highp 4-component vector of float) +0:47 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:47 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:47 Constant: +0:47 0 (const int) +0:47 Function Call: getColor2( ( global highp 4-component vector of float) +0:47 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:47 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:47 Constant: +0:47 0 (const int) +0:48 move second child to first child ( temp highp 4-component vector of float) +0:48 v1: direct index for structure ( out highp 4-component vector of float) +0:48 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:48 Constant: +0:48 0 (const int) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:48 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:48 Constant: +0:48 0 (const int) +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:50 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:50 Constant: +0:50 0 (const uint) +0:50 matrix-times-vector ( temp highp 4-component vector of float) +0:50 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:50 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getWorld( ( global highp 4-component vector of float) +0:36 Function Definition: getColor2( ( global highp 4-component vector of float) +0:36 Function Parameters: +0:38 Sequence +0:38 Branch: Return with expression +0:38 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:38 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:38 Constant: +0:38 2 (const int) +0:41 Function Definition: getWorld( ( global highp 4-component vector of float) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 v1: direct index for structure ( out highp 4-component vector of float) +0:43 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:43 Constant: +0:43 0 (const uint) +0:43 Constant: +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:44 Branch: Return with expression +0:44 matrix-times-vector ( temp highp 4-component vector of float) +0:44 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:44 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:44 Constant: +0:44 1 (const int) +0:44 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'P' ( in highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 73 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 34 42 65 + Source GLSL 430 + Name 4 "main" + Name 9 "getColor2(" + Name 11 "getWorld(" + Name 14 "oColor" + Name 16 "ColorBlock" + MemberName 16(ColorBlock) 0 "color1" + MemberName 16(ColorBlock) 1 "b" + MemberName 16(ColorBlock) 2 "color2" + MemberName 16(ColorBlock) 3 "color3" + Name 18 "uC" + Name 26 "ColorBlock" + MemberName 26(ColorBlock) 0 "c" + Name 28 "uColorBuf" + Name 32 "Vertex" + MemberName 32(Vertex) 0 "v1" + MemberName 32(Vertex) 1 "v2" + Name 34 "oV" + Name 40 "gl_PerVertex" + MemberName 40(gl_PerVertex) 0 "gl_Position" + MemberName 40(gl_PerVertex) 1 "gl_PointSize" + MemberName 40(gl_PerVertex) 2 "gl_ClipDistance" + Name 42 "" + Name 44 "MatrixBlock" + MemberName 44(MatrixBlock) 0 "uProj" + MemberName 44(MatrixBlock) 1 "uWorld" + Name 46 "uM" + Name 65 "P" + Name 70 "BufferBlock" + MemberName 70(BufferBlock) 0 "p" + Name 72 "uBuf" + MemberDecorate 16(ColorBlock) 0 Offset 0 + MemberDecorate 16(ColorBlock) 1 Offset 16 + MemberDecorate 16(ColorBlock) 2 Offset 32 + MemberDecorate 16(ColorBlock) 3 Offset 48 + Decorate 16(ColorBlock) Block + Decorate 18(uC) DescriptorSet 0 + Decorate 18(uC) Binding 1 + MemberDecorate 26(ColorBlock) 0 Offset 0 + Decorate 26(ColorBlock) BufferBlock + Decorate 28(uColorBuf) DescriptorSet 0 + Decorate 28(uColorBuf) Binding 0 + Decorate 32(Vertex) Block + MemberDecorate 40(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 40(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 40(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 40(gl_PerVertex) Block + MemberDecorate 44(MatrixBlock) 0 ColMajor + MemberDecorate 44(MatrixBlock) 0 Offset 0 + MemberDecorate 44(MatrixBlock) 0 MatrixStride 16 + MemberDecorate 44(MatrixBlock) 1 ColMajor + MemberDecorate 44(MatrixBlock) 1 Offset 64 + MemberDecorate 44(MatrixBlock) 1 MatrixStride 16 + Decorate 44(MatrixBlock) Block + Decorate 46(uM) DescriptorSet 0 + Decorate 46(uM) Binding 0 + MemberDecorate 70(BufferBlock) 0 ColMajor + MemberDecorate 70(BufferBlock) 0 Offset 0 + MemberDecorate 70(BufferBlock) 0 MatrixStride 16 + Decorate 70(BufferBlock) BufferBlock + Decorate 72(uBuf) DescriptorSet 0 + Decorate 72(uBuf) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 13: TypePointer Output 7(fvec4) + 14(oColor): 13(ptr) Variable Output + 15: TypeInt 32 0 + 16(ColorBlock): TypeStruct 7(fvec4) 15(int) 7(fvec4) 7(fvec4) + 17: TypePointer Uniform 16(ColorBlock) + 18(uC): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypePointer Uniform 7(fvec4) + 26(ColorBlock): TypeStruct 7(fvec4) + 27: TypePointer Uniform 26(ColorBlock) + 28(uColorBuf): 27(ptr) Variable Uniform + 32(Vertex): TypeStruct 7(fvec4) 7(fvec4) + 33: TypePointer Output 32(Vertex) + 34(oV): 33(ptr) Variable Output + 38: 15(int) Constant 1 + 39: TypeArray 6(float) 38 +40(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 39 + 41: TypePointer Output 40(gl_PerVertex) + 42: 41(ptr) Variable Output + 43: TypeMatrix 7(fvec4) 4 + 44(MatrixBlock): TypeStruct 43 43 + 45: TypePointer Uniform 44(MatrixBlock) + 46(uM): 45(ptr) Variable Uniform + 47: TypePointer Uniform 43 + 53: 19(int) Constant 2 + 58: 6(float) Constant 1065353216 + 59: 7(fvec4) ConstantComposite 58 58 58 58 + 61: 19(int) Constant 1 + 64: TypePointer Input 7(fvec4) + 65(P): 64(ptr) Variable Input + 70(BufferBlock): TypeStruct 43 + 71: TypePointer Uniform 70(BufferBlock) + 72(uBuf): 71(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 18(uC) 20 + 23: 7(fvec4) Load 22 + 24: 7(fvec4) FunctionCall 9(getColor2() + 25: 7(fvec4) FMul 23 24 + 29: 21(ptr) AccessChain 28(uColorBuf) 20 + 30: 7(fvec4) Load 29 + 31: 7(fvec4) FMul 25 30 + Store 14(oColor) 31 + 35: 21(ptr) AccessChain 18(uC) 20 + 36: 7(fvec4) Load 35 + 37: 13(ptr) AccessChain 34(oV) 20 + Store 37 36 + 48: 47(ptr) AccessChain 46(uM) 20 + 49: 43 Load 48 + 50: 7(fvec4) FunctionCall 11(getWorld() + 51: 7(fvec4) MatrixTimesVector 49 50 + 52: 13(ptr) AccessChain 42 20 + Store 52 51 + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 54: 21(ptr) AccessChain 18(uC) 53 + 55: 7(fvec4) Load 54 + ReturnValue 55 + FunctionEnd + 11(getWorld(): 7(fvec4) Function None 8 + 12: Label + 60: 13(ptr) AccessChain 34(oV) 20 + Store 60 59 + 62: 47(ptr) AccessChain 46(uM) 61 + 63: 43 Load 62 + 66: 7(fvec4) Load 65(P) + 67: 7(fvec4) MatrixTimesVector 63 66 + ReturnValue 67 + FunctionEnd diff --git a/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out b/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out new file mode 100755 index 0000000000..e925a39691 --- /dev/null +++ b/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out @@ -0,0 +1,441 @@ +link.vk.multiBlocksValid.1.0.geom +Shader version: 430 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:50 Sequence +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:50 component-wise multiply ( temp highp 4-component vector of float) +0:50 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:50 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getColor2( ( global highp 4-component vector of float) +0:52 move second child to first child ( temp highp float) +0:52 'globalF' ( global highp float) +0:52 Constant: +0:52 1.000000 +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 move second child to first child ( temp highp 4-component vector of float) +0:56 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:56 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:56 Constant: +0:56 0 (const uint) +0:56 matrix-times-vector ( temp highp 4-component vector of float) +0:56 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:56 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:56 Constant: +0:56 0 (const int) +0:56 Function Call: getWorld(i1; ( global highp 4-component vector of float) +0:56 'i' ( temp highp int) +0:57 move second child to first child ( temp highp 4-component vector of float) +0:57 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:57 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:57 Constant: +0:57 0 (const int) +0:57 add ( temp highp 4-component vector of float) +0:57 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:57 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:57 Constant: +0:57 0 (const int) +0:57 vector-scale ( temp highp 4-component vector of float) +0:57 v2: direct index for structure ( in highp 4-component vector of float) +0:57 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'i' ( temp highp int) +0:57 Constant: +0:57 1 (const int) +0:57 'globalF' ( global highp float) +0:58 EmitVertex ( global void) +0:54 Loop Terminal Expression +0:54 Post-Increment ( temp highp int) +0:54 'i' ( temp highp int) +0:61 EndPrimitive ( global void) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:? 'globalF' ( global highp float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) + +link.vk.multiBlocksValid.1.1.geom +Shader version: 430 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:44 Function Definition: getColor2( ( global highp 4-component vector of float) +0:44 Function Parameters: +0:46 Sequence +0:46 Branch: Return with expression +0:46 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:46 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 2 (const int) +0:49 Function Definition: getWorld(i1; ( global highp 4-component vector of float) +0:49 Function Parameters: +0:49 'i' ( in highp int) +0:51 Sequence +0:51 move second child to first child ( temp highp 4-component vector of float) +0:51 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:51 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 Branch: Return with expression +0:52 matrix-times-vector ( temp highp 4-component vector of float) +0:52 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:52 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:52 Constant: +0:52 1 (const int) +0:52 v1: direct index for structure ( in highp 4-component vector of float) +0:52 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'i' ( in highp int) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuffer' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'P' ( in 3-element array of highp 4-component vector of float) + + +Linked geometry stage: + + +Shader version: 430 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:50 Sequence +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:50 component-wise multiply ( temp highp 4-component vector of float) +0:50 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:50 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getColor2( ( global highp 4-component vector of float) +0:52 move second child to first child ( temp highp float) +0:52 'globalF' ( global highp float) +0:52 Constant: +0:52 1.000000 +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 move second child to first child ( temp highp 4-component vector of float) +0:56 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:56 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 1-element array of float ClipDistance gl_ClipDistance}) +0:56 Constant: +0:56 0 (const uint) +0:56 matrix-times-vector ( temp highp 4-component vector of float) +0:56 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:56 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:56 Constant: +0:56 0 (const int) +0:56 Function Call: getWorld(i1; ( global highp 4-component vector of float) +0:56 'i' ( temp highp int) +0:57 move second child to first child ( temp highp 4-component vector of float) +0:57 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:57 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:57 Constant: +0:57 0 (const int) +0:57 add ( temp highp 4-component vector of float) +0:57 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:57 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:57 Constant: +0:57 0 (const int) +0:57 vector-scale ( temp highp 4-component vector of float) +0:57 v2: direct index for structure ( in highp 4-component vector of float) +0:57 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'i' ( temp highp int) +0:57 Constant: +0:57 1 (const int) +0:57 'globalF' ( global highp float) +0:58 EmitVertex ( global void) +0:54 Loop Terminal Expression +0:54 Post-Increment ( temp highp int) +0:54 'i' ( temp highp int) +0:61 EndPrimitive ( global void) +0:44 Function Definition: getColor2( ( global highp 4-component vector of float) +0:44 Function Parameters: +0:46 Sequence +0:46 Branch: Return with expression +0:46 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:46 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 2 (const int) +0:49 Function Definition: getWorld(i1; ( global highp 4-component vector of float) +0:49 Function Parameters: +0:49 'i' ( in highp int) +0:51 Sequence +0:51 move second child to first child ( temp highp 4-component vector of float) +0:51 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:51 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 Branch: Return with expression +0:52 matrix-times-vector ( temp highp 4-component vector of float) +0:52 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:52 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:52 Constant: +0:52 1 (const int) +0:52 v1: direct index for structure ( in highp 4-component vector of float) +0:52 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'i' ( in highp int) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:? 'globalF' ( global highp float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'P' ( in 3-element array of highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 101 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 18 46 61 68 100 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 430 + Name 4 "main" + Name 9 "getColor2(" + Name 15 "getWorld(i1;" + Name 14 "i" + Name 18 "oColor" + Name 20 "ColorBlock" + MemberName 20(ColorBlock) 0 "color1" + MemberName 20(ColorBlock) 1 "b" + MemberName 20(ColorBlock) 2 "color2" + MemberName 20(ColorBlock) 3 "color3" + Name 22 "uC" + Name 30 "globalF" + Name 32 "i" + Name 44 "gl_PerVertex" + MemberName 44(gl_PerVertex) 0 "gl_Position" + MemberName 44(gl_PerVertex) 1 "gl_PointSize" + MemberName 44(gl_PerVertex) 2 "gl_ClipDistance" + Name 46 "" + Name 48 "MatrixBlock" + MemberName 48(MatrixBlock) 0 "uProj" + MemberName 48(MatrixBlock) 1 "uWorld" + Name 50 "uM" + Name 54 "param" + Name 59 "Vertex" + MemberName 59(Vertex) 0 "val1" + Name 61 "oV" + Name 64 "Vertex" + MemberName 64(Vertex) 0 "v1" + MemberName 64(Vertex) 1 "v2" + Name 68 "iV" + Name 95 "BufferBlock" + MemberName 95(BufferBlock) 0 "p" + Name 97 "uBuf" + Name 100 "P" + MemberDecorate 20(ColorBlock) 0 Offset 0 + MemberDecorate 20(ColorBlock) 1 Offset 16 + MemberDecorate 20(ColorBlock) 2 Offset 32 + MemberDecorate 20(ColorBlock) 3 Offset 48 + Decorate 20(ColorBlock) Block + Decorate 22(uC) DescriptorSet 0 + Decorate 22(uC) Binding 1 + MemberDecorate 44(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 44(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 44(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 44(gl_PerVertex) Block + MemberDecorate 48(MatrixBlock) 0 ColMajor + MemberDecorate 48(MatrixBlock) 0 Offset 0 + MemberDecorate 48(MatrixBlock) 0 MatrixStride 16 + MemberDecorate 48(MatrixBlock) 1 ColMajor + MemberDecorate 48(MatrixBlock) 1 Offset 64 + MemberDecorate 48(MatrixBlock) 1 MatrixStride 16 + Decorate 48(MatrixBlock) Block + Decorate 50(uM) DescriptorSet 0 + Decorate 50(uM) Binding 0 + Decorate 59(Vertex) Block + Decorate 64(Vertex) Block + MemberDecorate 95(BufferBlock) 0 ColMajor + MemberDecorate 95(BufferBlock) 0 Offset 0 + MemberDecorate 95(BufferBlock) 0 MatrixStride 16 + Decorate 95(BufferBlock) BufferBlock + Decorate 97(uBuf) DescriptorSet 0 + Decorate 97(uBuf) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 13: TypeFunction 7(fvec4) 12(ptr) + 17: TypePointer Output 7(fvec4) + 18(oColor): 17(ptr) Variable Output + 19: TypeInt 32 0 + 20(ColorBlock): TypeStruct 7(fvec4) 19(int) 7(fvec4) 7(fvec4) + 21: TypePointer Uniform 20(ColorBlock) + 22(uC): 21(ptr) Variable Uniform + 23: 11(int) Constant 0 + 24: TypePointer Uniform 7(fvec4) + 29: TypePointer Private 6(float) + 30(globalF): 29(ptr) Variable Private + 31: 6(float) Constant 1065353216 + 39: 11(int) Constant 3 + 40: TypeBool + 42: 19(int) Constant 1 + 43: TypeArray 6(float) 42 +44(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 43 + 45: TypePointer Output 44(gl_PerVertex) + 46: 45(ptr) Variable Output + 47: TypeMatrix 7(fvec4) 4 + 48(MatrixBlock): TypeStruct 47 47 + 49: TypePointer Uniform 48(MatrixBlock) + 50(uM): 49(ptr) Variable Uniform + 51: TypePointer Uniform 47 + 59(Vertex): TypeStruct 7(fvec4) + 60: TypePointer Output 59(Vertex) + 61(oV): 60(ptr) Variable Output + 64(Vertex): TypeStruct 7(fvec4) 7(fvec4) + 65: 19(int) Constant 3 + 66: TypeArray 64(Vertex) 65 + 67: TypePointer Input 66 + 68(iV): 67(ptr) Variable Input + 70: 11(int) Constant 1 + 71: TypePointer Input 7(fvec4) + 80: 11(int) Constant 2 + 85: 7(fvec4) ConstantComposite 31 31 31 31 + 95(BufferBlock): TypeStruct 47 + 96: TypePointer Uniform 95(BufferBlock) + 97(uBuf): 96(ptr) Variable Uniform + 98: TypeArray 7(fvec4) 65 + 99: TypePointer Input 98 + 100(P): 99(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 32(i): 12(ptr) Variable Function + 54(param): 12(ptr) Variable Function + 25: 24(ptr) AccessChain 22(uC) 23 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) FunctionCall 9(getColor2() + 28: 7(fvec4) FMul 26 27 + Store 18(oColor) 28 + Store 30(globalF) 31 + Store 32(i) 23 + Branch 33 + 33: Label + LoopMerge 35 36 None + Branch 37 + 37: Label + 38: 11(int) Load 32(i) + 41: 40(bool) SLessThan 38 39 + BranchConditional 41 34 35 + 34: Label + 52: 51(ptr) AccessChain 50(uM) 23 + 53: 47 Load 52 + 55: 11(int) Load 32(i) + Store 54(param) 55 + 56: 7(fvec4) FunctionCall 15(getWorld(i1;) 54(param) + 57: 7(fvec4) MatrixTimesVector 53 56 + 58: 17(ptr) AccessChain 46 23 + Store 58 57 + 62: 24(ptr) AccessChain 22(uC) 23 + 63: 7(fvec4) Load 62 + 69: 11(int) Load 32(i) + 72: 71(ptr) AccessChain 68(iV) 69 70 + 73: 7(fvec4) Load 72 + 74: 6(float) Load 30(globalF) + 75: 7(fvec4) VectorTimesScalar 73 74 + 76: 7(fvec4) FAdd 63 75 + 77: 17(ptr) AccessChain 61(oV) 23 + Store 77 76 + EmitVertex + Branch 36 + 36: Label + 78: 11(int) Load 32(i) + 79: 11(int) IAdd 78 70 + Store 32(i) 79 + Branch 33 + 35: Label + EndPrimitive + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 81: 24(ptr) AccessChain 22(uC) 80 + 82: 7(fvec4) Load 81 + ReturnValue 82 + FunctionEnd +15(getWorld(i1;): 7(fvec4) Function None 13 + 14(i): 12(ptr) FunctionParameter + 16: Label + 86: 17(ptr) AccessChain 61(oV) 23 + Store 86 85 + 87: 51(ptr) AccessChain 50(uM) 70 + 88: 47 Load 87 + 89: 11(int) Load 14(i) + 90: 71(ptr) AccessChain 68(iV) 89 23 + 91: 7(fvec4) Load 90 + 92: 7(fvec4) MatrixTimesVector 88 91 + ReturnValue 92 + FunctionEnd diff --git a/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out b/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out new file mode 100755 index 0000000000..45f6a39797 --- /dev/null +++ b/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out @@ -0,0 +1,111 @@ +link.vk.pcNamingInvalid.0.0.vert +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' ( smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) + +link.vk.pcNamingInvalid.0.1.vert +Shader version: 450 +0:? Sequence +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' ( in highp 4-component vector of float) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Only one push_constant block is allowed per stage + +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' ( smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' ( in highp 4-component vector of float) + +Validation failed +SPIR-V is not generated for failed compile or link diff --git a/Test/link.multiAnonBlocksInvalid.0.0.vert b/Test/link.multiAnonBlocksInvalid.0.0.vert new file mode 100755 index 0000000000..106dd25076 --- /dev/null +++ b/Test/link.multiAnonBlocksInvalid.0.0.vert @@ -0,0 +1,52 @@ +#version 430 + +// Error: Block has different members +layout (std140) uniform Block +{ + mat4 uProj; +}; + +// Error: BufferBlock has different members +buffer BufferBlock +{ + vec4 b; +}; + +// Error: Vertex has different members +out Vertex +{ + vec4 v1; +}; + +// Error: ColorBlock has different members +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; + // Error, redeclare varaible in another anonymous block + vec4 v1; +}; + +// Error: NamedBlock is anonymous in other compilation unit +layout (std140) uniform NamedBlock +{ + mat4 m; +} myName; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +// Error: redeclare varaibles that are in anonymous blocks +out vec4 v1; +uniform mat4 uProj; + +void +main() +{ + oColor = color1 * getColor2(); + v1 = color1; + + gl_Position = uProj * getWorld(); +} diff --git a/Test/link.multiAnonBlocksInvalid.0.1.vert b/Test/link.multiAnonBlocksInvalid.0.1.vert new file mode 100755 index 0000000000..8b4c7f8149 --- /dev/null +++ b/Test/link.multiAnonBlocksInvalid.0.1.vert @@ -0,0 +1,48 @@ +#version 430 + +// Error: ColorBlock has different members +layout (std140) uniform ColorBlock +{ + vec4 color2; +}; + +// Error: Block has different members +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +// Error: Vertex has different members +out Vertex +{ + vec4 v1; + vec4 v2; +}; + +// Error BufferBlock has different members +buffer BufferBlock +{ + vec4 a; +}; + +// Error: NamedBlock is anonymous in other compilation unit +layout (std140) uniform NamedBlock +{ + mat4 m; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return color2; +} + +vec4 getWorld() +{ + return uWorld * P; + v2 = vec4(1); +} + diff --git a/Test/link.multiAnonBlocksValid.0.0.vert b/Test/link.multiAnonBlocksValid.0.0.vert new file mode 100755 index 0000000000..470d81546d --- /dev/null +++ b/Test/link.multiAnonBlocksValid.0.0.vert @@ -0,0 +1,38 @@ +#version 430 + +// Verify that matching by block name is working, not +// instance name, which was at one point failing on this +// test due to E.g anon@1 being different blocks for +// different compilation units + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +out Vertex +{ + vec4 v1; + vec4 v2; +}; + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +}; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = color1 * getColor2(); + v1 = color1; + + gl_Position = uProj * getWorld(); +} diff --git a/Test/link.multiAnonBlocksValid.0.1.vert b/Test/link.multiAnonBlocksValid.0.1.vert new file mode 100755 index 0000000000..e7dccbe438 --- /dev/null +++ b/Test/link.multiAnonBlocksValid.0.1.vert @@ -0,0 +1,34 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +}; + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +out Vertex +{ + vec4 v1; + vec4 v2; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return color2; +} + +vec4 getWorld() +{ + return uWorld * P; + v2 = vec4(1); +} + diff --git a/Test/link.multiBlocksInvalid.0.0.vert b/Test/link.multiBlocksInvalid.0.0.vert new file mode 100755 index 0000000000..63b9971668 --- /dev/null +++ b/Test/link.multiBlocksInvalid.0.0.vert @@ -0,0 +1,33 @@ +#version 430 + +// Verify that blocks with different instance names +// are correctly detected as invalid non-matching blocks +// when they are matched up by block name +layout (std140) uniform Block +{ + mat4 uProj; +} uD; + +out Vertex +{ + vec4 v1; +} oV; + +layout (std140) uniform ColorBlock +{ + vec4 color1; +} uC; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = uC.color1 * getColor2(); + oV.v1 = uC.color1; + + gl_Position = uD.uProj * getWorld(); +} diff --git a/Test/link.multiBlocksInvalid.0.1.vert b/Test/link.multiBlocksInvalid.0.1.vert new file mode 100755 index 0000000000..8b9ccd1514 --- /dev/null +++ b/Test/link.multiBlocksInvalid.0.1.vert @@ -0,0 +1,31 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color2; +} uColorB; + +layout (std140) uniform Block +{ + mat4 uWorld; +} uDefaultB; + +out Vertex +{ + vec4 v2; +} oVert; + + +in vec4 P; + +vec4 getColor2() +{ + return uColorB.color2; +} + +vec4 getWorld() +{ + return uDefaultB.uWorld * P; + oVert.v2 = vec4(1); +} + diff --git a/Test/link.multiBlocksValid.1.0.vert b/Test/link.multiBlocksValid.1.0.vert new file mode 100755 index 0000000000..b21683b7cc --- /dev/null +++ b/Test/link.multiBlocksValid.1.0.vert @@ -0,0 +1,32 @@ +#version 430 +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +} a; + +out Vertex +{ + vec4 v1; + vec4 v2; +} b; + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +} c; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = c.color1 * getColor2(); + b.v1 = c.color1; + + gl_Position = a.uProj * getWorld(); +} diff --git a/Test/link.multiBlocksValid.1.1.vert b/Test/link.multiBlocksValid.1.1.vert new file mode 100755 index 0000000000..d86a0d105c --- /dev/null +++ b/Test/link.multiBlocksValid.1.1.vert @@ -0,0 +1,34 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +} a; + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +} b; + +out Vertex +{ + vec4 v1; + vec4 v2; +} c; + + +in vec4 P; + +vec4 getColor2() +{ + return a.color2; +} + +vec4 getWorld() +{ + return b.uWorld * P; + c.v2 = vec4(1); +} + diff --git a/Test/link.vk.multiBlocksValid.0.0.vert b/Test/link.vk.multiBlocksValid.0.0.vert new file mode 100755 index 0000000000..88941625a0 --- /dev/null +++ b/Test/link.vk.multiBlocksValid.0.0.vert @@ -0,0 +1,51 @@ +#version 430 + +// OK: different instance names is allowed in other unit +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uM; + +// OK: other unit has it as anonymous, but that is allowed +out Vertex +{ + vec4 v1; + vec4 v2; +} oV; + +// OK: different instance names is allowed in other unit +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uC; + +// OK: different instance names is allowed in other unit +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuf; + +// OK: Duplicate block names are allowed between +// different shader interface types +layout (std430, binding = 0) buffer ColorBlock +{ + vec4 c; +} uColorBuf; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = uC.color1 * getColor2() * uColorBuf.c; + oV.v1 = uC.color1; + + gl_Position = uM.uProj * getWorld(); +} diff --git a/Test/link.vk.multiBlocksValid.0.1.vert b/Test/link.vk.multiBlocksValid.0.1.vert new file mode 100755 index 0000000000..526777826d --- /dev/null +++ b/Test/link.vk.multiBlocksValid.0.1.vert @@ -0,0 +1,46 @@ +#version 430 + +// OK: different instance names is allowed in other unit +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uColor; + +// OK: different instance names is allowed in other unit +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuffer; + +// OK: different instance names is allowed in other unit +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uMatrix; + +// OK, it's allowed for input/output interfaces to +// be anonymous is one unit and not in another +out Vertex +{ + vec4 v1; + vec4 v2; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return uColor.color2; +} + +vec4 getWorld() +{ + v1 = vec4(1); + return uMatrix.uWorld * P; +} + diff --git a/Test/link.vk.multiBlocksValid.1.0.geom b/Test/link.vk.multiBlocksValid.1.0.geom new file mode 100755 index 0000000000..9811b08617 --- /dev/null +++ b/Test/link.vk.multiBlocksValid.1.0.geom @@ -0,0 +1,62 @@ +#version 430 + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +// OK: different instance names is allowed +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uM; + +// Verify that in/out blocks with same block name work +in Vertex +{ + vec4 v1; + vec4 v2; +} iV[3]; + +out Vertex +{ + vec4 val1; +} oV; + +// OK: different instance names is allowed +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uC; + +// OK: different instance names is allowed +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuf; + +vec4 getWorld(int i); +vec4 getColor2(); + +out vec4 oColor; + +float globalF; + +void +main() +{ + oColor = uC.color1 * getColor2(); + + globalF = 1.0; + + for (int i = 0; i < 3; i++) + { + gl_Position = uM.uProj * getWorld(i); + oV.val1 = uC.color1 + iV[i].v2 * globalF; + EmitVertex(); + } + + EndPrimitive(); +} diff --git a/Test/link.vk.multiBlocksValid.1.1.geom b/Test/link.vk.multiBlocksValid.1.1.geom new file mode 100755 index 0000000000..f372343a08 --- /dev/null +++ b/Test/link.vk.multiBlocksValid.1.1.geom @@ -0,0 +1,54 @@ +#version 430 + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +// OK: different instance names is allowed +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uColor; + +// OK: different instance names is allowed +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuffer; + +// OK: different instance names is allowed +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uMatrix; + +// OK, it's allowed for input/output interfaces to +// be anonymous is one unit and not in another +out Vertex +{ + vec4 val1; +}; + +in Vertex +{ + vec4 v1; + vec4 v2; +} iVV[]; + + +in vec4 P[3]; + +vec4 getColor2() +{ + return uColor.color2; +} + +vec4 getWorld(int i) +{ + val1 = vec4(1); + return uMatrix.uWorld * iVV[i].v1; +} + diff --git a/Test/link.vk.pcNamingInvalid.0.0.vert b/Test/link.vk.pcNamingInvalid.0.0.vert new file mode 100755 index 0000000000..26a75862f9 --- /dev/null +++ b/Test/link.vk.pcNamingInvalid.0.0.vert @@ -0,0 +1,21 @@ +#version 450 +layout (push_constant) uniform Block +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = a.color1 * getColor2(); + + gl_Position = a.uProj * getWorld(); +} diff --git a/Test/link.vk.pcNamingInvalid.0.1.vert b/Test/link.vk.pcNamingInvalid.0.1.vert new file mode 100755 index 0000000000..47d2314bf1 --- /dev/null +++ b/Test/link.vk.pcNamingInvalid.0.1.vert @@ -0,0 +1,22 @@ +#version 450 + +layout (push_constant) uniform Block2 +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +in vec4 P; + +vec4 getColor2() +{ + return a.color2; +} + +vec4 getWorld() +{ + return a.uWorld * P; +} + diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index 350b0e89dc..c7c4bc0215 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -472,6 +472,18 @@ enum TInterlockOrdering { EioCount, }; +enum TShaderInterface +{ + EsiUniform = 0, + EsiBuffer, + EsiInput, + EsiOutput, + EsiNone, + + EsiLast +}; + + class TQualifier { public: static const int layoutNotSet = -1; @@ -1615,6 +1627,24 @@ class TType { assert(fieldName); return *fieldName; } + TShaderInterface getShaderInterface() const + { + if (basicType != EbtBlock) + return EsiNone; + + switch (qualifier.storage) { + default: + return EsiNone; + case EvqVaryingIn: + return EsiInput; + case EvqVaryingOut: + return EsiOutput; + case EvqUniform: + return EsiUniform; + case EvqBuffer: + return EsiBuffer; + } + } virtual TBasicType getBasicType() const { return basicType; } virtual const TSampler& getSampler() const { return sampler; } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp old mode 100644 new mode 100755 index e933adabd3..45fca59e84 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -303,10 +303,10 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) // Map by global name to unique ID to rationalize the same object having // differing IDs in different trees. - TMap idMap; + TIdMaps idMaps; int maxId; - seedIdMap(idMap, maxId); - remapIds(idMap, maxId + 1, unit); + seedIdMap(idMaps, maxId); + remapIds(idMaps, maxId + 1, unit); mergeBodies(infoSink, globals, unitGlobals); mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects); @@ -315,27 +315,40 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) #endif +static const TString& getNameForIdMap(TIntermSymbol* symbol) +{ + TShaderInterface si = symbol->getType().getShaderInterface(); + if (si == EsiNone) + return symbol->getName(); + else + return symbol->getType().getTypeName(); +} + + + // Traverser that seeds an ID map with all built-ins, and tracks the // maximum ID used. // (It would be nice to put this in a function, but that causes warnings // on having no bodies for the copy-constructor/operator=.) class TBuiltInIdTraverser : public TIntermTraverser { public: - TBuiltInIdTraverser(TMap& idMap) : idMap(idMap), maxId(0) { } + TBuiltInIdTraverser(TIdMaps& idMaps) : idMaps(idMaps), maxId(0) { } // If it's a built in, add it to the map. // Track the max ID. virtual void visitSymbol(TIntermSymbol* symbol) { const TQualifier& qualifier = symbol->getType().getQualifier(); - if (qualifier.builtIn != EbvNone) - idMap[symbol->getName()] = symbol->getId(); + if (qualifier.builtIn != EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } maxId = std::max(maxId, symbol->getId()); } int getMaxId() const { return maxId; } protected: TBuiltInIdTraverser(TBuiltInIdTraverser&); TBuiltInIdTraverser& operator=(TBuiltInIdTraverser&); - TMap& idMap; + TIdMaps& idMaps; int maxId; }; @@ -344,31 +357,33 @@ class TBuiltInIdTraverser : public TIntermTraverser { // on having no bodies for the copy-constructor/operator=.) class TUserIdTraverser : public TIntermTraverser { public: - TUserIdTraverser(TMap& idMap) : idMap(idMap) { } + TUserIdTraverser(TIdMaps& idMaps) : idMaps(idMaps) { } // If its a non-built-in global, add it to the map. virtual void visitSymbol(TIntermSymbol* symbol) { const TQualifier& qualifier = symbol->getType().getQualifier(); - if (qualifier.builtIn == EbvNone) - idMap[symbol->getName()] = symbol->getId(); + if (qualifier.builtIn == EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } } protected: TUserIdTraverser(TUserIdTraverser&); TUserIdTraverser& operator=(TUserIdTraverser&); - TMap& idMap; // over biggest id + TIdMaps& idMaps; // over biggest id }; // Initialize the the ID map with what we know of 'this' AST. -void TIntermediate::seedIdMap(TMap& idMap, int& maxId) +void TIntermediate::seedIdMap(TIdMaps& idMaps, int& maxId) { // all built-ins everywhere need to align on IDs and contribute to the max ID - TBuiltInIdTraverser builtInIdTraverser(idMap); + TBuiltInIdTraverser builtInIdTraverser(idMaps); treeRoot->traverse(&builtInIdTraverser); maxId = builtInIdTraverser.getMaxId(); // user variables in the linker object list need to align on ids - TUserIdTraverser userIdTraverser(idMap); + TUserIdTraverser userIdTraverser(idMaps); findLinkerObjects()->traverse(&userIdTraverser); } @@ -377,7 +392,7 @@ void TIntermediate::seedIdMap(TMap& idMap, int& maxId) // on having no bodies for the copy-constructor/operator=.) class TRemapIdTraverser : public TIntermTraverser { public: - TRemapIdTraverser(const TMap& idMap, int idShift) : idMap(idMap), idShift(idShift) { } + TRemapIdTraverser(const TIdMaps& idMaps, int idShift) : idMaps(idMaps), idShift(idShift) { } // Do the mapping: // - if the same symbol, adopt the 'this' ID // - otherwise, ensure a unique ID by shifting to a new space @@ -386,8 +401,9 @@ class TRemapIdTraverser : public TIntermTraverser { const TQualifier& qualifier = symbol->getType().getQualifier(); bool remapped = false; if (qualifier.isLinkable() || qualifier.builtIn != EbvNone) { - auto it = idMap.find(symbol->getName()); - if (it != idMap.end()) { + TShaderInterface si = symbol->getType().getShaderInterface(); + auto it = idMaps[si].find(getNameForIdMap(symbol)); + if (it != idMaps[si].end()) { symbol->changeId(it->second); remapped = true; } @@ -398,14 +414,14 @@ class TRemapIdTraverser : public TIntermTraverser { protected: TRemapIdTraverser(TRemapIdTraverser&); TRemapIdTraverser& operator=(TRemapIdTraverser&); - const TMap& idMap; + const TIdMaps& idMaps; int idShift; }; -void TIntermediate::remapIds(const TMap& idMap, int idShift, TIntermediate& unit) +void TIntermediate::remapIds(const TIdMaps& idMaps, int idShift, TIntermediate& unit) { // Remap all IDs to either share or be unique, as dictated by the idMap and idShift. - TRemapIdTraverser idTraverser(idMap, idShift); + TRemapIdTraverser idTraverser(idMaps, idShift); unit.getTreeRoot()->traverse(&idTraverser); } @@ -447,7 +463,19 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); assert(symbol && unitSymbol); - if (symbol->getName() == unitSymbol->getName()) { + + bool isSameSymbol = false; + // If they are both blocks in the same shader interface, + // match by the block-name, not the identifier name. + if (symbol->getType().getBasicType() == EbtBlock && unitSymbol->getType().getBasicType() == EbtBlock) { + if (symbol->getType().getShaderInterface() == unitSymbol->getType().getShaderInterface()) { + isSameSymbol = symbol->getType().getTypeName() == unitSymbol->getType().getTypeName(); + } + } + else if (symbol->getName() == unitSymbol->getName()) + isSameSymbol = true; + + if (isSameSymbol) { // filter out copy merge = false; @@ -527,6 +555,16 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } + // Uniform and buffer blocks must either both have an instance name, or + // must both be anonymous. The names don't need to match though. + if (symbol.getQualifier().isUniformOrBuffer() && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()))) { + error(infoSink, "Matched Uniform or Storage blocks must all be anonymous," + " or all be named:"); + writeTypeComparison = true; + } + + // Precision... if (symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { error(infoSink, "Precision qualifiers must match:"); @@ -597,9 +635,13 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy } } - if (writeTypeComparison) - infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" << - unitSymbol.getType().getCompleteString() << "\"\n"; + if (writeTypeComparison) { + infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus "; + if (symbol.getName() != unitSymbol.getName()) + infoSink.info << unitSymbol.getName() << ": "; + + infoSink.info << "\"" << unitSymbol.getType().getCompleteString() << "\"\n"; + } #endif } diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 25b8b78a89..1ff0ece997 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -222,6 +222,15 @@ enum ComputeDerivativeMode { LayoutDerivativeGroupLinear, // derivative_group_linearNV }; +class TIdMaps { +public: + TMap& operator[](int i) { return maps[i]; }; + const TMap& operator[](int i) const { return maps[i]; }; +private: + TMap maps[EsiLast]; +}; + + // // Set of helper functions to help parse and build the tree. // @@ -859,8 +868,8 @@ class TIntermediate { void mergeCallGraphs(TInfoSink&, TIntermediate&); void mergeModes(TInfoSink&, TIntermediate&); void mergeTrees(TInfoSink&, TIntermediate&); - void seedIdMap(TMap& idMap, int& maxId); - void remapIds(const TMap& idMap, int idShift, TIntermediate&); + void seedIdMap(TIdMaps& idMaps, int& maxId); + void remapIds(const TIdMaps& idMaps, int idShift, TIntermediate&); void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects); void mergeImplicitArraySizes(TType&, const TType&); diff --git a/gtests/Link.FromFile.Vk.cpp b/gtests/Link.FromFile.Vk.cpp old mode 100644 new mode 100755 index a032f11c31..66e13abec6 --- a/gtests/Link.FromFile.Vk.cpp +++ b/gtests/Link.FromFile.Vk.cpp @@ -115,6 +115,9 @@ INSTANTIATE_TEST_CASE_P( "link.vk.differentPC.0.2.frag"}, {"link.vk.differentPC.1.0.frag", "link.vk.differentPC.1.1.frag", "link.vk.differentPC.1.2.frag"}, + {"link.vk.pcNamingInvalid.0.0.vert", "link.vk.pcNamingInvalid.0.1.vert"}, + {"link.vk.multiBlocksValid.0.0.vert", "link.vk.multiBlocksValid.0.1.vert"}, + {"link.vk.multiBlocksValid.1.0.geom", "link.vk.multiBlocksValid.1.1.geom"}, })) ); // clang-format on diff --git a/gtests/Link.FromFile.cpp b/gtests/Link.FromFile.cpp old mode 100644 new mode 100755 index abc33a910b..dc9bb765cc --- a/gtests/Link.FromFile.cpp +++ b/gtests/Link.FromFile.cpp @@ -100,7 +100,11 @@ INSTANTIATE_TEST_CASE_P( {"150.tesc", "150.tese", "400.tesc", "400.tese", "410.tesc", "420.tesc", "420.tese"}, {"max_vertices_0.geom"}, {"es-link1.frag", "es-link2.frag"}, - {"missingBodies.vert"} + {"missingBodies.vert"}, + {"link.multiAnonBlocksInvalid.0.0.vert", "link.multiAnonBlocksInvalid.0.1.vert"}, + {"link.multiAnonBlocksValid.0.0.vert", "link.multiAnonBlocksValid.0.1.vert"}, + {"link.multiBlocksInvalid.0.0.vert", "link.multiBlocksInvalid.0.1.vert"}, + {"link.multiBlocksValid.1.0.vert", "link.multiBlocksValid.1.1.vert"}, })) ); // clang-format on From 35df1f7ba5be74b8a1f95d42eb92d7aa85110141 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Thu, 26 Mar 2020 12:19:41 -0400 Subject: [PATCH 2/5] add warning if instance names differ between matched shader interfaces --- .../link.multiAnonBlocksInvalid.0.0.vert.out | 1 + Test/baseResults/link.multiBlocksInvalid.0.0.vert.out | 3 +++ Test/baseResults/link.multiBlocksValid.1.0.vert.out | 6 ++++++ Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out | 8 ++++++++ Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out | 10 ++++++++++ glslang/MachineIndependent/linkValidate.cpp | 5 +++++ 6 files changed, 33 insertions(+) diff --git a/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out b/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out index 02ed84ed2c..b8ba789127 100755 --- a/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out +++ b/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out @@ -99,6 +99,7 @@ ERROR: Linking vertex stage: Types must match: ERROR: Linking vertex stage: Types must match: anon@1: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}" versus anon@3: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float a}" ERROR: Linking vertex stage: Matched Uniform or Storage blocks must all be anonymous, or all be named: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. myName: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" versus anon@4: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" Shader version: 430 diff --git a/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out index 9ce6f18fb9..d502f2b483 100755 --- a/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out +++ b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out @@ -84,10 +84,13 @@ Shader version: 430 Linked vertex stage: ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. uC: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. uD: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus uDefaultB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}" ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. oV: " out block{ out 4-component vector of float v1}" versus oVert: " out block{ out 4-component vector of float v2}" Shader version: 430 diff --git a/Test/baseResults/link.multiBlocksValid.1.0.vert.out b/Test/baseResults/link.multiBlocksValid.1.0.vert.out index 7f1ee5bf54..2f32abd255 100755 --- a/Test/baseResults/link.multiBlocksValid.1.0.vert.out +++ b/Test/baseResults/link.multiBlocksValid.1.0.vert.out @@ -83,6 +83,12 @@ Shader version: 430 Linked vertex stage: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + c: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}" versus a: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + a: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" versus b: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + b: " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" versus c: " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" Shader version: 430 0:? Sequence diff --git a/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out index 9fd7f9e6c3..44e2ccc1bb 100755 --- a/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out +++ b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out @@ -87,6 +87,14 @@ Shader version: 430 Linked vertex stage: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uC: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" versus uColor: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uBuf: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" versus uBuffer: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uM: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" versus uMatrix: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + oV: " out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}" versus anon@0: " out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}" Shader version: 430 0:? Sequence diff --git a/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out b/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out index e925a39691..413da7e9ec 100755 --- a/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out +++ b/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out @@ -131,6 +131,16 @@ output primitive = triangle_strip Linked geometry stage: +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uC: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" versus uColor: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uBuf: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" versus uBuffer: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uM: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" versus uMatrix: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + oV: "layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}" versus anon@0: "layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + iV: " in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}" versus iVV: " in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}" Shader version: 430 invocations = 1 diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 45fca59e84..db4c6c3a84 100755 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -564,6 +564,11 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } + if ((IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || + (!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) { + warn(infoSink, "Matched shader interfaces are using different instance names."); + writeTypeComparison = true; + } // Precision... if (symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { From 9e63ecac5a34835565c1247723fccbf6e0d01457 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Thu, 26 Mar 2020 12:36:52 -0400 Subject: [PATCH 3/5] Add test cases from #2137 which is now fixed as well. --- .../link.vk.pcNamingValid.0.0.vert.out | 206 ++++++++++++++++++ Test/link.vk.pcNamingValid.0.0.vert | 21 ++ Test/link.vk.pcNamingValid.0.1.vert | 22 ++ gtests/Link.FromFile.Vk.cpp | 1 + 4 files changed, 250 insertions(+) create mode 100755 Test/baseResults/link.vk.pcNamingValid.0.0.vert.out create mode 100755 Test/link.vk.pcNamingValid.0.0.vert create mode 100755 Test/link.vk.pcNamingValid.0.1.vert diff --git a/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out b/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out new file mode 100755 index 0000000000..c9dba15356 --- /dev/null +++ b/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out @@ -0,0 +1,206 @@ +link.vk.pcNamingValid.0.0.vert +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) + +link.vk.pcNamingValid.0.1.vert +Shader version: 450 +0:? Sequence +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' (layout( location=0) in highp 4-component vector of float) +0:? Linker Objects +0:? 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' (layout( location=0) in highp 4-component vector of float) + + +Linked vertex stage: + +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + a: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}" versus b: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}" + +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' (layout( location=0) in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:? 'P' (layout( location=0) in highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 31 48 + Source GLSL 450 + Name 4 "main" + Name 9 "getColor2(" + Name 11 "getWorld(" + Name 14 "oColor" + Name 16 "PCBlock" + MemberName 16(PCBlock) 0 "uWorld" + MemberName 16(PCBlock) 1 "uProj" + MemberName 16(PCBlock) 2 "color1" + MemberName 16(PCBlock) 3 "color2" + Name 18 "a" + Name 29 "gl_PerVertex" + MemberName 29(gl_PerVertex) 0 "gl_Position" + MemberName 29(gl_PerVertex) 1 "gl_PointSize" + MemberName 29(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 29(gl_PerVertex) 3 "gl_CullDistance" + Name 31 "" + Name 48 "P" + Decorate 14(oColor) Location 0 + MemberDecorate 16(PCBlock) 0 ColMajor + MemberDecorate 16(PCBlock) 0 Offset 0 + MemberDecorate 16(PCBlock) 0 MatrixStride 16 + MemberDecorate 16(PCBlock) 1 ColMajor + MemberDecorate 16(PCBlock) 1 Offset 64 + MemberDecorate 16(PCBlock) 1 MatrixStride 16 + MemberDecorate 16(PCBlock) 2 Offset 128 + MemberDecorate 16(PCBlock) 3 Offset 144 + Decorate 16(PCBlock) Block + MemberDecorate 29(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 29(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 29(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 29(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 29(gl_PerVertex) Block + Decorate 48(P) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 13: TypePointer Output 7(fvec4) + 14(oColor): 13(ptr) Variable Output + 15: TypeMatrix 7(fvec4) 4 + 16(PCBlock): TypeStruct 15 15 7(fvec4) 7(fvec4) + 17: TypePointer PushConstant 16(PCBlock) + 18(a): 17(ptr) Variable PushConstant + 19: TypeInt 32 1 + 20: 19(int) Constant 2 + 21: TypePointer PushConstant 7(fvec4) + 26: TypeInt 32 0 + 27: 26(int) Constant 1 + 28: TypeArray 6(float) 27 +29(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 28 28 + 30: TypePointer Output 29(gl_PerVertex) + 31: 30(ptr) Variable Output + 32: 19(int) Constant 0 + 33: 19(int) Constant 1 + 34: TypePointer PushConstant 15 + 40: 19(int) Constant 3 + 47: TypePointer Input 7(fvec4) + 48(P): 47(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 18(a) 20 + 23: 7(fvec4) Load 22 + 24: 7(fvec4) FunctionCall 9(getColor2() + 25: 7(fvec4) FMul 23 24 + Store 14(oColor) 25 + 35: 34(ptr) AccessChain 18(a) 33 + 36: 15 Load 35 + 37: 7(fvec4) FunctionCall 11(getWorld() + 38: 7(fvec4) MatrixTimesVector 36 37 + 39: 13(ptr) AccessChain 31 32 + Store 39 38 + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 41: 21(ptr) AccessChain 18(a) 40 + 42: 7(fvec4) Load 41 + ReturnValue 42 + FunctionEnd + 11(getWorld(): 7(fvec4) Function None 8 + 12: Label + 45: 34(ptr) AccessChain 18(a) 32 + 46: 15 Load 45 + 49: 7(fvec4) Load 48(P) + 50: 7(fvec4) MatrixTimesVector 46 49 + ReturnValue 50 + FunctionEnd diff --git a/Test/link.vk.pcNamingValid.0.0.vert b/Test/link.vk.pcNamingValid.0.0.vert new file mode 100755 index 0000000000..7df21901a8 --- /dev/null +++ b/Test/link.vk.pcNamingValid.0.0.vert @@ -0,0 +1,21 @@ +#version 450 +layout (push_constant) uniform PCBlock +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +vec4 getWorld(); +vec4 getColor2(); + +layout(location = 0) out vec4 oColor; + +void +main() +{ + oColor = a.color1 * getColor2(); + + gl_Position = a.uProj * getWorld(); +} diff --git a/Test/link.vk.pcNamingValid.0.1.vert b/Test/link.vk.pcNamingValid.0.1.vert new file mode 100755 index 0000000000..9a4b41b3fe --- /dev/null +++ b/Test/link.vk.pcNamingValid.0.1.vert @@ -0,0 +1,22 @@ +#version 450 + +layout (push_constant) uniform PCBlock +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} b; + +layout(location = 0) in vec4 P; + +vec4 getColor2() +{ + return b.color2; +} + +vec4 getWorld() +{ + return b.uWorld * P; +} + diff --git a/gtests/Link.FromFile.Vk.cpp b/gtests/Link.FromFile.Vk.cpp index 66e13abec6..a43edcf222 100755 --- a/gtests/Link.FromFile.Vk.cpp +++ b/gtests/Link.FromFile.Vk.cpp @@ -115,6 +115,7 @@ INSTANTIATE_TEST_CASE_P( "link.vk.differentPC.0.2.frag"}, {"link.vk.differentPC.1.0.frag", "link.vk.differentPC.1.1.frag", "link.vk.differentPC.1.2.frag"}, + {"link.vk.pcNamingValid.0.0.vert", "link.vk.pcNamingValid.0.1.vert"}, {"link.vk.pcNamingInvalid.0.0.vert", "link.vk.pcNamingInvalid.0.1.vert"}, {"link.vk.multiBlocksValid.0.0.vert", "link.vk.multiBlocksValid.0.1.vert"}, {"link.vk.multiBlocksValid.1.0.geom", "link.vk.multiBlocksValid.1.1.geom"}, From b73a15cde1168014c903423080826c0718ede909 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Mon, 30 Mar 2020 17:34:50 -0400 Subject: [PATCH 4/5] replace some tab characters with spaces --- glslang/Include/Types.h | 6 +++--- glslang/MachineIndependent/linkValidate.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index 9c3bc1726e..506b42fe9c 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -1638,14 +1638,14 @@ class TType { return EsiNone; case EvqVaryingIn: return EsiInput; - case EvqVaryingOut: + case EvqVaryingOut: return EsiOutput; case EvqUniform: return EsiUniform; case EvqBuffer: return EsiBuffer; - } - } + } + } virtual TBasicType getBasicType() const { return basicType; } virtual const TSampler& getSampler() const { return sampler; } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index db4c6c3a84..7c0ce935cb 100755 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -340,8 +340,8 @@ class TBuiltInIdTraverser : public TIntermTraverser { const TQualifier& qualifier = symbol->getType().getQualifier(); if (qualifier.builtIn != EbvNone) { TShaderInterface si = symbol->getType().getShaderInterface(); - idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); - } + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } maxId = std::max(maxId, symbol->getId()); } int getMaxId() const { return maxId; } @@ -364,8 +364,8 @@ class TUserIdTraverser : public TIntermTraverser { const TQualifier& qualifier = symbol->getType().getQualifier(); if (qualifier.builtIn == EbvNone) { TShaderInterface si = symbol->getType().getShaderInterface(); - idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); - } + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } } protected: @@ -566,8 +566,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy if ((IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || (!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) { - warn(infoSink, "Matched shader interfaces are using different instance names."); - writeTypeComparison = true; + warn(infoSink, "Matched shader interfaces are using different instance names."); + writeTypeComparison = true; } // Precision... From f6dcc99eab5092d76a11f4a040fa9f68c6b9293c Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Wed, 1 Apr 2020 13:44:23 -0400 Subject: [PATCH 5/5] buffer blocks and uniform blocks now share the same block namespace --- .../link.multiBlocksInvalid.0.0.vert.out | 140 +++++++++-------- .../link.vk.multiBlocksValid.0.0.vert.out | 148 +++++++++--------- Test/link.multiBlocksInvalid.0.0.vert | 9 +- Test/link.vk.multiBlocksValid.0.0.vert | 4 +- glslang/Include/Types.h | 7 +- glslang/MachineIndependent/linkValidate.cpp | 3 +- .../MachineIndependent/localintermediate.h | 2 +- 7 files changed, 167 insertions(+), 146 deletions(-) diff --git a/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out index d502f2b483..12b5c43262 100755 --- a/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out +++ b/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out @@ -1,41 +1,47 @@ link.multiBlocksInvalid.0.0.vert Shader version: 430 0:? Sequence -0:27 Function Definition: main( ( global void) -0:27 Function Parameters: -0:29 Sequence -0:29 move second child to first child ( temp 4-component vector of float) -0:29 'oColor' ( smooth out 4-component vector of float) -0:29 component-wise multiply ( temp 4-component vector of float) -0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) -0:29 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) -0:29 Constant: -0:29 0 (const int) -0:29 Function Call: getColor2( ( global 4-component vector of float) -0:30 move second child to first child ( temp 4-component vector of float) -0:30 v1: direct index for structure ( out 4-component vector of float) -0:30 'oV' ( out block{ out 4-component vector of float v1}) -0:30 Constant: -0:30 0 (const int) -0:30 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) -0:30 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) -0:30 Constant: -0:30 0 (const int) -0:32 move second child to first child ( temp 4-component vector of float) -0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) -0:32 Constant: -0:32 0 (const uint) -0:32 matrix-times-vector ( temp 4-component vector of float) -0:32 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) -0:32 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) -0:32 Constant: -0:32 0 (const int) -0:32 Function Call: getWorld( ( global 4-component vector of float) +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'oColor' ( smooth out 4-component vector of float) +0:36 component-wise multiply ( temp 4-component vector of float) +0:36 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:36 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:36 Constant: +0:36 0 (const int) +0:36 Function Call: getColor2( ( global 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 v1: direct index for structure ( out 4-component vector of float) +0:37 'oV' ( out block{ out 4-component vector of float v1}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:37 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:37 color1: direct index for structure (layout( column_major std430 offset=0) buffer 4-component vector of float) +0:37 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:39 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:39 Constant: +0:39 0 (const uint) +0:39 matrix-times-vector ( temp 4-component vector of float) +0:39 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:39 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:39 Constant: +0:39 0 (const int) +0:39 Function Call: getWorld( ( global 4-component vector of float) 0:? Linker Objects 0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) 0:? 'oV' ( out block{ out 4-component vector of float v1}) 0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) 0:? 'oColor' ( smooth out 4-component vector of float) 0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) @@ -87,6 +93,10 @@ ERROR: Linking vertex stage: Types must match: WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. uC: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" ERROR: Linking vertex stage: Types must match: +ERROR: Linking vertex stage: Storage qualifiers must match: +ERROR: Linking vertex stage: Layout qualification must match: + uBufC: "layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" +ERROR: Linking vertex stage: Types must match: WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. uD: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus uDefaultB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}" ERROR: Linking vertex stage: Types must match: @@ -95,37 +105,42 @@ WARNING: Linking vertex stage: Matched shader interfaces are using different ins Shader version: 430 0:? Sequence -0:27 Function Definition: main( ( global void) -0:27 Function Parameters: -0:29 Sequence -0:29 move second child to first child ( temp 4-component vector of float) -0:29 'oColor' ( smooth out 4-component vector of float) -0:29 component-wise multiply ( temp 4-component vector of float) -0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) -0:29 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) -0:29 Constant: -0:29 0 (const int) -0:29 Function Call: getColor2( ( global 4-component vector of float) -0:30 move second child to first child ( temp 4-component vector of float) -0:30 v1: direct index for structure ( out 4-component vector of float) -0:30 'oV' ( out block{ out 4-component vector of float v1}) -0:30 Constant: -0:30 0 (const int) -0:30 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) -0:30 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) -0:30 Constant: -0:30 0 (const int) -0:32 move second child to first child ( temp 4-component vector of float) -0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) -0:32 Constant: -0:32 0 (const uint) -0:32 matrix-times-vector ( temp 4-component vector of float) -0:32 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) -0:32 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) -0:32 Constant: -0:32 0 (const int) -0:32 Function Call: getWorld( ( global 4-component vector of float) +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'oColor' ( smooth out 4-component vector of float) +0:36 component-wise multiply ( temp 4-component vector of float) +0:36 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:36 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:36 Constant: +0:36 0 (const int) +0:36 Function Call: getColor2( ( global 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 v1: direct index for structure ( out 4-component vector of float) +0:37 'oV' ( out block{ out 4-component vector of float v1}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:37 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:37 color1: direct index for structure (layout( column_major std430 offset=0) buffer 4-component vector of float) +0:37 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:39 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:39 Constant: +0:39 0 (const uint) +0:39 matrix-times-vector ( temp 4-component vector of float) +0:39 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:39 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:39 Constant: +0:39 0 (const int) +0:39 Function Call: getWorld( ( global 4-component vector of float) 0:21 Function Definition: getColor2( ( global 4-component vector of float) 0:21 Function Parameters: 0:23 Sequence @@ -158,6 +173,7 @@ Shader version: 430 0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) 0:? 'oV' ( out block{ out 4-component vector of float v1}) 0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) 0:? 'oColor' ( smooth out 4-component vector of float) 0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) diff --git a/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out index 44e2ccc1bb..6440a3b5d7 100755 --- a/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out +++ b/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out @@ -1,42 +1,42 @@ link.vk.multiBlocksValid.0.0.vert Shader version: 430 0:? Sequence -0:45 Function Definition: main( ( global void) -0:45 Function Parameters: -0:47 Sequence -0:47 move second child to first child ( temp highp 4-component vector of float) -0:47 'oColor' ( smooth out highp 4-component vector of float) -0:47 component-wise multiply ( temp highp 4-component vector of float) -0:47 component-wise multiply ( temp highp 4-component vector of float) -0:47 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) -0:47 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) -0:47 Constant: -0:47 0 (const int) -0:47 Function Call: getColor2( ( global highp 4-component vector of float) -0:47 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) -0:47 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) -0:47 Constant: -0:47 0 (const int) +0:43 Function Definition: main( ( global void) +0:43 Function Parameters: +0:45 Sequence +0:45 move second child to first child ( temp highp 4-component vector of float) +0:45 'oColor' ( smooth out highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:45 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:45 Constant: +0:45 0 (const int) +0:45 Function Call: getColor2( ( global highp 4-component vector of float) +0:45 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:45 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 v1: direct index for structure ( out highp 4-component vector of float) +0:46 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:46 Constant: +0:46 0 (const int) +0:46 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:46 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 0 (const int) 0:48 move second child to first child ( temp highp 4-component vector of float) -0:48 v1: direct index for structure ( out highp 4-component vector of float) -0:48 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:48 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:48 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:48 Constant: -0:48 0 (const int) -0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) -0:48 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) -0:48 Constant: -0:48 0 (const int) -0:50 move second child to first child ( temp highp 4-component vector of float) -0:50 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) -0:50 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) -0:50 Constant: -0:50 0 (const uint) -0:50 matrix-times-vector ( temp highp 4-component vector of float) -0:50 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) -0:50 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) -0:50 Constant: -0:50 0 (const int) -0:50 Function Call: getWorld( ( global highp 4-component vector of float) +0:48 0 (const uint) +0:48 matrix-times-vector ( temp highp 4-component vector of float) +0:48 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:48 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:48 Constant: +0:48 0 (const int) +0:48 Function Call: getWorld( ( global highp 4-component vector of float) 0:? Linker Objects 0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) 0:? 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) @@ -98,42 +98,42 @@ WARNING: Linking vertex stage: Matched shader interfaces are using different ins Shader version: 430 0:? Sequence -0:45 Function Definition: main( ( global void) -0:45 Function Parameters: -0:47 Sequence -0:47 move second child to first child ( temp highp 4-component vector of float) -0:47 'oColor' ( smooth out highp 4-component vector of float) -0:47 component-wise multiply ( temp highp 4-component vector of float) -0:47 component-wise multiply ( temp highp 4-component vector of float) -0:47 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) -0:47 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) -0:47 Constant: -0:47 0 (const int) -0:47 Function Call: getColor2( ( global highp 4-component vector of float) -0:47 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) -0:47 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) -0:47 Constant: -0:47 0 (const int) +0:43 Function Definition: main( ( global void) +0:43 Function Parameters: +0:45 Sequence +0:45 move second child to first child ( temp highp 4-component vector of float) +0:45 'oColor' ( smooth out highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:45 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:45 Constant: +0:45 0 (const int) +0:45 Function Call: getColor2( ( global highp 4-component vector of float) +0:45 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:45 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 v1: direct index for structure ( out highp 4-component vector of float) +0:46 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:46 Constant: +0:46 0 (const int) +0:46 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:46 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 0 (const int) 0:48 move second child to first child ( temp highp 4-component vector of float) -0:48 v1: direct index for structure ( out highp 4-component vector of float) -0:48 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) -0:48 Constant: -0:48 0 (const int) -0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) -0:48 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:48 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:48 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) 0:48 Constant: -0:48 0 (const int) -0:50 move second child to first child ( temp highp 4-component vector of float) -0:50 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) -0:50 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:50 Constant: -0:50 0 (const uint) -0:50 matrix-times-vector ( temp highp 4-component vector of float) -0:50 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) -0:50 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) -0:50 Constant: -0:50 0 (const int) -0:50 Function Call: getWorld( ( global highp 4-component vector of float) +0:48 0 (const uint) +0:48 matrix-times-vector ( temp highp 4-component vector of float) +0:48 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:48 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:48 Constant: +0:48 0 (const int) +0:48 Function Call: getWorld( ( global highp 4-component vector of float) 0:36 Function Definition: getColor2( ( global highp 4-component vector of float) 0:36 Function Parameters: 0:38 Sequence @@ -191,8 +191,8 @@ Shader version: 430 MemberName 16(ColorBlock) 2 "color2" MemberName 16(ColorBlock) 3 "color3" Name 18 "uC" - Name 26 "ColorBlock" - MemberName 26(ColorBlock) 0 "c" + Name 26 "SecondaryColorBlock" + MemberName 26(SecondaryColorBlock) 0 "c" Name 28 "uColorBuf" Name 32 "Vertex" MemberName 32(Vertex) 0 "v1" @@ -218,8 +218,8 @@ Shader version: 430 Decorate 16(ColorBlock) Block Decorate 18(uC) DescriptorSet 0 Decorate 18(uC) Binding 1 - MemberDecorate 26(ColorBlock) 0 Offset 0 - Decorate 26(ColorBlock) BufferBlock + MemberDecorate 26(SecondaryColorBlock) 0 Offset 0 + Decorate 26(SecondaryColorBlock) BufferBlock Decorate 28(uColorBuf) DescriptorSet 0 Decorate 28(uColorBuf) Binding 0 Decorate 32(Vertex) Block @@ -256,8 +256,8 @@ Shader version: 430 19: TypeInt 32 1 20: 19(int) Constant 0 21: TypePointer Uniform 7(fvec4) - 26(ColorBlock): TypeStruct 7(fvec4) - 27: TypePointer Uniform 26(ColorBlock) +26(SecondaryColorBlock): TypeStruct 7(fvec4) + 27: TypePointer Uniform 26(SecondaryColorBlock) 28(uColorBuf): 27(ptr) Variable Uniform 32(Vertex): TypeStruct 7(fvec4) 7(fvec4) 33: TypePointer Output 32(Vertex) diff --git a/Test/link.multiBlocksInvalid.0.0.vert b/Test/link.multiBlocksInvalid.0.0.vert index 63b9971668..19bc049860 100755 --- a/Test/link.multiBlocksInvalid.0.0.vert +++ b/Test/link.multiBlocksInvalid.0.0.vert @@ -18,6 +18,13 @@ layout (std140) uniform ColorBlock vec4 color1; } uC; +// Error, buffer blocks and uniform blocks share the +// same namespace for their block name +layout (std430) buffer ColorBlock +{ + vec4 color1; +} uBufC; + vec4 getWorld(); vec4 getColor2(); @@ -27,7 +34,7 @@ void main() { oColor = uC.color1 * getColor2(); - oV.v1 = uC.color1; + oV.v1 = uC.color1 + uBufC.color1; gl_Position = uD.uProj * getWorld(); } diff --git a/Test/link.vk.multiBlocksValid.0.0.vert b/Test/link.vk.multiBlocksValid.0.0.vert index 88941625a0..81747ec4ec 100755 --- a/Test/link.vk.multiBlocksValid.0.0.vert +++ b/Test/link.vk.multiBlocksValid.0.0.vert @@ -29,9 +29,7 @@ layout (std430, binding = 1) buffer BufferBlock mat4 p; } uBuf; -// OK: Duplicate block names are allowed between -// different shader interface types -layout (std430, binding = 0) buffer ColorBlock +layout (std430, binding = 0) buffer SecondaryColorBlock { vec4 c; } uColorBuf; diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index b8efbfa166..b2c416d105 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -475,13 +475,13 @@ enum TInterlockOrdering { enum TShaderInterface { + // Includes both uniform blocks and buffer blocks EsiUniform = 0, - EsiBuffer, EsiInput, EsiOutput, EsiNone, - EsiLast + EsiCount }; @@ -1641,9 +1641,8 @@ class TType { case EvqVaryingOut: return EsiOutput; case EvqUniform: - return EsiUniform; case EvqBuffer: - return EsiBuffer; + return EsiUniform; } } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 7c0ce935cb..dcb1cc8cba 100755 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -564,7 +564,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } - if ((IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || + if (symbol.getQualifier().storage == unitSymbol.getQualifier().storage && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || (!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) { warn(infoSink, "Matched shader interfaces are using different instance names."); writeTypeComparison = true; diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 0caceb87dc..62cf5d672b 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -230,7 +230,7 @@ class TIdMaps { TMap& operator[](int i) { return maps[i]; }; const TMap& operator[](int i) const { return maps[i]; }; private: - TMap maps[EsiLast]; + TMap maps[EsiCount]; };