From 2c5ab9c8fce6014328e580da2918e5eb8206011a Mon Sep 17 00:00:00 2001 From: steve-lunarg Date: Fri, 3 Feb 2017 13:37:54 -0700 Subject: [PATCH] HLSL: remove pervertex output blocks This removes pervertex output blocks, in favor of using only loose variables. The pervertex blocks are not required and were only partly implemented, and were adding some complication. This change goes with wrap-entry-point. --- .../hlsl.gather.basic.dx10.vert.out | 14 +---- .../hlsl.getdimensions.dx10.vert.out | 14 +---- .../baseResults/hlsl.load.basic.dx10.vert.out | 14 +---- .../hlsl.samplegrad.basic.dx10.vert.out | 14 +---- .../hlsl.samplelevel.basic.dx10.vert.out | 14 +---- Test/baseResults/hlsl.struct.split-1.vert.out | 14 +---- .../hlsl.struct.split.call.vert.out | 14 +---- .../hlsl.struct.split.nested.geom.out | 15 +---- .../hlsl.struct.split.trivial.geom.out | 15 +---- .../hlsl.struct.split.trivial.vert.out | 14 +---- hlsl/hlslParseHelper.cpp | 60 ------------------- 11 files changed, 20 insertions(+), 182 deletions(-) diff --git a/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/Test/baseResults/hlsl.gather.basic.dx10.vert.out index 343925ad..b6426ee8 100644 --- a/Test/baseResults/hlsl.gather.basic.dx10.vert.out +++ b/Test/baseResults/hlsl.gather.basic.dx10.vert.out @@ -105,7 +105,6 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -217,17 +216,16 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 129 +// Id's are bound by 126 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 103 128 + EntryPoint Vertex 4 "main" 103 Name 4 "main" Name 8 "VS_OUTPUT" MemberName 8(VS_OUTPUT) 0 "Pos" @@ -255,9 +253,6 @@ Shader version: 450 Name 119 "g_tTex3df4" Name 122 "g_tTex3di4" Name 125 "g_tTex3du4" - Name 126 "PerVertex_out" - MemberName 126(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 128 "PerVertex_out" Decorate 16(g_tTex2df4) DescriptorSet 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 @@ -277,8 +272,6 @@ Shader version: 450 Decorate 119(g_tTex3df4) DescriptorSet 0 Decorate 122(g_tTex3di4) DescriptorSet 0 Decorate 125(g_tTex3du4) DescriptorSet 0 - MemberDecorate 126(PerVertex_out) 0 BuiltIn Position - Decorate 126(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -362,9 +355,6 @@ Shader version: 450 123: TypeImage 45(int) 3D sampled format:Unknown 124: TypePointer UniformConstant 123 125(g_tTex3du4): 124(ptr) Variable UniformConstant -126(PerVertex_out): TypeStruct 7(fvec4) - 127: TypePointer Output 126(PerVertex_out) -128(PerVertex_out): 127(ptr) Variable Output 4(main): 2 Function None 3 5: Label 104:8(VS_OUTPUT) FunctionCall 10(@main() diff --git a/Test/baseResults/hlsl.getdimensions.dx10.vert.out b/Test/baseResults/hlsl.getdimensions.dx10.vert.out index 97671313..f5c7db69 100644 --- a/Test/baseResults/hlsl.getdimensions.dx10.vert.out +++ b/Test/baseResults/hlsl.getdimensions.dx10.vert.out @@ -51,7 +51,6 @@ Shader version: 450 0:? Linker Objects 0:? 'g_sSamp' (layout(binding=0 ) uniform sampler) 0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -109,18 +108,17 @@ Shader version: 450 0:? Linker Objects 0:? 'g_sSamp' (layout(binding=0 ) uniform sampler) 0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 51 +// Id's are bound by 48 Capability Shader Capability Sampled1D Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 42 50 + EntryPoint Vertex 4 "main" 42 Name 4 "main" Name 8 "VS_OUTPUT" MemberName 8(VS_OUTPUT) 0 "Pos" @@ -133,16 +131,11 @@ Shader version: 450 Name 32 "vsout" Name 42 "@entryPointOutput_Pos" Name 47 "g_sSamp" - Name 48 "PerVertex_out" - MemberName 48(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 50 "PerVertex_out" Decorate 17(g_tTex1df4) DescriptorSet 0 Decorate 17(g_tTex1df4) Binding 0 Decorate 42(@entryPointOutput_Pos) BuiltIn Position Decorate 47(g_sSamp) DescriptorSet 0 Decorate 47(g_sSamp) Binding 0 - MemberDecorate 48(PerVertex_out) 0 BuiltIn Position - Decorate 48(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -166,9 +159,6 @@ Shader version: 450 45: TypeSampler 46: TypePointer UniformConstant 45 47(g_sSamp): 46(ptr) Variable UniformConstant -48(PerVertex_out): TypeStruct 7(fvec4) - 49: TypePointer Output 48(PerVertex_out) -50(PerVertex_out): 49(ptr) Variable Output 4(main): 2 Function None 3 5: Label 43:8(VS_OUTPUT) FunctionCall 10(@main() diff --git a/Test/baseResults/hlsl.load.basic.dx10.vert.out b/Test/baseResults/hlsl.load.basic.dx10.vert.out index a06d1e73..55843f13 100644 --- a/Test/baseResults/hlsl.load.basic.dx10.vert.out +++ b/Test/baseResults/hlsl.load.basic.dx10.vert.out @@ -221,7 +221,6 @@ Shader version: 450 0:? 'g_tTexcdi4a' (uniform itextureCubeArray) 0:? 'g_tTexcdu4a' (uniform utextureCubeArray) 0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4}) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -449,18 +448,17 @@ Shader version: 450 0:? 'g_tTexcdi4a' (uniform itextureCubeArray) 0:? 'g_tTexcdu4a' (uniform utextureCubeArray) 0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4}) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 174 +// Id's are bound by 171 Capability Shader Capability Sampled1D Capability SampledCubeArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 129 173 + EntryPoint Vertex 4 "main" 129 Name 4 "main" Name 8 "VS_OUTPUT" MemberName 8(VS_OUTPUT) 0 "Pos" @@ -499,9 +497,6 @@ Shader version: 450 Name 164 "g_tTexcdf4a" Name 167 "g_tTexcdi4a" Name 170 "g_tTexcdu4a" - Name 171 "PerVertex_out" - MemberName 171(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 173 "PerVertex_out" Decorate 14(g_tTex1df4) DescriptorSet 0 Decorate 14(g_tTex1df4) Binding 0 MemberDecorate 20($Global) 0 Offset 0 @@ -537,8 +532,6 @@ Shader version: 450 Decorate 164(g_tTexcdf4a) DescriptorSet 0 Decorate 167(g_tTexcdi4a) DescriptorSet 0 Decorate 170(g_tTexcdu4a) DescriptorSet 0 - MemberDecorate 171(PerVertex_out) 0 BuiltIn Position - Decorate 171(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -637,9 +630,6 @@ Shader version: 450 168: TypeImage 24(int) Cube array sampled format:Unknown 169: TypePointer UniformConstant 168 170(g_tTexcdu4a): 169(ptr) Variable UniformConstant -171(PerVertex_out): TypeStruct 7(fvec4) - 172: TypePointer Output 171(PerVertex_out) -173(PerVertex_out): 172(ptr) Variable Output 4(main): 2 Function None 3 5: Label 130:8(VS_OUTPUT) FunctionCall 10(@main() diff --git a/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out b/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out index 06c202d6..a2a1bfd4 100644 --- a/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out +++ b/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out @@ -242,7 +242,6 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -491,17 +490,16 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 169 +// Id's are bound by 166 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 162 168 + EntryPoint Vertex 4 "main" 162 Name 4 "main" Name 8 "VS_OUTPUT" MemberName 8(VS_OUTPUT) 0 "Pos" @@ -534,9 +532,6 @@ Shader version: 450 Name 153 "vsout" Name 162 "@entryPointOutput_Pos" Name 165 "g_tTex1df4a" - Name 166 "PerVertex_out" - MemberName 166(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 168 "PerVertex_out" Decorate 16(g_tTex1df4) DescriptorSet 0 Decorate 16(g_tTex1df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 @@ -555,8 +550,6 @@ Shader version: 450 Decorate 162(@entryPointOutput_Pos) BuiltIn Position Decorate 165(g_tTex1df4a) DescriptorSet 0 Decorate 165(g_tTex1df4a) Binding 1 - MemberDecorate 166(PerVertex_out) 0 BuiltIn Position - Decorate 166(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -650,9 +643,6 @@ Shader version: 450 161: TypePointer Output 7(fvec4) 162(@entryPointOutput_Pos): 161(ptr) Variable Output 165(g_tTex1df4a): 15(ptr) Variable UniformConstant -166(PerVertex_out): TypeStruct 7(fvec4) - 167: TypePointer Output 166(PerVertex_out) -168(PerVertex_out): 167(ptr) Variable Output 4(main): 2 Function None 3 5: Label 163:8(VS_OUTPUT) FunctionCall 10(@main() diff --git a/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out b/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out index dd3bddbc..f0bba5bb 100644 --- a/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out +++ b/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out @@ -188,7 +188,6 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -383,17 +382,16 @@ Shader version: 450 0:? 'g_tTexcdf4' (uniform textureCube) 0:? 'g_tTexcdi4' (uniform itextureCube) 0:? 'g_tTexcdu4' (uniform utextureCube) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 165 +// Id's are bound by 162 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 158 164 + EntryPoint Vertex 4 "main" 158 Name 4 "main" Name 8 "VS_OUTPUT" MemberName 8(VS_OUTPUT) 0 "Pos" @@ -426,9 +424,6 @@ Shader version: 450 Name 149 "vsout" Name 158 "@entryPointOutput_Pos" Name 161 "g_tTex1df4a" - Name 162 "PerVertex_out" - MemberName 162(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 164 "PerVertex_out" Decorate 16(g_tTex1df4) DescriptorSet 0 Decorate 16(g_tTex1df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 @@ -447,8 +442,6 @@ Shader version: 450 Decorate 158(@entryPointOutput_Pos) BuiltIn Position Decorate 161(g_tTex1df4a) DescriptorSet 0 Decorate 161(g_tTex1df4a) Binding 1 - MemberDecorate 162(PerVertex_out) 0 BuiltIn Position - Decorate 162(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -538,9 +531,6 @@ Shader version: 450 157: TypePointer Output 7(fvec4) 158(@entryPointOutput_Pos): 157(ptr) Variable Output 161(g_tTex1df4a): 15(ptr) Variable UniformConstant -162(PerVertex_out): TypeStruct 7(fvec4) - 163: TypePointer Output 162(PerVertex_out) -164(PerVertex_out): 163(ptr) Variable Output 4(main): 2 Function None 3 5: Label 159:8(VS_OUTPUT) FunctionCall 10(@main() diff --git a/Test/baseResults/hlsl.struct.split-1.vert.out b/Test/baseResults/hlsl.struct.split-1.vert.out index f3b2a5ee..2c89ffad 100644 --- a/Test/baseResults/hlsl.struct.split-1.vert.out +++ b/Test/baseResults/hlsl.struct.split-1.vert.out @@ -98,7 +98,6 @@ Shader version: 450 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'x1_in' (layout(location=1 ) in int) 0:? 'Pos_loose' (in 4-component vector of float Position) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos_out}) Linked vertex stage: @@ -203,16 +202,15 @@ Shader version: 450 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'x1_in' (layout(location=1 ) in int) 0:? 'Pos_loose' (in 4-component vector of float Position) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos_out}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 76 +// Id's are bound by 73 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 40 44 47 51 61 67 75 + EntryPoint Vertex 4 "main" 40 44 47 51 61 67 Name 4 "main" Name 9 "VS_INPUT" MemberName 9(VS_INPUT) 0 "x0_in" @@ -240,17 +238,12 @@ Shader version: 450 MemberName 59(VS_OUTPUT) 1 "x1_out" Name 61 "@entryPointOutput" Name 67 "@entryPointOutput_Pos_out" - Name 73 "PerVertex_out" - MemberName 73(PerVertex_out) 0 "@entryPointOutput_Pos_out" - Name 75 "PerVertex_out" Decorate 40(x0_in) Location 0 Decorate 44(Pos_in) BuiltIn Position Decorate 47(x1_in) Location 1 Decorate 51(Pos_loose) BuiltIn Position Decorate 61(@entryPointOutput) Location 0 Decorate 67(@entryPointOutput_Pos_out) BuiltIn Position - MemberDecorate 73(PerVertex_out) 0 BuiltIn Position - Decorate 73(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -278,9 +271,6 @@ Shader version: 450 64: TypePointer Output 6(int) 66: TypePointer Output 8(fvec4) 67(@entryPointOutput_Pos_out): 66(ptr) Variable Output -73(PerVertex_out): TypeStruct 8(fvec4) - 74: TypePointer Output 73(PerVertex_out) -75(PerVertex_out): 74(ptr) Variable Output 4(main): 2 Function None 3 5: Label 38(vsin): 10(ptr) Variable Function diff --git a/Test/baseResults/hlsl.struct.split.call.vert.out b/Test/baseResults/hlsl.struct.split.call.vert.out index 0264fbef..5b13b8ef 100644 --- a/Test/baseResults/hlsl.struct.split.call.vert.out +++ b/Test/baseResults/hlsl.struct.split.call.vert.out @@ -107,7 +107,6 @@ Shader version: 450 0:? 'x0_in' (layout(location=0 ) in int) 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'x1_in' (layout(location=1 ) in int) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos_out}) Linked vertex stage: @@ -221,16 +220,15 @@ Shader version: 450 0:? 'x0_in' (layout(location=0 ) in int) 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'x1_in' (layout(location=1 ) in int) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos_out}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 83 +// Id's are bound by 80 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 52 56 59 68 74 82 + EntryPoint Vertex 4 "main" 52 56 59 68 74 Name 4 "main" Name 9 "VS_INPUT" MemberName 9(VS_INPUT) 0 "x0_in" @@ -259,16 +257,11 @@ Shader version: 450 MemberName 66(VS_OUTPUT) 1 "x1_out" Name 68 "@entryPointOutput" Name 74 "@entryPointOutput_Pos_out" - Name 80 "PerVertex_out" - MemberName 80(PerVertex_out) 0 "@entryPointOutput_Pos_out" - Name 82 "PerVertex_out" Decorate 52(x0_in) Location 0 Decorate 56(Pos_in) BuiltIn Position Decorate 59(x1_in) Location 1 Decorate 68(@entryPointOutput) Location 0 Decorate 74(@entryPointOutput_Pos_out) BuiltIn Position - MemberDecorate 80(PerVertex_out) 0 BuiltIn Position - Decorate 80(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -296,9 +289,6 @@ Shader version: 450 71: TypePointer Output 6(int) 73: TypePointer Output 8(fvec4) 74(@entryPointOutput_Pos_out): 73(ptr) Variable Output -80(PerVertex_out): TypeStruct 8(fvec4) - 81: TypePointer Output 80(PerVertex_out) -82(PerVertex_out): 81(ptr) Variable Output 4(main): 2 Function None 3 5: Label 50(vsin): 10(ptr) Variable Function diff --git a/Test/baseResults/hlsl.struct.split.nested.geom.out b/Test/baseResults/hlsl.struct.split.nested.geom.out index e6a60539..1027aa5a 100644 --- a/Test/baseResults/hlsl.struct.split.nested.geom.out +++ b/Test/baseResults/hlsl.struct.split.nested.geom.out @@ -129,7 +129,6 @@ output primitive = triangle_strip 0:? 'ts' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) 0:? Linker Objects 0:? 'tin' (layout(location=0 ) in 3-element array of structure{temp 2-component vector of float tc}) -0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position tin_pos}) Linked geometry stage: @@ -265,16 +264,15 @@ output primitive = triangle_strip 0:? 'ts' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) 0:? Linker Objects 0:? 'tin' (layout(location=0 ) in 3-element array of structure{temp 2-component vector of float tc}) -0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position tin_pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 80 +// Id's are bound by 76 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 45 53 79 + EntryPoint Geometry 4 "main" 45 53 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -304,13 +302,8 @@ output primitive = triangle_strip Name 71 "ts" Name 72 "param" Name 74 "param" - Name 76 "PerVertex_in" - MemberName 76(PerVertex_in) 0 "tin_pos" - Name 79 "PerVertex_in" Decorate 45(tin_pos) BuiltIn Position Decorate 53(tin) Location 0 - MemberDecorate 76(PerVertex_in) 0 BuiltIn Position - Decorate 76(PerVertex_in) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -351,10 +344,6 @@ output primitive = triangle_strip 53(tin): 52(ptr) Variable Input 54: TypePointer Input 8(fvec2) 64: 17(int) Constant 2 -76(PerVertex_in): TypeStruct 7(fvec4) - 77: TypeArray 76(PerVertex_in) 11 - 78: TypePointer Input 77 -79(PerVertex_in): 78(ptr) Variable Input 4(main): 2 Function None 3 5: Label 42(tin): 13(ptr) Variable Function diff --git a/Test/baseResults/hlsl.struct.split.trivial.geom.out b/Test/baseResults/hlsl.struct.split.trivial.geom.out index b899c6a6..700a1112 100644 --- a/Test/baseResults/hlsl.struct.split.trivial.geom.out +++ b/Test/baseResults/hlsl.struct.split.trivial.geom.out @@ -86,7 +86,6 @@ output primitive = triangle_strip 0:? 'i' (temp 3-element array of structure{temp 4-component vector of float pos}) 0:? 'ts' (temp structure{temp 4-component vector of float pos}) 0:? Linker Objects -0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position i_pos}) Linked geometry stage: @@ -179,16 +178,15 @@ output primitive = triangle_strip 0:? 'i' (temp 3-element array of structure{temp 4-component vector of float pos}) 0:? 'ts' (temp structure{temp 4-component vector of float pos}) 0:? Linker Objects -0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position i_pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 67 +// Id's are bound by 63 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 46 66 + EntryPoint Geometry 4 "main" 46 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -208,12 +206,7 @@ output primitive = triangle_strip Name 58 "ts" Name 59 "param" Name 61 "param" - Name 63 "PerVertex_in" - MemberName 63(PerVertex_in) 0 "i_pos" - Name 66 "PerVertex_in" Decorate 46(i_pos) BuiltIn Position - MemberDecorate 63(PerVertex_in) 0 BuiltIn Position - Decorate 63(PerVertex_in) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -238,10 +231,6 @@ output primitive = triangle_strip 46(i_pos): 45(ptr) Variable Input 47: TypePointer Input 7(fvec4) 54: 20(int) Constant 2 -63(PerVertex_in): TypeStruct 7(fvec4) - 64: TypeArray 63(PerVertex_in) 10 - 65: TypePointer Input 64 -66(PerVertex_in): 65(ptr) Variable Input 4(main): 2 Function None 3 5: Label 43(i): 12(ptr) Variable Function diff --git a/Test/baseResults/hlsl.struct.split.trivial.vert.out b/Test/baseResults/hlsl.struct.split.trivial.vert.out index 427b03e5..ad80d5ca 100644 --- a/Test/baseResults/hlsl.struct.split.trivial.vert.out +++ b/Test/baseResults/hlsl.struct.split.trivial.vert.out @@ -44,7 +44,6 @@ Shader version: 450 0:? Linker Objects 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'Pos_loose' (in 4-component vector of float Position) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) Linked vertex stage: @@ -95,16 +94,15 @@ Shader version: 450 0:? Linker Objects 0:? 'Pos_in' (in 4-component vector of float Position) 0:? 'Pos_loose' (in 4-component vector of float Position) -0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 48 +// Id's are bound by 45 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 31 35 38 47 + EntryPoint Vertex 4 "main" 31 35 38 Name 4 "main" Name 8 "VS_INPUT" MemberName 8(VS_INPUT) 0 "Pos_in" @@ -121,14 +119,9 @@ Shader version: 450 Name 38 "@entryPointOutput_Pos" Name 39 "param" Name 41 "param" - Name 45 "PerVertex_out" - MemberName 45(PerVertex_out) 0 "@entryPointOutput_Pos" - Name 47 "PerVertex_out" Decorate 31(Pos_in) BuiltIn Position Decorate 35(Pos_loose) BuiltIn Position Decorate 38(@entryPointOutput_Pos) BuiltIn Position - MemberDecorate 45(PerVertex_out) 0 BuiltIn Position - Decorate 45(PerVertex_out) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -146,9 +139,6 @@ Shader version: 450 35(Pos_loose): 30(ptr) Variable Input 37: TypePointer Output 7(fvec4) 38(@entryPointOutput_Pos): 37(ptr) Variable Output -45(PerVertex_out): TypeStruct 7(fvec4) - 46: TypePointer Output 45(PerVertex_out) -47(PerVertex_out): 46(ptr) Variable Output 4(main): 2 Function None 3 5: Label 29(vsin): 9(ptr) Variable Function diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 2b00fc79..c6150993 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -1429,72 +1429,12 @@ void HlslParseContext::addInterstageIoToLinkage() // We have to (potentially) track two IO blocks, one in, one out. E.g, a GS may have a // PerVertex block in both directions, possibly with different members. - static const TStorageQualifier ioType[2] = { EvqVaryingIn, EvqVaryingOut }; - static const char* blockName[2] = { "PerVertex_in", "PerVertex_out" }; - - TTypeList* ioBlockTypes[2] = { nullptr, nullptr }; - TArraySizes* ioBlockArray[2] = { nullptr, nullptr }; - for (int idx = 0; idx < int(io.size()); ++idx) { TVariable* var = interstageBuiltInIo[io[idx]]; // Add the loose interstage IO to the linkage if (var->getType().isLooseAndBuiltIn(language)) trackLinkage(*var); - - // Add the PerVertex interstage IO to the IO block - if (var->getType().isPerVertexAndBuiltIn(language)) { - int blockId = 0; - switch (var->getType().getQualifier().storage) { - case EvqVaryingIn: blockId = 0; break; - case EvqVaryingOut: blockId = 1; break; - default: assert(0 && "Invalid storage qualifier"); - } - - // Lazy creation of type list only if we end up needing it. - if (ioBlockTypes[blockId] == nullptr) - ioBlockTypes[blockId] = new TTypeList(); - - TTypeLoc member = { new TType(EbtVoid), loc }; - member.type->shallowCopy(var->getType()); - member.type->setFieldName(var->getName()); - - // We may have collected these from different parts of different structures. If their - // array dimensions are not the same, we don't know what to do, so issue an error. - if (member.type->isArray()) { - if (ioBlockArray[blockId] == nullptr) { - ioBlockArray[blockId] = &member.type->getArraySizes(); - } else { - if (*ioBlockArray[blockId] != member.type->getArraySizes()) - error(loc, "PerVertex block array dimension mismatch", "", ""); - } - member.type->clearArraySizes(); - } - - ioBlockTypes[blockId]->push_back(member); - } - } - - // If there were PerVertex items, add the block to the linkage. Handle in and out separately. - for (int blockId = 0; blockId <= 1; ++blockId) { - if (ioBlockTypes[blockId] != nullptr) { - const TString* instanceName = NewPoolTString(blockName[blockId]); - TQualifier blockQualifier; - - blockQualifier.clear(); - blockQualifier.storage = ioType[blockId]; - - TType blockType(ioBlockTypes[blockId], *instanceName, blockQualifier); - - if (ioBlockArray[blockId] != nullptr) - blockType.newArraySizes(*ioBlockArray[blockId]); - - TVariable* ioBlock = new TVariable(instanceName, blockType); - if (!symbolTable.insert(*ioBlock)) - error(loc, "block instance name redefinition", ioBlock->getName().c_str(), ""); - else - trackLinkage(*ioBlock); - } } }