diff --git a/Test/baseResults/hlsl.basic.geom.out b/Test/baseResults/hlsl.basic.geom.out index 12616d93..4d68b449 100644 --- a/Test/baseResults/hlsl.basic.geom.out +++ b/Test/baseResults/hlsl.basic.geom.out @@ -43,12 +43,12 @@ output primitive = line_strip 0:20 0 (const int) 0:22 Sequence 0:22 move second child to first child ( temp structure{ temp float myfloat, temp int something}) -0:22 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:22 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) 0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) 0:22 EmitVertex ( temp void) 0:23 Sequence 0:23 move second child to first child ( temp structure{ temp float myfloat, temp int something}) -0:23 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:23 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) 0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) 0:23 EmitVertex ( temp void) 0:24 EndPrimitive ( temp void) @@ -68,6 +68,7 @@ output primitive = line_strip 0:? Linker Objects 0:? 'VertexID' (layout( location=0) in 3-element array of uint) 0:? 'test' (layout( location=1) in 3-element array of uint) +0:? 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) Linked geometry stage: @@ -117,12 +118,12 @@ output primitive = line_strip 0:20 0 (const int) 0:22 Sequence 0:22 move second child to first child ( temp structure{ temp float myfloat, temp int something}) -0:22 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:22 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) 0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) 0:22 EmitVertex ( temp void) 0:23 Sequence 0:23 move second child to first child ( temp structure{ temp float myfloat, temp int something}) -0:23 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:23 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) 0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) 0:23 EmitVertex ( temp void) 0:24 EndPrimitive ( temp void) @@ -142,15 +143,16 @@ output primitive = line_strip 0:? Linker Objects 0:? 'VertexID' (layout( location=0) in 3-element array of uint) 0:? 'test' (layout( location=1) in 3-element array of uint) +0:? 'OutputStream' (layout( location=0) out structure{ temp float myfloat, temp int something}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 57 +// Id's are bound by 60 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 45 48 + EntryPoint Geometry 4 "main" 42 47 50 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputLineStrip @@ -164,16 +166,18 @@ output primitive = line_strip Name 16 "test" Name 17 "OutputStream" Name 20 "Vert" - Name 43 "VertexID" + Name 42 "OutputStream" Name 45 "VertexID" - Name 47 "test" - Name 48 "test" - Name 50 "OutputStream" - Name 51 "param" + Name 47 "VertexID" + Name 49 "test" + Name 50 "test" + Name 52 "OutputStream" Name 53 "param" Name 55 "param" - Decorate 45(VertexID) Location 0 - Decorate 48(test) Location 1 + Name 57 "param" + Decorate 42(OutputStream) Location 0 + Decorate 47(VertexID) Location 0 + Decorate 50(test) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -191,26 +195,30 @@ output primitive = line_strip 29: 11(int) Constant 2 34: TypePointer Function 10(float) 39: TypePointer Function 11(int) - 44: TypePointer Input 8 - 45(VertexID): 44(ptr) Variable Input - 48(test): 44(ptr) Variable Input + 41: TypePointer Output 12(PSInput) +42(OutputStream): 41(ptr) Variable Output + 46: TypePointer Input 8 + 47(VertexID): 46(ptr) Variable Input + 50(test): 46(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 43(VertexID): 9(ptr) Variable Function - 47(test): 9(ptr) Variable Function -50(OutputStream): 13(ptr) Variable Function - 51(param): 9(ptr) Variable Function + 45(VertexID): 9(ptr) Variable Function + 49(test): 9(ptr) Variable Function +52(OutputStream): 13(ptr) Variable Function 53(param): 9(ptr) Variable Function - 55(param): 13(ptr) Variable Function - 46: 8 Load 45(VertexID) - Store 43(VertexID) 46 - 49: 8 Load 48(test) - Store 47(test) 49 - 52: 8 Load 43(VertexID) - Store 51(param) 52 - 54: 8 Load 47(test) + 55(param): 9(ptr) Variable Function + 57(param): 13(ptr) Variable Function + 48: 8 Load 47(VertexID) + Store 45(VertexID) 48 + 51: 8 Load 50(test) + Store 49(test) 51 + 54: 8 Load 45(VertexID) Store 53(param) 54 - 56: 2 FunctionCall 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;) 51(param) 53(param) 55(param) + 56: 8 Load 49(test) + Store 55(param) 56 + 58: 2 FunctionCall 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;) 53(param) 55(param) 57(param) + 59: 12(PSInput) Load 57(param) + Store 52(OutputStream) 59 Return FunctionEnd 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;): 2 Function None 14 @@ -235,11 +243,11 @@ output primitive = line_strip 38: 11(int) Bitcast 37 40: 39(ptr) AccessChain 20(Vert) 25 Store 40 38 - 41: 12(PSInput) Load 20(Vert) - Store 17(OutputStream) 41 + 43: 12(PSInput) Load 20(Vert) + Store 42(OutputStream) 43 EmitVertex - 42: 12(PSInput) Load 20(Vert) - Store 17(OutputStream) 42 + 44: 12(PSInput) Load 20(Vert) + Store 42(OutputStream) 44 EmitVertex EndPrimitive Return diff --git a/Test/baseResults/hlsl.semantic.geom.out b/Test/baseResults/hlsl.semantic.geom.out index caed636d..22632008 100755 --- a/Test/baseResults/hlsl.semantic.geom.out +++ b/Test/baseResults/hlsl.semantic.geom.out @@ -25,25 +25,25 @@ output primitive = line_strip 0:? 'VertexID' ( temp 3-element array of uint) 0:? 'OutputStream' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 move second child to first child ( temp float) -0:? '@entryPointOutput_clip0' ( out float ClipDistance) +0:? 'OutputStream_clip0' ( out float ClipDistance) 0:12 clip0: direct index for structure ( temp float) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 0 (const int) 0:12 move second child to first child ( temp float) -0:? '@entryPointOutput_cull0' ( out float CullDistance) +0:? 'OutputStream_cull0' ( out float CullDistance) 0:12 cull0: direct index for structure ( temp float) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 1 (const int) 0:12 move second child to first child ( temp uint) -0:? '@entryPointOutput_vpai' ( out uint ViewportIndex) +0:? 'OutputStream_vpai' ( out uint ViewportIndex) 0:12 vpai: direct index for structure ( temp uint) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 2 (const int) 0:12 move second child to first child ( temp uint) -0:? '@entryPointOutput_rtai' ( out uint Layer) +0:? 'OutputStream_rtai' ( out uint Layer) 0:12 rtai: direct index for structure ( temp uint) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: @@ -60,7 +60,8 @@ output primitive = line_strip 0:? Linker Objects 0:? '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) 0:? 'VertexID' (layout( location=0) in 3-element array of uint) -0:? '@entryPointOutput_vpai' ( out uint ViewportIndex) +0:? 'OutputStream' (layout( location=1) out structure{ temp int ii}) +0:? 'OutputStream_vpai' ( out uint ViewportIndex) Linked geometry stage: @@ -92,25 +93,25 @@ output primitive = line_strip 0:? 'VertexID' ( temp 3-element array of uint) 0:? 'OutputStream' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 move second child to first child ( temp float) -0:? '@entryPointOutput_clip0' ( out float ClipDistance) +0:? 'OutputStream_clip0' ( out float ClipDistance) 0:12 clip0: direct index for structure ( temp float) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 0 (const int) 0:12 move second child to first child ( temp float) -0:? '@entryPointOutput_cull0' ( out float CullDistance) +0:? 'OutputStream_cull0' ( out float CullDistance) 0:12 cull0: direct index for structure ( temp float) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 1 (const int) 0:12 move second child to first child ( temp uint) -0:? '@entryPointOutput_vpai' ( out uint ViewportIndex) +0:? 'OutputStream_vpai' ( out uint ViewportIndex) 0:12 vpai: direct index for structure ( temp uint) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: 0:12 2 (const int) 0:12 move second child to first child ( temp uint) -0:? '@entryPointOutput_rtai' ( out uint Layer) +0:? 'OutputStream_rtai' ( out uint Layer) 0:12 rtai: direct index for structure ( temp uint) 0:12 'flattenTemp' ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:12 Constant: @@ -127,11 +128,12 @@ output primitive = line_strip 0:? Linker Objects 0:? '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) 0:? 'VertexID' (layout( location=0) in 3-element array of uint) -0:? '@entryPointOutput_vpai' ( out uint ViewportIndex) +0:? 'OutputStream' (layout( location=1) out structure{ temp int ii}) +0:? 'OutputStream_vpai' ( out uint ViewportIndex) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 62 +// Id's are bound by 66 Capability Geometry Capability ClipDistance @@ -139,7 +141,7 @@ output primitive = line_strip Capability MultiViewport 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 25 34 39 44 49 55 + EntryPoint Geometry 4 "main" 25 35 40 45 50 56 65 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputLineStrip @@ -161,19 +163,23 @@ output primitive = line_strip Name 28 "OutputStream" Name 29 "param" Name 31 "param" - Name 34 "@entryPointOutput_clip0" - Name 39 "@entryPointOutput_cull0" - Name 44 "@entryPointOutput_vpai" - Name 49 "@entryPointOutput_rtai" - Name 53 "S" - MemberName 53(S) 0 "ii" - Name 55 "@entryPointOutput" + Name 35 "OutputStream_clip0" + Name 40 "OutputStream_cull0" + Name 45 "OutputStream_vpai" + Name 50 "OutputStream_rtai" + Name 54 "S" + MemberName 54(S) 0 "ii" + Name 56 "@entryPointOutput" + Name 63 "S" + MemberName 63(S) 0 "ii" + Name 65 "OutputStream" Decorate 25(VertexID) Location 0 - Decorate 34(@entryPointOutput_clip0) BuiltIn ClipDistance - Decorate 39(@entryPointOutput_cull0) BuiltIn CullDistance - Decorate 44(@entryPointOutput_vpai) BuiltIn ViewportIndex - Decorate 49(@entryPointOutput_rtai) BuiltIn Layer - Decorate 55(@entryPointOutput) Location 0 + Decorate 35(OutputStream_clip0) BuiltIn ClipDistance + Decorate 40(OutputStream_cull0) BuiltIn CullDistance + Decorate 45(OutputStream_vpai) BuiltIn ViewportIndex + Decorate 50(OutputStream_rtai) BuiltIn Layer + Decorate 56(@entryPointOutput) Location 0 + Decorate 65(OutputStream) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -187,24 +193,27 @@ output primitive = line_strip 14: TypeFunction 12(S) 9(ptr) 13(ptr) 24: TypePointer Input 8 25(VertexID): 24(ptr) Variable Input - 33: TypePointer Output 10(float) -34(@entryPointOutput_clip0): 33(ptr) Variable Output - 35: 11(int) Constant 0 - 36: TypePointer Function 10(float) -39(@entryPointOutput_cull0): 33(ptr) Variable Output - 40: 11(int) Constant 1 - 43: TypePointer Output 6(int) -44(@entryPointOutput_vpai): 43(ptr) Variable Output - 45: 11(int) Constant 2 - 46: TypePointer Function 6(int) -49(@entryPointOutput_rtai): 43(ptr) Variable Output - 50: 11(int) Constant 3 - 53(S): TypeStruct 11(int) - 54: TypePointer Output 53(S) -55(@entryPointOutput): 54(ptr) Variable Output - 56: 11(int) Constant 4 - 57: TypePointer Function 11(int) - 60: TypePointer Output 11(int) + 34: TypePointer Output 10(float) +35(OutputStream_clip0): 34(ptr) Variable Output + 36: 11(int) Constant 0 + 37: TypePointer Function 10(float) +40(OutputStream_cull0): 34(ptr) Variable Output + 41: 11(int) Constant 1 + 44: TypePointer Output 6(int) +45(OutputStream_vpai): 44(ptr) Variable Output + 46: 11(int) Constant 2 + 47: TypePointer Function 6(int) +50(OutputStream_rtai): 44(ptr) Variable Output + 51: 11(int) Constant 3 + 54(S): TypeStruct 11(int) + 55: TypePointer Output 54(S) +56(@entryPointOutput): 55(ptr) Variable Output + 57: 11(int) Constant 4 + 58: TypePointer Function 11(int) + 61: TypePointer Output 11(int) + 63(S): TypeStruct 11(int) + 64: TypePointer Output 63(S) +65(OutputStream): 64(ptr) Variable Output 4(main): 2 Function None 3 5: Label 23(VertexID): 9(ptr) Variable Function @@ -217,23 +226,25 @@ output primitive = line_strip 30: 8 Load 23(VertexID) Store 29(param) 30 32: 12(S) FunctionCall 17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;) 29(param) 31(param) + 33: 12(S) Load 31(param) + Store 28(OutputStream) 33 Store 27(flattenTemp) 32 - 37: 36(ptr) AccessChain 27(flattenTemp) 35 - 38: 10(float) Load 37 - Store 34(@entryPointOutput_clip0) 38 - 41: 36(ptr) AccessChain 27(flattenTemp) 40 - 42: 10(float) Load 41 - Store 39(@entryPointOutput_cull0) 42 - 47: 46(ptr) AccessChain 27(flattenTemp) 45 - 48: 6(int) Load 47 - Store 44(@entryPointOutput_vpai) 48 - 51: 46(ptr) AccessChain 27(flattenTemp) 50 - 52: 6(int) Load 51 - Store 49(@entryPointOutput_rtai) 52 - 58: 57(ptr) AccessChain 27(flattenTemp) 56 - 59: 11(int) Load 58 - 61: 60(ptr) AccessChain 55(@entryPointOutput) 35 - Store 61 59 + 38: 37(ptr) AccessChain 27(flattenTemp) 36 + 39: 10(float) Load 38 + Store 35(OutputStream_clip0) 39 + 42: 37(ptr) AccessChain 27(flattenTemp) 41 + 43: 10(float) Load 42 + Store 40(OutputStream_cull0) 43 + 48: 47(ptr) AccessChain 27(flattenTemp) 46 + 49: 6(int) Load 48 + Store 45(OutputStream_vpai) 49 + 52: 47(ptr) AccessChain 27(flattenTemp) 51 + 53: 6(int) Load 52 + Store 50(OutputStream_rtai) 53 + 59: 58(ptr) AccessChain 27(flattenTemp) 57 + 60: 11(int) Load 59 + 62: 61(ptr) AccessChain 56(@entryPointOutput) 36 + Store 62 60 Return FunctionEnd 17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;): 12(S) Function None 14 diff --git a/Test/baseResults/hlsl.struct.split.array.geom.out b/Test/baseResults/hlsl.struct.split.array.geom.out index b907815b..e3b0e497 100644 --- a/Test/baseResults/hlsl.struct.split.array.geom.out +++ b/Test/baseResults/hlsl.struct.split.array.geom.out @@ -72,6 +72,7 @@ output primitive = triangle_strip 0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) 0:? Linker Objects 0:? 'v' (layout( location=0) in 1-element array of uint) +0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) Linked geometry stage: @@ -150,15 +151,16 @@ output primitive = triangle_strip 0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) 0:? Linker Objects 0:? 'v' (layout( location=0) in 1-element array of uint) +0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 73 +// Id's are bound by 77 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 66 + EntryPoint Geometry 4 "main" 66 76 ExecutionMode 4 InputPoints ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -181,7 +183,13 @@ output primitive = triangle_strip Name 68 "OutputStream" Name 69 "param" Name 71 "param" + Name 74 "PSInput" + MemberName 74(PSInput) 0 "TexCoord" + MemberName 74(PSInput) 1 "TerrainPos" + MemberName 74(PSInput) 2 "VertexID" + Name 76 "OutputStream" Decorate 66(v) Location 0 + Decorate 76(OutputStream) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -214,6 +222,9 @@ output primitive = triangle_strip 60: 28(int) Constant 1 65: TypePointer Input 8 66(v): 65(ptr) Variable Input + 74(PSInput): TypeStruct 12(fvec2) 13(fvec3) 6(int) + 75: TypePointer Output 74(PSInput) +76(OutputStream): 75(ptr) Variable Output 4(main): 2 Function None 3 5: Label 64(v): 9(ptr) Variable Function @@ -225,6 +236,8 @@ output primitive = triangle_strip 70: 8 Load 64(v) Store 69(param) 70 72: 2 FunctionCall 19(@main(u1[1];struct-PSInput-vf4-vf2-vf3-u11;) 69(param) 71(param) + 73: 14(PSInput) Load 71(param) + Store 68(OutputStream) 73 Return FunctionEnd 19(@main(u1[1];struct-PSInput-vf4-vf2-vf3-u11;): 2 Function None 16 diff --git a/Test/baseResults/hlsl.struct.split.nested.geom.out b/Test/baseResults/hlsl.struct.split.nested.geom.out index 42046da7..beb97739 100644 --- a/Test/baseResults/hlsl.struct.split.nested.geom.out +++ b/Test/baseResults/hlsl.struct.split.nested.geom.out @@ -35,9 +35,40 @@ output primitive = triangle_strip 0:? 5.000000 0:? 6.000000 0:30 Sequence -0:30 move second child to first child ( 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:30 'ts' ( out 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:30 'o' ( 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:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? 'ts_psIn_pos' ( out 4-component vector of float Position) +0:30 pos: direct index for structure ( temp 4-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:30 'o' ( 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 move second child to first child ( temp 2-component vector of float) +0:30 tc: direct index for structure ( temp 2-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc}) +0:30 'ts' (layout( location=0) out structure{ temp structure{ 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 tc: direct index for structure ( temp 2-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:30 'o' ( 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'ts' (layout( location=0) out structure{ temp structure{ 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:30 Constant: +0:30 1 (const int) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'o' ( 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:30 Constant: +0:30 1 (const int) 0:30 EmitVertex ( temp void) 0:24 Function Definition: main( ( temp void) 0:24 Function Parameters: @@ -129,6 +160,7 @@ 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:? 'ts' (layout( location=0) out structure{ temp structure{ 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}) Linked geometry stage: @@ -170,9 +202,40 @@ output primitive = triangle_strip 0:? 5.000000 0:? 6.000000 0:30 Sequence -0:30 move second child to first child ( 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:30 'ts' ( out 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:30 'o' ( 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:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? 'ts_psIn_pos' ( out 4-component vector of float Position) +0:30 pos: direct index for structure ( temp 4-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:30 'o' ( 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 move second child to first child ( temp 2-component vector of float) +0:30 tc: direct index for structure ( temp 2-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc}) +0:30 'ts' (layout( location=0) out structure{ temp structure{ 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 tc: direct index for structure ( temp 2-component vector of float) +0:30 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:30 'o' ( 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:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'ts' (layout( location=0) out structure{ temp structure{ 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:30 Constant: +0:30 1 (const int) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'o' ( 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:30 Constant: +0:30 1 (const int) 0:30 EmitVertex ( temp void) 0:24 Function Definition: main( ( temp void) 0:24 Function Parameters: @@ -264,15 +327,16 @@ 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:? 'ts' (layout( location=0) out structure{ temp structure{ 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}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 75 +// Id's are bound by 99 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 44 52 + EntryPoint Geometry 4 "main" 41 48 67 75 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -291,16 +355,28 @@ output primitive = triangle_strip Name 21 "tin" Name 22 "ts" Name 25 "o" - Name 41 "tin" - Name 44 "tin_pos" - Name 49 "PS_IN" - MemberName 49(PS_IN) 0 "tc" - Name 52 "tin" - Name 70 "ts" - Name 71 "param" - Name 73 "param" - Decorate 44(tin_pos) BuiltIn Position - Decorate 52(tin) Location 0 + Name 41 "ts_psIn_pos" + Name 44 "PS_IN" + MemberName 44(PS_IN) 0 "tc" + Name 45 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO" + MemberName 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array" + MemberName 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1" + Name 46 "GS_OUT" + MemberName 46(GS_OUT) 0 "psIn" + MemberName 46(GS_OUT) 1 "contains_no_builtin_io" + Name 48 "ts" + Name 64 "tin" + Name 67 "tin_pos" + Name 72 "PS_IN" + MemberName 72(PS_IN) 0 "tc" + Name 75 "tin" + Name 93 "ts" + Name 94 "param" + Name 96 "param" + Decorate 41(ts_psIn_pos) BuiltIn Position + Decorate 48(ts) Location 0 + Decorate 67(tin_pos) BuiltIn Position + Decorate 75(tin) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -330,49 +406,63 @@ output primitive = triangle_strip 36: 6(float) Constant 1086324736 37: 8(fvec2) ConstantComposite 35 36 38: TypePointer Function 8(fvec2) - 42: TypeArray 7(fvec4) 11 - 43: TypePointer Input 42 - 44(tin_pos): 43(ptr) Variable Input - 45: TypePointer Input 7(fvec4) - 49(PS_IN): TypeStruct 8(fvec2) - 50: TypeArray 49(PS_IN) 11 - 51: TypePointer Input 50 - 52(tin): 51(ptr) Variable Input - 53: TypePointer Input 8(fvec2) - 63: 16(int) Constant 2 + 40: TypePointer Output 7(fvec4) + 41(ts_psIn_pos): 40(ptr) Variable Output + 44(PS_IN): TypeStruct 8(fvec2) +45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 15 16(int) + 46(GS_OUT): TypeStruct 44(PS_IN) 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) + 47: TypePointer Output 46(GS_OUT) + 48(ts): 47(ptr) Variable Output + 51: TypePointer Output 8(fvec2) + 53: TypePointer Function 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) + 56: TypePointer Output 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) + 59: TypePointer Output 15 + 62: TypePointer Output 16(int) + 65: TypeArray 7(fvec4) 11 + 66: TypePointer Input 65 + 67(tin_pos): 66(ptr) Variable Input + 68: TypePointer Input 7(fvec4) + 72(PS_IN): TypeStruct 8(fvec2) + 73: TypeArray 72(PS_IN) 11 + 74: TypePointer Input 73 + 75(tin): 74(ptr) Variable Input + 76: TypePointer Input 8(fvec2) + 86: 16(int) Constant 2 4(main): 2 Function None 3 5: Label - 41(tin): 13(ptr) Variable Function - 70(ts): 19(ptr) Variable Function - 71(param): 13(ptr) Variable Function - 73(param): 19(ptr) Variable Function - 46: 45(ptr) AccessChain 44(tin_pos) 26 - 47: 7(fvec4) Load 46 - 48: 32(ptr) AccessChain 41(tin) 26 26 - Store 48 47 - 54: 53(ptr) AccessChain 52(tin) 26 26 - 55: 8(fvec2) Load 54 - 56: 38(ptr) AccessChain 41(tin) 26 34 - Store 56 55 - 57: 45(ptr) AccessChain 44(tin_pos) 34 - 58: 7(fvec4) Load 57 - 59: 32(ptr) AccessChain 41(tin) 34 26 - Store 59 58 - 60: 53(ptr) AccessChain 52(tin) 34 26 - 61: 8(fvec2) Load 60 - 62: 38(ptr) AccessChain 41(tin) 34 34 - Store 62 61 - 64: 45(ptr) AccessChain 44(tin_pos) 63 - 65: 7(fvec4) Load 64 - 66: 32(ptr) AccessChain 41(tin) 63 26 - Store 66 65 - 67: 53(ptr) AccessChain 52(tin) 63 26 - 68: 8(fvec2) Load 67 - 69: 38(ptr) AccessChain 41(tin) 63 34 - Store 69 68 - 72: 12 Load 41(tin) - Store 71(param) 72 - 74: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 71(param) 73(param) + 64(tin): 13(ptr) Variable Function + 93(ts): 19(ptr) Variable Function + 94(param): 13(ptr) Variable Function + 96(param): 19(ptr) Variable Function + 69: 68(ptr) AccessChain 67(tin_pos) 26 + 70: 7(fvec4) Load 69 + 71: 32(ptr) AccessChain 64(tin) 26 26 + Store 71 70 + 77: 76(ptr) AccessChain 75(tin) 26 26 + 78: 8(fvec2) Load 77 + 79: 38(ptr) AccessChain 64(tin) 26 34 + Store 79 78 + 80: 68(ptr) AccessChain 67(tin_pos) 34 + 81: 7(fvec4) Load 80 + 82: 32(ptr) AccessChain 64(tin) 34 26 + Store 82 81 + 83: 76(ptr) AccessChain 75(tin) 34 26 + 84: 8(fvec2) Load 83 + 85: 38(ptr) AccessChain 64(tin) 34 34 + Store 85 84 + 87: 68(ptr) AccessChain 67(tin_pos) 86 + 88: 7(fvec4) Load 87 + 89: 32(ptr) AccessChain 64(tin) 86 26 + Store 89 88 + 90: 76(ptr) AccessChain 75(tin) 86 26 + 91: 8(fvec2) Load 90 + 92: 38(ptr) AccessChain 64(tin) 86 34 + Store 92 91 + 95: 12 Load 64(tin) + Store 94(param) 95 + 97: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 94(param) 96(param) + 98: 18(GS_OUT) Load 96(param) + Store 93(ts) 98 Return FunctionEnd 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;): 2 Function None 20 @@ -384,8 +474,22 @@ output primitive = triangle_strip Store 33 31 39: 38(ptr) AccessChain 25(o) 26 34 Store 39 37 - 40: 18(GS_OUT) Load 25(o) - Store 22(ts) 40 + 42: 32(ptr) AccessChain 25(o) 26 26 + 43: 7(fvec4) Load 42 + Store 41(ts_psIn_pos) 43 + 49: 38(ptr) AccessChain 25(o) 26 34 + 50: 8(fvec2) Load 49 + 52: 51(ptr) AccessChain 48(ts) 26 26 + Store 52 50 + 54: 53(ptr) AccessChain 25(o) 34 + 55:17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 54 + 57: 56(ptr) AccessChain 48(ts) 34 + 58: 15 CompositeExtract 55 0 + 60: 59(ptr) AccessChain 57 26 + Store 60 58 + 61: 16(int) CompositeExtract 55 1 + 63: 62(ptr) AccessChain 57 34 + Store 63 61 EmitVertex Return FunctionEnd diff --git a/Test/baseResults/hlsl.struct.split.trivial.geom.out b/Test/baseResults/hlsl.struct.split.trivial.geom.out index 29818f14..da636b34 100644 --- a/Test/baseResults/hlsl.struct.split.trivial.geom.out +++ b/Test/baseResults/hlsl.struct.split.trivial.geom.out @@ -35,9 +35,13 @@ output primitive = triangle_strip 0:18 Constant: 0:18 0 (const int) 0:19 Sequence -0:19 move second child to first child ( temp structure{ temp 4-component vector of float pos}) -0:19 'ts' ( out structure{ temp 4-component vector of float pos}) -0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'ts_pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Constant: +0:19 0 (const int) 0:19 EmitVertex ( temp void) 0:17 Loop Terminal Expression 0:17 Pre-Increment ( temp int) @@ -87,6 +91,7 @@ output primitive = triangle_strip 0:? 'ts' ( temp structure{ temp 4-component vector of float pos}) 0:? Linker Objects 0:? 'i' (layout( location=0) in 3-element array of structure{}) +0:? 'ts' (layout( location=0) out structure{}) Linked geometry stage: @@ -128,9 +133,13 @@ output primitive = triangle_strip 0:18 Constant: 0:18 0 (const int) 0:19 Sequence -0:19 move second child to first child ( temp structure{ temp 4-component vector of float pos}) -0:19 'ts' ( out structure{ temp 4-component vector of float pos}) -0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'ts_pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Constant: +0:19 0 (const int) 0:19 EmitVertex ( temp void) 0:17 Loop Terminal Expression 0:17 Pre-Increment ( temp int) @@ -180,15 +189,16 @@ output primitive = triangle_strip 0:? 'ts' ( temp structure{ temp 4-component vector of float pos}) 0:? Linker Objects 0:? 'i' (layout( location=0) in 3-element array of structure{}) +0:? 'ts' (layout( location=0) out structure{}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 67 +// Id's are bound by 74 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 46 66 + EntryPoint Geometry 4 "main" 40 49 70 73 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -203,15 +213,20 @@ output primitive = triangle_strip Name 17 "ts" Name 22 "x" Name 33 "o" - Name 43 "i" - Name 46 "i_pos" - Name 58 "ts" - Name 59 "param" - Name 61 "param" - Name 63 "PS_IN" - Name 66 "i" - Decorate 46(i_pos) BuiltIn Position - Decorate 66(i) Location 0 + Name 40 "ts_pos" + Name 46 "i" + Name 49 "i_pos" + Name 61 "ts" + Name 62 "param" + Name 64 "param" + Name 67 "PS_IN" + Name 70 "i" + Name 71 "GS_OUT" + Name 73 "ts" + Decorate 40(ts_pos) BuiltIn Position + Decorate 49(i_pos) BuiltIn Position + Decorate 70(i) Location 0 + Decorate 73(ts) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -230,37 +245,44 @@ output primitive = triangle_strip 30: 20(int) Constant 3 31: TypeBool 35: TypePointer Function 7(fvec4) - 41: 20(int) Constant 1 - 44: TypeArray 7(fvec4) 10 - 45: TypePointer Input 44 - 46(i_pos): 45(ptr) Variable Input - 47: TypePointer Input 7(fvec4) - 54: 20(int) Constant 2 - 63(PS_IN): TypeStruct - 64: TypeArray 63(PS_IN) 10 - 65: TypePointer Input 64 - 66(i): 65(ptr) Variable Input + 39: TypePointer Output 7(fvec4) + 40(ts_pos): 39(ptr) Variable Output + 44: 20(int) Constant 1 + 47: TypeArray 7(fvec4) 10 + 48: TypePointer Input 47 + 49(i_pos): 48(ptr) Variable Input + 50: TypePointer Input 7(fvec4) + 57: 20(int) Constant 2 + 67(PS_IN): TypeStruct + 68: TypeArray 67(PS_IN) 10 + 69: TypePointer Input 68 + 70(i): 69(ptr) Variable Input + 71(GS_OUT): TypeStruct + 72: TypePointer Output 71(GS_OUT) + 73(ts): 72(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 43(i): 12(ptr) Variable Function - 58(ts): 14(ptr) Variable Function - 59(param): 12(ptr) Variable Function - 61(param): 14(ptr) Variable Function - 48: 47(ptr) AccessChain 46(i_pos) 23 - 49: 7(fvec4) Load 48 - 50: 35(ptr) AccessChain 43(i) 23 23 - Store 50 49 - 51: 47(ptr) AccessChain 46(i_pos) 41 + 46(i): 12(ptr) Variable Function + 61(ts): 14(ptr) Variable Function + 62(param): 12(ptr) Variable Function + 64(param): 14(ptr) Variable Function + 51: 50(ptr) AccessChain 49(i_pos) 23 52: 7(fvec4) Load 51 - 53: 35(ptr) AccessChain 43(i) 41 23 + 53: 35(ptr) AccessChain 46(i) 23 23 Store 53 52 - 55: 47(ptr) AccessChain 46(i_pos) 54 - 56: 7(fvec4) Load 55 - 57: 35(ptr) AccessChain 43(i) 54 23 - Store 57 56 - 60: 11 Load 43(i) - Store 59(param) 60 - 62: 2 FunctionCall 18(@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;) 59(param) 61(param) + 54: 50(ptr) AccessChain 49(i_pos) 44 + 55: 7(fvec4) Load 54 + 56: 35(ptr) AccessChain 46(i) 44 23 + Store 56 55 + 58: 50(ptr) AccessChain 49(i_pos) 57 + 59: 7(fvec4) Load 58 + 60: 35(ptr) AccessChain 46(i) 57 23 + Store 60 59 + 63: 11 Load 46(i) + Store 62(param) 63 + 65: 2 FunctionCall 18(@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;) 62(param) 64(param) + 66: 13(GS_OUT) Load 64(param) + Store 61(ts) 66 Return FunctionEnd 18(@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;): 2 Function None 15 @@ -284,14 +306,15 @@ output primitive = triangle_strip 37: 7(fvec4) Load 36 38: 35(ptr) AccessChain 33(o) 23 Store 38 37 - 39: 13(GS_OUT) Load 33(o) - Store 17(ts) 39 + 41: 35(ptr) AccessChain 33(o) 23 + 42: 7(fvec4) Load 41 + Store 40(ts_pos) 42 EmitVertex Branch 27 27: Label - 40: 20(int) Load 22(x) - 42: 20(int) IAdd 40 41 - Store 22(x) 42 + 43: 20(int) Load 22(x) + 45: 20(int) IAdd 43 44 + Store 22(x) 45 Branch 24 26: Label Return diff --git a/Test/baseResults/hlsl.structarray.flatten.geom.out b/Test/baseResults/hlsl.structarray.flatten.geom.out index 1af304d7..56aa2a57 100644 --- a/Test/baseResults/hlsl.structarray.flatten.geom.out +++ b/Test/baseResults/hlsl.structarray.flatten.geom.out @@ -47,9 +47,31 @@ output primitive = triangle_strip 0:21 Constant: 0:21 0 (const int) 0:22 Sequence -0:22 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 'outStream' ( out structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream_position' ( out 4-component vector of float Position) +0:22 position: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 2 (const int) 0:22 EmitVertex ( temp void) 0:16 Function Definition: main( ( temp void) 0:16 Function Parameters: @@ -62,6 +84,7 @@ output primitive = triangle_strip 0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:? Linker Objects 0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) Linked geometry stage: @@ -115,9 +138,31 @@ output primitive = triangle_strip 0:21 Constant: 0:21 0 (const int) 0:22 Sequence -0:22 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 'outStream' ( out structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream_position' ( out 4-component vector of float Position) +0:22 position: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 2 (const int) 0:22 EmitVertex ( temp void) 0:16 Function Definition: main( ( temp void) 0:16 Function Parameters: @@ -130,15 +175,16 @@ output primitive = triangle_strip 0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:? Linker Objects 0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 47 +// Id's are bound by 61 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 40 + EntryPoint Geometry 4 "main" 38 43 53 ExecutionMode 4 InputLines ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -156,12 +202,19 @@ output primitive = triangle_strip Name 17 "vin" Name 18 "outStream" Name 21 "vout" - Name 38 "vin" - Name 40 "vin" - Name 42 "outStream" - Name 43 "param" - Name 45 "param" - Decorate 40(vin) Location 0 + Name 38 "outStream_position" + Name 41 "PS_IN" + MemberName 41(PS_IN) 0 "color" + MemberName 41(PS_IN) 1 "uv" + Name 43 "outStream" + Name 51 "vin" + Name 53 "vin" + Name 55 "outStream" + Name 56 "param" + Name 58 "param" + Decorate 38(outStream_position) BuiltIn Position + Decorate 43(outStream) Location 0 + Decorate 53(vin) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -181,19 +234,27 @@ output primitive = triangle_strip 28: 22(int) Constant 2 29: TypePointer Function 8(fvec2) 33: 22(int) Constant 0 - 39: TypePointer Input 12 - 40(vin): 39(ptr) Variable Input + 37: TypePointer Output 7(fvec4) +38(outStream_position): 37(ptr) Variable Output + 41(PS_IN): TypeStruct 7(fvec4) 8(fvec2) + 42: TypePointer Output 41(PS_IN) + 43(outStream): 42(ptr) Variable Output + 49: TypePointer Output 8(fvec2) + 52: TypePointer Input 12 + 53(vin): 52(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 38(vin): 13(ptr) Variable Function - 42(outStream): 15(ptr) Variable Function - 43(param): 13(ptr) Variable Function - 45(param): 15(ptr) Variable Function - 41: 12 Load 40(vin) - Store 38(vin) 41 - 44: 12 Load 38(vin) - Store 43(param) 44 - 46: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 43(param) 45(param) + 51(vin): 13(ptr) Variable Function + 55(outStream): 15(ptr) Variable Function + 56(param): 13(ptr) Variable Function + 58(param): 15(ptr) Variable Function + 54: 12 Load 53(vin) + Store 51(vin) 54 + 57: 12 Load 51(vin) + Store 56(param) 57 + 59: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 56(param) 58(param) + 60: 14(PS_IN) Load 58(param) + Store 55(outStream) 60 Return FunctionEnd 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;): 2 Function None 16 @@ -213,8 +274,17 @@ output primitive = triangle_strip 35: 7(fvec4) Load 34 36: 24(ptr) AccessChain 21(vout) 33 Store 36 35 - 37: 14(PS_IN) Load 21(vout) - Store 18(outStream) 37 + 39: 24(ptr) AccessChain 21(vout) 33 + 40: 7(fvec4) Load 39 + Store 38(outStream_position) 40 + 44: 24(ptr) AccessChain 21(vout) 23 + 45: 7(fvec4) Load 44 + 46: 37(ptr) AccessChain 43(outStream) 33 + Store 46 45 + 47: 29(ptr) AccessChain 21(vout) 28 + 48: 8(fvec2) Load 47 + 50: 49(ptr) AccessChain 43(outStream) 23 + Store 50 48 EmitVertex Return FunctionEnd diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index 230a6b9c..45aff022 100644 --- a/glslang/Include/BaseTypes.h +++ b/glslang/Include/BaseTypes.h @@ -219,6 +219,7 @@ enum TBuiltInVariable { EbvFragDepthGreater, EbvFragDepthLesser, EbvStencilRef, + EbvGsOutputStream, EbvLast }; diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp index b764d890..b9d9a3a1 100755 --- a/hlsl/hlslGrammar.cpp +++ b/hlsl/hlslGrammar.cpp @@ -611,12 +611,15 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList) qualifier.layoutFormat = type.getQualifier().layoutFormat; qualifier.precision = type.getQualifier().precision; - if (type.getQualifier().storage == EvqVaryingOut || + if (type.getQualifier().storage == EvqOut || type.getQualifier().storage == EvqBuffer) { qualifier.storage = type.getQualifier().storage; qualifier.readonly = type.getQualifier().readonly; } + if (type.getQualifier().builtIn != EbvNone) + qualifier.builtIn = type.getQualifier().builtIn; + type.getQualifier() = qualifier; } @@ -1035,7 +1038,8 @@ bool HlslGrammar::acceptStreamOutTemplateType(TType& type, TLayoutGeometry& geom return false; } - type.getQualifier().storage = EvqVaryingOut; + type.getQualifier().storage = EvqOut; + type.getQualifier().builtIn = EbvGsOutputStream; if (! acceptTokenClass(EHTokRightAngle)) { expected("right angle bracket"); diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 769a10f0..27c09a26 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -66,7 +66,8 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int nextInLocation(0), nextOutLocation(0), sourceEntryPointName(sourceEntryPointName), entryPointFunction(nullptr), - entryPointFunctionBody(nullptr) + entryPointFunctionBody(nullptr), + gsStreamOutput(nullptr) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -1852,11 +1853,15 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct TIntermAggregate* synthBody = new TIntermAggregate(); auto inputIt = inputs.begin(); TIntermTyped* callingArgs = nullptr; + for (int i = 0; i < userFunction.getParamCount(); i++) { TParameter& param = userFunction[i]; argVars.push_back(makeInternalVariable(*param.name, *param.type)); + argVars.back()->getWritableType().getQualifier().makeTemporary(); + TIntermSymbol* arg = intermediate.addSymbol(*argVars.back()); + handleFunctionArgument(&callee, callingArgs, arg); if (param.type->getQualifier().isParamInput()) { intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, @@ -1911,10 +1916,20 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct auto outputIt = outputs.begin(); for (int i = 0; i < userFunction.getParamCount(); i++) { TParameter& param = userFunction[i]; + + // GS outputs are via emit, so we do not copy them here. if (param.type->getQualifier().isParamOutput()) { - intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, - intermediate.addSymbol(**outputIt), - intermediate.addSymbol(*argVars[i]))); + if (param.declaredBuiltIn == EbvGsOutputStream) { + // GS output stream does not assign outputs here: it's the Append() method + // which writes to the output, probably multiple times separated by Emit. + // We merely remember the output to use, here. + gsStreamOutput = *outputIt; + } else { + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, + intermediate.addSymbol(**outputIt), + intermediate.addSymbol(*argVars[i]))); + } + outputIt++; } } @@ -3301,9 +3316,15 @@ void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTy emit->setLoc(loc); emit->setType(TType(EbtVoid)); + // find the matching output + if (gsStreamOutput == nullptr) { + error(loc, "unable to find output symbol for Append()", "", ""); + return; + } + sequence = intermediate.growAggregate(sequence, handleAssign(loc, EOpAssign, - argAggregate->getSequence()[0]->getAsTyped(), + intermediate.addSymbol(*gsStreamOutput, loc), argAggregate->getSequence()[1]->getAsTyped()), loc); diff --git a/hlsl/hlslParseHelper.h b/hlsl/hlslParseHelper.h index b46a5809..0796b6a9 100755 --- a/hlsl/hlslParseHelper.h +++ b/hlsl/hlslParseHelper.h @@ -405,6 +405,8 @@ protected: TVector currentTypePrefix; // current scoping prefix for nested structures TVector implicitThisStack; // currently active 'this' variables for nested structures + + TVariable* gsStreamOutput; // geometry shader stream outputs, for emit (Append method) }; // This is the prefix we use for builtin methods to avoid namespace collisions with