HLSL: Flatten structs for all non-arrayed I/O interfaces.

This commit is contained in:
John Kessenich
2017-08-11 00:17:26 -06:00
parent 01109546d8
commit e29ff3cd65
15 changed files with 749 additions and 862 deletions

View File

@@ -55,19 +55,13 @@ output primitive = triangle_strip
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:? 'outStream.color' (layout( location=0) out 4-component vector of float)
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:? 'outStream.uv' (layout( location=1) out 2-component vector of float)
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:
@@ -85,7 +79,8 @@ output primitive = triangle_strip
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.position' ( out 4-component vector of float Position)
0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream.color' (layout( location=0) out 4-component vector of float)
0:? 'outStream.uv' (layout( location=1) out 2-component vector of float)
Linked geometry stage:
@@ -147,19 +142,13 @@ output primitive = triangle_strip
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:? 'outStream.color' (layout( location=0) out 4-component vector of float)
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:? 'outStream.uv' (layout( location=1) out 2-component vector of float)
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:
@@ -177,16 +166,17 @@ output primitive = triangle_strip
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.position' ( out 4-component vector of float Position)
0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream.color' (layout( location=0) out 4-component vector of float)
0:? 'outStream.uv' (layout( location=1) out 2-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 61
// Id's are bound by 58
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 38 43 53
EntryPoint Geometry 4 "main" 38 41 45 50
ExecutionMode 4 InputLines
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
@@ -206,18 +196,17 @@ output primitive = triangle_strip
Name 18 "outStream"
Name 21 "vout"
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"
Name 41 "outStream.color"
Name 45 "outStream.uv"
Name 48 "vin"
Name 50 "vin"
Name 52 "outStream"
Name 53 "param"
Name 55 "param"
Decorate 38(outStream.position) BuiltIn Position
Decorate 43(outStream) Location 0
Decorate 53(vin) Location 0
Decorate 41(outStream.color) Location 0
Decorate 45(outStream.uv) Location 1
Decorate 50(vin) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -239,25 +228,24 @@ output primitive = triangle_strip
33: 22(int) Constant 0
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
41(outStream.color): 37(ptr) Variable Output
44: TypePointer Output 8(fvec2)
45(outStream.uv): 44(ptr) Variable Output
49: TypePointer Input 12
50(vin): 49(ptr) Variable Input
4(main): 2 Function None 3
5: Label
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
48(vin): 13(ptr) Variable Function
52(outStream): 15(ptr) Variable Function
53(param): 13(ptr) Variable Function
55(param): 15(ptr) Variable Function
51: 12 Load 50(vin)
Store 48(vin) 51
54: 12 Load 48(vin)
Store 53(param) 54
56: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 53(param) 55(param)
57: 14(PS_IN) Load 55(param)
Store 52(outStream) 57
Return
FunctionEnd
19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;): 2 Function None 16
@@ -280,14 +268,12 @@ output primitive = triangle_strip
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
42: 24(ptr) AccessChain 21(vout) 23
43: 7(fvec4) Load 42
Store 41(outStream.color) 43
46: 29(ptr) AccessChain 21(vout) 28
47: 8(fvec2) Load 46
Store 45(outStream.uv) 47
EmitVertex
Return
FunctionEnd