Commit b6be80f4 by John Kessenich

HLSL: Flatten more I/O: non-arrayed user-only structures.

The goal is to flatten all I/O, but there are multiple categories and steps to complete, likely including a final unification of splitting and flattening.
parent cca42a8e
......@@ -11,9 +11,10 @@ gl_FragCoord origin is upper left
0:10 Function Definition: main( ( temp void)
0:10 Function Parameters:
0:? Sequence
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
......@@ -37,9 +38,10 @@ gl_FragCoord origin is upper left
0:10 Function Definition: main( ( temp void)
0:10 Function Parameters:
0:? Sequence
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
......
......@@ -14,10 +14,11 @@ Shader version: 500
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
0:10 Function Call: @main(struct-vs_in1; ( temp structure{})
0:? 'i' ( temp structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
0:10 Function Call: @main(struct-vs_in1; ( temp structure{})
0:? 'i' ( temp structure{})
0:? Linker Objects
......@@ -39,10 +40,11 @@ Shader version: 500
0:10 move second child to first child ( temp structure{})
0:? 'i' ( temp structure{})
0:? 'i' ( in structure{})
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
0:10 Function Call: @main(struct-vs_in1; ( temp structure{})
0:? 'i' ( temp structure{})
0:10 Sequence
0:10 move second child to first child ( temp structure{})
0:? '@entryPointOutput' ( out structure{})
0:10 Function Call: @main(struct-vs_in1; ( temp structure{})
0:? 'i' ( temp structure{})
0:? Linker Objects
// Module Version 10000
......
......@@ -24,16 +24,27 @@ gl_FragCoord origin is upper left
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:7 move second child to first child ( temp uint)
0:7 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:7 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:7 Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
Linked fragment stage:
......@@ -64,16 +75,27 @@ gl_FragCoord origin is upper left
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:7 move second child to first child ( temp uint)
0:7 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:7 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:7 Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
// Module Version 10000
// Generated by (magic number): 80001
......@@ -82,7 +104,7 @@ gl_FragCoord origin is upper left
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 33 40
EntryPoint Fragment 4 "main" 32 36 40
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -92,14 +114,13 @@ gl_FragCoord origin is upper left
Name 13 "@main(struct-PSInput-f1-u11;"
Name 12 "input"
Name 30 "input"
Name 31 "PSInput"
MemberName 31(PSInput) 0 "interp"
MemberName 31(PSInput) 1 "no_interp"
Name 33 "input"
Name 32 "interp"
Name 36 "no_interp"
Name 40 "@entryPointOutput"
Name 41 "param"
MemberDecorate 31(PSInput) 1 Flat
Decorate 33(input) Location 0
Decorate 32(interp) Location 0
Decorate 36(no_interp) Flat
Decorate 36(no_interp) Location 1
Decorate 40(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
......@@ -116,20 +137,20 @@ gl_FragCoord origin is upper left
22: TypePointer Function 6(float)
25: 6(float) Constant 0
26: 6(float) Constant 1065353216
31(PSInput): TypeStruct 6(float) 7(int)
32: TypePointer Input 31(PSInput)
33(input): 32(ptr) Variable Input
31: TypePointer Input 6(float)
32(interp): 31(ptr) Variable Input
35: TypePointer Input 7(int)
36(no_interp): 35(ptr) Variable Input
39: TypePointer Output 10(fvec4)
40(@entryPointOutput): 39(ptr) Variable Output
4(main): 2 Function None 3
5: Label
30(input): 9(ptr) Variable Function
41(param): 9(ptr) Variable Function
34: 31(PSInput) Load 33(input)
35: 6(float) CompositeExtract 34 0
36: 22(ptr) AccessChain 30(input) 21
Store 36 35
37: 7(int) CompositeExtract 34 1
33: 6(float) Load 32(interp)
34: 22(ptr) AccessChain 30(input) 21
Store 34 33
37: 7(int) Load 36(no_interp)
38: 17(ptr) AccessChain 30(input) 16
Store 38 37
42: 8(PSInput) Load 30(input)
......
......@@ -25,9 +25,19 @@ gl_FragCoord origin is upper left
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:7 move second child to first child ( temp uint)
0:7 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:7 Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'out1' ( temp 4-component vector of float)
......@@ -39,7 +49,8 @@ gl_FragCoord origin is upper left
0:? 'out2' (layout( location=3) out 4-component vector of float)
0:? 'out2' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'out1' (layout( location=1) out 4-component vector of float)
0:? 'out2' (layout( location=3) out 4-component vector of float)
......@@ -73,9 +84,19 @@ gl_FragCoord origin is upper left
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:7 move second child to first child ( temp uint)
0:7 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:7 Constant:
0:7 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:7 Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'out1' ( temp 4-component vector of float)
......@@ -87,7 +108,8 @@ gl_FragCoord origin is upper left
0:? 'out2' (layout( location=3) out 4-component vector of float)
0:? 'out2' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'out1' (layout( location=1) out 4-component vector of float)
0:? 'out2' (layout( location=3) out 4-component vector of float)
......@@ -98,7 +120,7 @@ gl_FragCoord origin is upper left
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 25 46 48
EntryPoint Fragment 4 "main" 26 32 46 48
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -110,10 +132,8 @@ gl_FragCoord origin is upper left
Name 14 "out1"
Name 15 "out2"
Name 22 "input"
Name 23 "PSInput"
MemberName 23(PSInput) 0 "interp"
MemberName 23(PSInput) 1 "no_interp"
Name 25 "input"
Name 26 "interp"
Name 32 "no_interp"
Name 36 "out1"
Name 37 "out2"
Name 38 "param"
......@@ -121,8 +141,9 @@ gl_FragCoord origin is upper left
Name 41 "param"
Name 46 "out1"
Name 48 "out2"
MemberDecorate 23(PSInput) 1 Flat
Decorate 25(input) Location 0
Decorate 26(interp) Location 0
Decorate 32(no_interp) Flat
Decorate 32(no_interp) Location 1
Decorate 46(out1) Location 1
Decorate 48(out2) Location 3
2: TypeVoid
......@@ -138,13 +159,14 @@ gl_FragCoord origin is upper left
19: 10(fvec4) ConstantComposite 18 18 18 18
20: 6(float) Constant 0
21: 10(fvec4) ConstantComposite 20 20 20 20
23(PSInput): TypeStruct 6(float) 7(int)
24: TypePointer Input 23(PSInput)
25(input): 24(ptr) Variable Input
28: TypeInt 32 1
29: 28(int) Constant 0
30: TypePointer Function 6(float)
33: 28(int) Constant 1
23: TypeInt 32 1
24: 23(int) Constant 0
25: TypePointer Input 6(float)
26(interp): 25(ptr) Variable Input
28: TypePointer Function 6(float)
30: 23(int) Constant 1
31: TypePointer Input 7(int)
32(no_interp): 31(ptr) Variable Input
34: TypePointer Function 7(int)
45: TypePointer Output 10(fvec4)
46(out1): 45(ptr) Variable Output
......@@ -157,13 +179,12 @@ gl_FragCoord origin is upper left
38(param): 9(ptr) Variable Function
40(param): 11(ptr) Variable Function
41(param): 11(ptr) Variable Function
26: 23(PSInput) Load 25(input)
27: 6(float) CompositeExtract 26 0
31: 30(ptr) AccessChain 22(input) 29
Store 31 27
32: 7(int) CompositeExtract 26 1
35: 34(ptr) AccessChain 22(input) 33
Store 35 32
27: 6(float) Load 26(interp)
29: 28(ptr) AccessChain 22(input) 24
Store 29 27
33: 7(int) Load 32(no_interp)
35: 34(ptr) AccessChain 22(input) 30
Store 35 33
39: 8(PSInput) Load 22(input)
Store 38(param) 39
42: 2 FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;vf4;) 38(param) 40(param) 41(param)
......
......@@ -48,9 +48,19 @@ gl_FragCoord origin is upper left
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:12 move second child to first child ( temp uint)
0:12 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:12 Sequence
0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
......@@ -75,7 +85,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? 'o1' (layout( location=2) out 4-component vector of float)
0:? 'o2' (layout( location=1) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'po' (layout( location=0) out 4-component vector of float)
......@@ -131,9 +142,19 @@ gl_FragCoord origin is upper left
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:12 move second child to first child ( temp uint)
0:12 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:12 Sequence
0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
......@@ -158,7 +179,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? 'o1' (layout( location=2) out 4-component vector of float)
0:? 'o2' (layout( location=1) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'po' (layout( location=0) out 4-component vector of float)
// Module Version 10000
......@@ -168,7 +190,7 @@ gl_FragCoord origin is upper left
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 43 57 60 63
EntryPoint Fragment 4 "main" 42 46 57 60 63
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -183,10 +205,8 @@ gl_FragCoord origin is upper left
Name 15 "po"
Name 19 "pso"
Name 40 "input"
Name 41 "PSInput"
MemberName 41(PSInput) 0 "interp"
MemberName 41(PSInput) 1 "no_interp"
Name 43 "input"
Name 42 "interp"
Name 46 "no_interp"
Name 49 "flattenTemp"
Name 50 "po"
Name 51 "param"
......@@ -194,8 +214,9 @@ gl_FragCoord origin is upper left
Name 57 "o1"
Name 60 "o2"
Name 63 "po"
MemberDecorate 41(PSInput) 1 Flat
Decorate 43(input) Location 0
Decorate 42(interp) Location 0
Decorate 46(no_interp) Flat
Decorate 46(no_interp) Location 1
Decorate 57(o1) Location 2
Decorate 60(o2) Location 1
Decorate 63(po) Location 0
......@@ -219,9 +240,10 @@ gl_FragCoord origin is upper left
31: 6(float) Constant 1065353216
34: 10(fvec4) ConstantComposite 31 31 31 31
36: 10(fvec4) ConstantComposite 30 30 30 30
41(PSInput): TypeStruct 6(float) 7(int)
42: TypePointer Input 41(PSInput)
43(input): 42(ptr) Variable Input
41: TypePointer Input 6(float)
42(interp): 41(ptr) Variable Input
45: TypePointer Input 7(int)
46(no_interp): 45(ptr) Variable Input
56: TypePointer Output 10(fvec4)
57(o1): 56(ptr) Variable Output
60(o2): 56(ptr) Variable Output
......@@ -233,11 +255,10 @@ gl_FragCoord origin is upper left
50(po): 11(ptr) Variable Function
51(param): 9(ptr) Variable Function
53(param): 11(ptr) Variable Function
44: 41(PSInput) Load 43(input)
45: 6(float) CompositeExtract 44 0
46: 27(ptr) AccessChain 40(input) 21
Store 46 45
47: 7(int) CompositeExtract 44 1
43: 6(float) Load 42(interp)
44: 27(ptr) AccessChain 40(input) 21
Store 44 43
47: 7(int) Load 46(no_interp)
48: 23(ptr) AccessChain 40(input) 22
Store 48 47
52: 8(PSInput) Load 40(input)
......
......@@ -48,9 +48,19 @@ gl_FragCoord origin is upper left
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:12 move second child to first child ( temp uint)
0:12 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:12 Sequence
0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
......@@ -75,7 +85,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? 'o1' (layout( location=2) out 4-component vector of float)
0:? 'o2' (layout( location=3) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'po' (layout( location=0) out 4-component vector of float)
......@@ -131,9 +142,19 @@ gl_FragCoord origin is upper left
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 interp: direct index for structure ( temp float)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 0 (const int)
0:? 'interp' (layout( location=0) in float)
0:12 move second child to first child ( temp uint)
0:12 no_interp: direct index for structure ( temp uint)
0:? 'input' ( temp structure{ temp float interp, temp uint no_interp})
0:12 Constant:
0:12 1 (const int)
0:? 'no_interp' (layout( location=1) flat in uint)
0:12 Sequence
0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2})
......@@ -158,7 +179,8 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? 'o1' (layout( location=2) out 4-component vector of float)
0:? 'o2' (layout( location=3) out 4-component vector of float)
0:? 'input' (layout( location=0) in structure{ temp float interp, flat temp uint no_interp})
0:? 'interp' (layout( location=0) in float)
0:? 'no_interp' (layout( location=1) flat in uint)
0:? 'po' (layout( location=0) out 4-component vector of float)
// Module Version 10000
......@@ -168,7 +190,7 @@ gl_FragCoord origin is upper left
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 43 57 60 63
EntryPoint Fragment 4 "main" 42 46 57 60 63
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -183,10 +205,8 @@ gl_FragCoord origin is upper left
Name 15 "po"
Name 19 "pso"
Name 40 "input"
Name 41 "PSInput"
MemberName 41(PSInput) 0 "interp"
MemberName 41(PSInput) 1 "no_interp"
Name 43 "input"
Name 42 "interp"
Name 46 "no_interp"
Name 49 "flattenTemp"
Name 50 "po"
Name 51 "param"
......@@ -194,8 +214,9 @@ gl_FragCoord origin is upper left
Name 57 "o1"
Name 60 "o2"
Name 63 "po"
MemberDecorate 41(PSInput) 1 Flat
Decorate 43(input) Location 0
Decorate 42(interp) Location 0
Decorate 46(no_interp) Flat
Decorate 46(no_interp) Location 1
Decorate 57(o1) Location 2
Decorate 60(o2) Location 3
Decorate 63(po) Location 0
......@@ -219,9 +240,10 @@ gl_FragCoord origin is upper left
31: 6(float) Constant 1065353216
34: 10(fvec4) ConstantComposite 31 31 31 31
36: 10(fvec4) ConstantComposite 30 30 30 30
41(PSInput): TypeStruct 6(float) 7(int)
42: TypePointer Input 41(PSInput)
43(input): 42(ptr) Variable Input
41: TypePointer Input 6(float)
42(interp): 41(ptr) Variable Input
45: TypePointer Input 7(int)
46(no_interp): 45(ptr) Variable Input
56: TypePointer Output 10(fvec4)
57(o1): 56(ptr) Variable Output
60(o2): 56(ptr) Variable Output
......@@ -233,11 +255,10 @@ gl_FragCoord origin is upper left
50(po): 11(ptr) Variable Function
51(param): 9(ptr) Variable Function
53(param): 11(ptr) Variable Function
44: 41(PSInput) Load 43(input)
45: 6(float) CompositeExtract 44 0
46: 27(ptr) AccessChain 40(input) 21
Store 46 45
47: 7(int) CompositeExtract 44 1
43: 6(float) Load 42(interp)
44: 27(ptr) AccessChain 40(input) 21
Store 44 43
47: 7(int) Load 46(no_interp)
48: 23(ptr) AccessChain 40(input) 22
Store 48 47
52: 8(PSInput) Load 40(input)
......
......@@ -1904,6 +1904,10 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
// Structs containing built-ins must be split
else if (variable.getType().containsBuiltIn())
split(variable);
else if (!variable.getType().getQualifier().isArrayedIo(language))
flatten(variable);
//else
// TODO: unify split and flatten, so all paths can create flattened I/O
}
// For clip and cull distance, multiple output variables potentially get merged
......@@ -1915,7 +1919,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
if (entryPointOutput != nullptr)
makeVariableInOut(*entryPointOutput);
for (auto it = inputs.begin(); it != inputs.end(); ++it)
if (!isDsPcfInput((*it)->getType())) // skip domain shader PCF input (see comment below)
if (!isDsPcfInput((*it)->getType())) // wait until the end for PCF input (see comment below)
makeVariableInOut(*(*it));
for (auto it = outputs.begin(); it != outputs.end(); ++it)
makeVariableInOut(*(*it));
......@@ -1927,7 +1931,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
// however, so this ensures the linkage is built in the correct order regardless of argument order.
if (language == EShLangTessEvaluation) {
for (auto it = inputs.begin(); it != inputs.end(); ++it)
if (isDsPcfInput((*it)->getType())) // skip domain shader PCF input (see comment below)
if (isDsPcfInput((*it)->getType()))
makeVariableInOut(*(*it));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment