HLSL: Flatten a return struct from an entry point and assign locations after flattening.
Locations now get assigned in order, but skipping built-ins, which can be done post flattening.
This commit is contained in:
@@ -21,11 +21,11 @@ gl_FragCoord origin is upper left
|
||||
0:16 1.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp structure{temp 4-component vector of float color})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 4-component vector of float color})
|
||||
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
|
||||
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
|
||||
0:17 Branch: Return
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
|
||||
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
@@ -53,20 +53,20 @@ gl_FragCoord origin is upper left
|
||||
0:16 1.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp structure{temp 4-component vector of float color})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 4-component vector of float color})
|
||||
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
|
||||
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
|
||||
0:17 Branch: Return
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
|
||||
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 25
|
||||
// Id's are bound by 27
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 22
|
||||
EntryPoint Fragment 4 "main" 22 26
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 6 "MyFunc("
|
||||
@@ -75,7 +75,8 @@ gl_FragCoord origin is upper left
|
||||
MemberName 12(PS_OUTPUT) 0 "color"
|
||||
Name 14 "ps_output"
|
||||
Name 22 "@entryPointOutput"
|
||||
Decorate 22(@entryPointOutput) Location 0
|
||||
Name 26 "color"
|
||||
Decorate 26(color) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
10: TypeFloat 32
|
||||
@@ -89,6 +90,8 @@ gl_FragCoord origin is upper left
|
||||
19: TypePointer Function 11(fvec4)
|
||||
21: TypePointer Output 12(PS_OUTPUT)
|
||||
22(@entryPointOutput): 21(ptr) Variable Output
|
||||
25: TypePointer Output 11(fvec4)
|
||||
26(color): 25(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
14(ps_output): 13(ptr) Variable Function
|
||||
|
||||
Reference in New Issue
Block a user