HLSL: fix GS implementation for EP wrapping

The prior implementation of GS did not work with the new EP wrapping architecture.
This fixes it: the Append() method now looks up the actual output rather
than the internal sanitized temporary type, and writes to that.
This commit is contained in:
steve-lunarg
2017-03-29 20:01:13 -06:00
parent 2184c2f21a
commit 08e0c086c8
10 changed files with 494 additions and 237 deletions

View File

@@ -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