WIP: HLSL: handle clip/cull distance array semantic matching

In HLSL, there are three (TODO: ??) dimensions of clip and cull
distance values:

  * The semantic's value N, ala SV_ClipDistanceN.
  * The array demension, if the value is an array.
  * The vector element, if the value is a vector or array of vectors.

In SPIR-V, clip and cull distance are arrays of scalar floats, always.

This PR currently ignores the semantic N axis, and handles the other
two axes by sequentially copying each vector element of each array member
into sequential floats in the output array.

Fixes: #946
This commit is contained in:
LoopDawg 2017-06-22 12:08:00 -06:00
parent 4329d555ad
commit c44b95fdec
15 changed files with 2280 additions and 200 deletions

View File

@ -0,0 +1,194 @@
hlsl.clipdistance-1.vert
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;f1;f1; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out float)
0:4 'cull' ( out float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 'clip' ( out float)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 'cull' ( out float)
0:7 Constant:
0:7 0.510000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;f1;f1; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp float)
0:? 'cull' ( temp float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 1-element array of float ClipDistance)
0:4 Constant:
0:4 0 (const int)
0:? 'clip' ( temp float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 1-element array of float CullDistance)
0:4 Constant:
0:4 0 (const int)
0:? 'cull' ( temp float)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 1-element array of float ClipDistance)
0:? 'cull' ( out 1-element array of float CullDistance)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;f1;f1; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out float)
0:4 'cull' ( out float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 'clip' ( out float)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 'cull' ( out float)
0:7 Constant:
0:7 0.510000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;f1;f1; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp float)
0:? 'cull' ( temp float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 1-element array of float ClipDistance)
0:4 Constant:
0:4 0 (const int)
0:? 'clip' ( temp float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 1-element array of float CullDistance)
0:4 Constant:
0:4 0 (const int)
0:? 'cull' ( temp float)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 1-element array of float ClipDistance)
0:? 'cull' ( out 1-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 46
Capability Shader
Capability ClipDistance
Capability CullDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 31 37 43
Source HLSL 500
Name 4 "main"
Name 14 "@main(vf4;f1;f1;"
Name 11 "pos"
Name 12 "clip"
Name 13 "cull"
Name 20 "pos"
Name 21 "clip"
Name 22 "cull"
Name 23 "param"
Name 24 "param"
Name 25 "param"
Name 31 "pos"
Name 37 "clip"
Name 43 "cull"
Decorate 31(pos) BuiltIn Position
Decorate 37(clip) BuiltIn ClipDistance
Decorate 43(cull) BuiltIn CullDistance
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypePointer Function 6(float)
10: TypeFunction 2 8(ptr) 9(ptr) 9(ptr)
16: 6(float) Constant 1065353216
17: 7(fvec4) ConstantComposite 16 16 16 16
18: 6(float) Constant 1056964608
19: 6(float) Constant 1057132380
30: TypePointer Output 7(fvec4)
31(pos): 30(ptr) Variable Output
33: TypeInt 32 0
34: 33(int) Constant 1
35: TypeArray 6(float) 34
36: TypePointer Output 35
37(clip): 36(ptr) Variable Output
38: TypeInt 32 1
39: 38(int) Constant 0
41: TypePointer Output 6(float)
43(cull): 36(ptr) Variable Output
4(main): 2 Function None 3
5: Label
20(pos): 8(ptr) Variable Function
21(clip): 9(ptr) Variable Function
22(cull): 9(ptr) Variable Function
23(param): 8(ptr) Variable Function
24(param): 9(ptr) Variable Function
25(param): 9(ptr) Variable Function
26: 2 FunctionCall 14(@main(vf4;f1;f1;) 23(param) 24(param) 25(param)
27: 7(fvec4) Load 23(param)
Store 20(pos) 27
28: 6(float) Load 24(param)
Store 21(clip) 28
29: 6(float) Load 25(param)
Store 22(cull) 29
32: 7(fvec4) Load 20(pos)
Store 31(pos) 32
40: 6(float) Load 21(clip)
42: 41(ptr) AccessChain 37(clip) 39
Store 42 40
44: 6(float) Load 22(cull)
45: 41(ptr) AccessChain 43(cull) 39
Store 45 44
Return
FunctionEnd
14(@main(vf4;f1;f1;): 2 Function None 10
11(pos): 8(ptr) FunctionParameter
12(clip): 9(ptr) FunctionParameter
13(cull): 9(ptr) FunctionParameter
15: Label
Store 11(pos) 17
Store 12(clip) 18
Store 13(cull) 19
Return
FunctionEnd

View File

@ -0,0 +1,561 @@
hlsl.clipdistance-2.vert
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out 2-element array of 2-component vector of float)
0:4 'cull' ( out 2-element array of 2-component vector of float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 direct index ( temp 2-component vector of float)
0:6 'clip' ( out 2-element array of 2-component vector of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 direct index ( temp 2-component vector of float)
0:7 'clip' ( out 2-element array of 2-component vector of float)
0:7 Constant:
0:7 0 (const int)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 0.600000
0:8 move second child to first child ( temp float)
0:8 direct index ( temp float)
0:8 direct index ( temp 2-component vector of float)
0:8 'clip' ( out 2-element array of 2-component vector of float)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 0.700000
0:9 move second child to first child ( temp float)
0:9 direct index ( temp float)
0:9 direct index ( temp 2-component vector of float)
0:9 'clip' ( out 2-element array of 2-component vector of float)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0.800000
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 'cull' ( out 2-element array of 2-component vector of float)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0.525000
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:12 direct index ( temp 2-component vector of float)
0:12 'cull' ( out 2-element array of 2-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 1 (const int)
0:12 Constant:
0:12 0.625000
0:13 move second child to first child ( temp float)
0:13 direct index ( temp float)
0:13 direct index ( temp 2-component vector of float)
0:13 'cull' ( out 2-element array of 2-component vector of float)
0:13 Constant:
0:13 1 (const int)
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.725000
0:14 move second child to first child ( temp float)
0:14 direct index ( temp float)
0:14 direct index ( temp 2-component vector of float)
0:14 'cull' ( out 2-element array of 2-component vector of float)
0:14 Constant:
0:14 1 (const int)
0:14 Constant:
0:14 1 (const int)
0:14 Constant:
0:14 0.825000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 0 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 1 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 1 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 2 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 3 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 1 (const int)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 0 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 1 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 1 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 2 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 3 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 1 (const int)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:? 'cull' ( out 4-element array of float CullDistance)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out 2-element array of 2-component vector of float)
0:4 'cull' ( out 2-element array of 2-component vector of float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 direct index ( temp 2-component vector of float)
0:6 'clip' ( out 2-element array of 2-component vector of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 direct index ( temp 2-component vector of float)
0:7 'clip' ( out 2-element array of 2-component vector of float)
0:7 Constant:
0:7 0 (const int)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 0.600000
0:8 move second child to first child ( temp float)
0:8 direct index ( temp float)
0:8 direct index ( temp 2-component vector of float)
0:8 'clip' ( out 2-element array of 2-component vector of float)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 0.700000
0:9 move second child to first child ( temp float)
0:9 direct index ( temp float)
0:9 direct index ( temp 2-component vector of float)
0:9 'clip' ( out 2-element array of 2-component vector of float)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0.800000
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 'cull' ( out 2-element array of 2-component vector of float)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0.525000
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:12 direct index ( temp 2-component vector of float)
0:12 'cull' ( out 2-element array of 2-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 1 (const int)
0:12 Constant:
0:12 0.625000
0:13 move second child to first child ( temp float)
0:13 direct index ( temp float)
0:13 direct index ( temp 2-component vector of float)
0:13 'cull' ( out 2-element array of 2-component vector of float)
0:13 Constant:
0:13 1 (const int)
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.725000
0:14 move second child to first child ( temp float)
0:14 direct index ( temp float)
0:14 direct index ( temp 2-component vector of float)
0:14 'cull' ( out 2-element array of 2-component vector of float)
0:14 Constant:
0:14 1 (const int)
0:14 Constant:
0:14 1 (const int)
0:14 Constant:
0:14 0.825000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 0 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 1 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 1 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 2 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:4 Constant:
0:4 3 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'clip' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 1 (const int)
0:? Sequence
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 0 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 1 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 0 (const int)
0:4 Constant:
0:4 1 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 2 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 0 (const int)
0:4 move second child to first child ( temp float)
0:4 direct index ( temp float)
0:? 'cull' ( out 4-element array of float CullDistance)
0:4 Constant:
0:4 3 (const int)
0:4 direct index ( temp float)
0:4 direct index ( temp 2-component vector of float)
0:? 'cull' ( temp 2-element array of 2-component vector of float)
0:4 Constant:
0:4 1 (const int)
0:4 Constant:
0:4 1 (const int)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 4-element array of float ClipDistance)
0:? 'cull' ( out 4-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 89
Capability Shader
Capability ClipDistance
Capability CullDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 55 60 76
Source HLSL 500
Name 4 "main"
Name 18 "@main(vf4;vf2[2];vf2[2];"
Name 15 "pos"
Name 16 "clip"
Name 17 "cull"
Name 44 "pos"
Name 45 "clip"
Name 46 "cull"
Name 47 "param"
Name 48 "param"
Name 49 "param"
Name 55 "pos"
Name 60 "clip"
Name 76 "cull"
Decorate 55(pos) BuiltIn Position
Decorate 60(clip) BuiltIn ClipDistance
Decorate 76(cull) BuiltIn CullDistance
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeVector 6(float) 2
10: TypeInt 32 0
11: 10(int) Constant 2
12: TypeArray 9(fvec2) 11
13: TypePointer Function 12
14: TypeFunction 2 8(ptr) 13(ptr) 13(ptr)
20: 6(float) Constant 1065353216
21: 7(fvec4) ConstantComposite 20 20 20 20
22: TypeInt 32 1
23: 22(int) Constant 0
24: 6(float) Constant 1056964608
25: 10(int) Constant 0
26: TypePointer Function 6(float)
28: 6(float) Constant 1058642330
29: 10(int) Constant 1
31: 22(int) Constant 1
32: 6(float) Constant 1060320051
34: 6(float) Constant 1061997773
36: 6(float) Constant 1057384038
38: 6(float) Constant 1059061760
40: 6(float) Constant 1060739482
42: 6(float) Constant 1062417203
54: TypePointer Output 7(fvec4)
55(pos): 54(ptr) Variable Output
57: 10(int) Constant 4
58: TypeArray 6(float) 57
59: TypePointer Output 58
60(clip): 59(ptr) Variable Output
63: TypePointer Output 6(float)
68: 22(int) Constant 2
72: 22(int) Constant 3
76(cull): 59(ptr) Variable Output
4(main): 2 Function None 3
5: Label
44(pos): 8(ptr) Variable Function
45(clip): 13(ptr) Variable Function
46(cull): 13(ptr) Variable Function
47(param): 8(ptr) Variable Function
48(param): 13(ptr) Variable Function
49(param): 13(ptr) Variable Function
50: 2 FunctionCall 18(@main(vf4;vf2[2];vf2[2];) 47(param) 48(param) 49(param)
51: 7(fvec4) Load 47(param)
Store 44(pos) 51
52: 12 Load 48(param)
Store 45(clip) 52
53: 12 Load 49(param)
Store 46(cull) 53
56: 7(fvec4) Load 44(pos)
Store 55(pos) 56
61: 26(ptr) AccessChain 45(clip) 23 25
62: 6(float) Load 61
64: 63(ptr) AccessChain 60(clip) 23
Store 64 62
65: 26(ptr) AccessChain 45(clip) 23 29
66: 6(float) Load 65
67: 63(ptr) AccessChain 60(clip) 31
Store 67 66
69: 26(ptr) AccessChain 45(clip) 31 25
70: 6(float) Load 69
71: 63(ptr) AccessChain 60(clip) 68
Store 71 70
73: 26(ptr) AccessChain 45(clip) 31 29
74: 6(float) Load 73
75: 63(ptr) AccessChain 60(clip) 72
Store 75 74
77: 26(ptr) AccessChain 46(cull) 23 25
78: 6(float) Load 77
79: 63(ptr) AccessChain 76(cull) 23
Store 79 78
80: 26(ptr) AccessChain 46(cull) 23 29
81: 6(float) Load 80
82: 63(ptr) AccessChain 76(cull) 31
Store 82 81
83: 26(ptr) AccessChain 46(cull) 31 25
84: 6(float) Load 83
85: 63(ptr) AccessChain 76(cull) 68
Store 85 84
86: 26(ptr) AccessChain 46(cull) 31 29
87: 6(float) Load 86
88: 63(ptr) AccessChain 76(cull) 72
Store 88 87
Return
FunctionEnd
18(@main(vf4;vf2[2];vf2[2];): 2 Function None 14
15(pos): 8(ptr) FunctionParameter
16(clip): 13(ptr) FunctionParameter
17(cull): 13(ptr) FunctionParameter
19: Label
Store 15(pos) 21
27: 26(ptr) AccessChain 16(clip) 23 25
Store 27 24
30: 26(ptr) AccessChain 16(clip) 23 29
Store 30 28
33: 26(ptr) AccessChain 16(clip) 31 25
Store 33 32
35: 26(ptr) AccessChain 16(clip) 31 29
Store 35 34
37: 26(ptr) AccessChain 17(cull) 23 25
Store 37 36
39: 26(ptr) AccessChain 17(cull) 23 29
Store 39 38
41: 26(ptr) AccessChain 17(cull) 31 25
Store 41 40
43: 26(ptr) AccessChain 17(cull) 31 29
Store 43 42
Return
FunctionEnd

View File

@ -0,0 +1,229 @@
hlsl.clipdistance-3.vert
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out 2-element array of float)
0:4 'cull' ( out 2-element array of float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 'clip' ( out 2-element array of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 'clip' ( out 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 0.600000
0:9 move second child to first child ( temp float)
0:9 direct index ( temp float)
0:9 'cull' ( out 2-element array of float)
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 0.525000
0:10 move second child to first child ( temp float)
0:10 direct index ( temp float)
0:10 'cull' ( out 2-element array of float)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 0.625000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp 2-element array of float)
0:? 'cull' ( temp 2-element array of float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp 2-element array of float)
0:? 'clip' ( out 2-element array of float ClipDistance)
0:? 'clip' ( temp 2-element array of float)
0:? Sequence
0:4 move second child to first child ( temp 2-element array of float)
0:? 'cull' ( out 2-element array of float CullDistance)
0:? 'cull' ( temp 2-element array of float)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 2-element array of float ClipDistance)
0:? 'cull' ( out 2-element array of float CullDistance)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp void)
0:4 Function Parameters:
0:4 'pos' ( out 4-component vector of float)
0:4 'clip' ( out 2-element array of float)
0:4 'cull' ( out 2-element array of float)
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:5 'pos' ( out 4-component vector of float)
0:5 Constant:
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:5 1.000000
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 'clip' ( out 2-element array of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.500000
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 'clip' ( out 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 0.600000
0:9 move second child to first child ( temp float)
0:9 direct index ( temp float)
0:9 'cull' ( out 2-element array of float)
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 0.525000
0:10 move second child to first child ( temp float)
0:10 direct index ( temp float)
0:10 'cull' ( out 2-element array of float)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 0.625000
0:4 Function Definition: main( ( temp void)
0:4 Function Parameters:
0:? Sequence
0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp void)
0:? 'pos' ( temp 4-component vector of float)
0:? 'clip' ( temp 2-element array of float)
0:? 'cull' ( temp 2-element array of float)
0:4 move second child to first child ( temp 4-component vector of float)
0:? 'pos' ( out 4-component vector of float Position)
0:? 'pos' ( temp 4-component vector of float)
0:? Sequence
0:4 move second child to first child ( temp 2-element array of float)
0:? 'clip' ( out 2-element array of float ClipDistance)
0:? 'clip' ( temp 2-element array of float)
0:? Sequence
0:4 move second child to first child ( temp 2-element array of float)
0:? 'cull' ( out 2-element array of float CullDistance)
0:? 'cull' ( temp 2-element array of float)
0:? Linker Objects
0:? 'pos' ( out 4-component vector of float Position)
0:? 'clip' ( out 2-element array of float ClipDistance)
0:? 'cull' ( out 2-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 51
Capability Shader
Capability ClipDistance
Capability CullDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 44 47 49
Source HLSL 500
Name 4 "main"
Name 17 "@main(vf4;f1[2];f1[2];"
Name 14 "pos"
Name 15 "clip"
Name 16 "cull"
Name 33 "pos"
Name 34 "clip"
Name 35 "cull"
Name 36 "param"
Name 37 "param"
Name 38 "param"
Name 44 "pos"
Name 47 "clip"
Name 49 "cull"
Decorate 44(pos) BuiltIn Position
Decorate 47(clip) BuiltIn ClipDistance
Decorate 49(cull) BuiltIn CullDistance
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeInt 32 0
10: 9(int) Constant 2
11: TypeArray 6(float) 10
12: TypePointer Function 11
13: TypeFunction 2 8(ptr) 12(ptr) 12(ptr)
19: 6(float) Constant 1065353216
20: 7(fvec4) ConstantComposite 19 19 19 19
21: TypeInt 32 1
22: 21(int) Constant 0
23: 6(float) Constant 1056964608
24: TypePointer Function 6(float)
26: 21(int) Constant 1
27: 6(float) Constant 1058642330
29: 6(float) Constant 1057384038
31: 6(float) Constant 1059061760
43: TypePointer Output 7(fvec4)
44(pos): 43(ptr) Variable Output
46: TypePointer Output 11
47(clip): 46(ptr) Variable Output
49(cull): 46(ptr) Variable Output
4(main): 2 Function None 3
5: Label
33(pos): 8(ptr) Variable Function
34(clip): 12(ptr) Variable Function
35(cull): 12(ptr) Variable Function
36(param): 8(ptr) Variable Function
37(param): 12(ptr) Variable Function
38(param): 12(ptr) Variable Function
39: 2 FunctionCall 17(@main(vf4;f1[2];f1[2];) 36(param) 37(param) 38(param)
40: 7(fvec4) Load 36(param)
Store 33(pos) 40
41: 11 Load 37(param)
Store 34(clip) 41
42: 11 Load 38(param)
Store 35(cull) 42
45: 7(fvec4) Load 33(pos)
Store 44(pos) 45
48: 11 Load 34(clip)
Store 47(clip) 48
50: 11 Load 35(cull)
Store 49(cull) 50
Return
FunctionEnd
17(@main(vf4;f1[2];f1[2];): 2 Function None 13
14(pos): 8(ptr) FunctionParameter
15(clip): 12(ptr) FunctionParameter
16(cull): 12(ptr) FunctionParameter
18: Label
Store 14(pos) 20
25: 24(ptr) AccessChain 15(clip) 22
Store 25 23
28: 24(ptr) AccessChain 15(clip) 26
Store 28 27
30: 24(ptr) AccessChain 16(cull) 22
Store 30 29
32: 24(ptr) AccessChain 16(cull) 26
Store 32 31
Return
FunctionEnd

View File

@ -0,0 +1,386 @@
hlsl.clipdistance-4.vert
Shader version: 500
0:? Sequence
0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Parameters:
0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position})
0:? Sequence
0:13 move second child to first child ( temp 4-component vector of float)
0:13 Position: direct index for structure ( temp 4-component vector of float)
0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:15 move second child to first child ( temp float)
0:15 direct index ( temp float)
0:15 ClipRect: direct index for structure ( temp 4-component vector of float)
0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 1.000000
0:16 move second child to first child ( temp float)
0:16 direct index ( temp float)
0:16 ClipRect: direct index for structure ( temp 4-component vector of float)
0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 2.000000
0:17 move second child to first child ( temp float)
0:17 direct index ( temp float)
0:17 ClipRect: direct index for structure ( temp 4-component vector of float)
0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 2 (const int)
0:17 Constant:
0:17 3.000000
0:18 move second child to first child ( temp float)
0:18 direct index ( temp float)
0:18 ClipRect: direct index for structure ( temp 4-component vector of float)
0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 3 (const int)
0:18 Constant:
0:18 4.000000
0:20 Branch: Return with expression
0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 Constant:
0:11 0 (const int)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 0 (const int)
0:? Sequence
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 0 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 1 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 2 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 2 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 3 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out structure{})
0:? 'Position' (layout( location=0) in 4-component vector of float)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Parameters:
0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position})
0:? Sequence
0:13 move second child to first child ( temp 4-component vector of float)
0:13 Position: direct index for structure ( temp 4-component vector of float)
0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:15 move second child to first child ( temp float)
0:15 direct index ( temp float)
0:15 ClipRect: direct index for structure ( temp 4-component vector of float)
0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 1.000000
0:16 move second child to first child ( temp float)
0:16 direct index ( temp float)
0:16 ClipRect: direct index for structure ( temp 4-component vector of float)
0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 2.000000
0:17 move second child to first child ( temp float)
0:17 direct index ( temp float)
0:17 ClipRect: direct index for structure ( temp 4-component vector of float)
0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 2 (const int)
0:17 Constant:
0:17 3.000000
0:18 move second child to first child ( temp float)
0:18 direct index ( temp float)
0:18 ClipRect: direct index for structure ( temp 4-component vector of float)
0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 3 (const int)
0:18 Constant:
0:18 4.000000
0:20 Branch: Return with expression
0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 Constant:
0:11 0 (const int)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 0 (const int)
0:? Sequence
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 0 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 1 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 2 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 2 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 3 (const int)
0:11 direct index ( temp float)
0:11 ClipRect: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 3 (const int)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out structure{})
0:? 'Position' (layout( location=0) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 75
Capability Shader
Capability ClipDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 43 50 56 74
Source HLSL 500
Name 4 "main"
Name 8 "VS_INPUT"
MemberName 8(VS_INPUT) 0 "Position"
Name 9 "VS_OUTPUT"
MemberName 9(VS_OUTPUT) 0 "Position"
MemberName 9(VS_OUTPUT) 1 "ClipRect"
Name 12 "@main(struct-VS_INPUT-vf41;"
Name 11 "v"
Name 15 "Output"
Name 41 "v"
Name 43 "Position"
Name 46 "flattenTemp"
Name 50 "@entryPointOutput_Position"
Name 56 "@entryPointOutput_ClipRect"
Name 72 "VS_OUTPUT"
Name 74 "@entryPointOutput"
Decorate 43(Position) Location 0
Decorate 50(@entryPointOutput_Position) BuiltIn Position
Decorate 56(@entryPointOutput_ClipRect) BuiltIn ClipDistance
Decorate 74(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(VS_INPUT): TypeStruct 7(fvec4)
9(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4)
10: TypeFunction 9(VS_OUTPUT) 8(VS_INPUT)
14: TypePointer Function 9(VS_OUTPUT)
16: TypeInt 32 1
17: 16(int) Constant 0
18: 6(float) Constant 0
19: 7(fvec4) ConstantComposite 18 18 18 18
20: TypePointer Function 7(fvec4)
22: 16(int) Constant 1
23: 6(float) Constant 1065353216
24: TypeInt 32 0
25: 24(int) Constant 0
26: TypePointer Function 6(float)
28: 6(float) Constant 1073741824
29: 24(int) Constant 1
31: 6(float) Constant 1077936128
32: 24(int) Constant 2
34: 6(float) Constant 1082130432
35: 24(int) Constant 3
40: TypePointer Function 8(VS_INPUT)
42: TypePointer Input 7(fvec4)
43(Position): 42(ptr) Variable Input
49: TypePointer Output 7(fvec4)
50(@entryPointOutput_Position): 49(ptr) Variable Output
53: 24(int) Constant 4
54: TypeArray 6(float) 53
55: TypePointer Output 54
56(@entryPointOutput_ClipRect): 55(ptr) Variable Output
59: TypePointer Output 6(float)
64: 16(int) Constant 2
68: 16(int) Constant 3
72(VS_OUTPUT): TypeStruct
73: TypePointer Output 72(VS_OUTPUT)
74(@entryPointOutput): 73(ptr) Variable Output
4(main): 2 Function None 3
5: Label
41(v): 40(ptr) Variable Function
46(flattenTemp): 14(ptr) Variable Function
44: 7(fvec4) Load 43(Position)
45: 20(ptr) AccessChain 41(v) 17
Store 45 44
47: 8(VS_INPUT) Load 41(v)
48:9(VS_OUTPUT) FunctionCall 12(@main(struct-VS_INPUT-vf41;) 47
Store 46(flattenTemp) 48
51: 20(ptr) AccessChain 46(flattenTemp) 17
52: 7(fvec4) Load 51
Store 50(@entryPointOutput_Position) 52
57: 26(ptr) AccessChain 46(flattenTemp) 22 25
58: 6(float) Load 57
60: 59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 17
Store 60 58
61: 26(ptr) AccessChain 46(flattenTemp) 22 29
62: 6(float) Load 61
63: 59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 22
Store 63 62
65: 26(ptr) AccessChain 46(flattenTemp) 22 32
66: 6(float) Load 65
67: 59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 64
Store 67 66
69: 26(ptr) AccessChain 46(flattenTemp) 22 35
70: 6(float) Load 69
71: 59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 68
Store 71 70
Return
FunctionEnd
12(@main(struct-VS_INPUT-vf41;):9(VS_OUTPUT) Function None 10
11(v): 8(VS_INPUT) FunctionParameter
13: Label
15(Output): 14(ptr) Variable Function
21: 20(ptr) AccessChain 15(Output) 17
Store 21 19
27: 26(ptr) AccessChain 15(Output) 22 25
Store 27 23
30: 26(ptr) AccessChain 15(Output) 22 29
Store 30 28
33: 26(ptr) AccessChain 15(Output) 22 32
Store 33 31
36: 26(ptr) AccessChain 15(Output) 22 35
Store 36 34
37:9(VS_OUTPUT) Load 15(Output)
ReturnValue 37
FunctionEnd

View File

@ -0,0 +1,435 @@
hlsl.clipdistance-5.vert
Shader version: 500
0:? Sequence
0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Parameters:
0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position})
0:? Sequence
0:13 move second child to first child ( temp 4-component vector of float)
0:13 Position: direct index for structure ( temp 4-component vector of float)
0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:15 move second child to first child ( temp float)
0:15 direct index ( temp float)
0:15 direct index ( temp 2-component vector of float)
0:15 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 1.000000
0:16 move second child to first child ( temp float)
0:16 direct index ( temp float)
0:16 direct index ( temp 2-component vector of float)
0:16 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 2.000000
0:17 move second child to first child ( temp float)
0:17 direct index ( temp float)
0:17 direct index ( temp 2-component vector of float)
0:17 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 0 (const int)
0:17 Constant:
0:17 3.000000
0:18 move second child to first child ( temp float)
0:18 direct index ( temp float)
0:18 direct index ( temp 2-component vector of float)
0:18 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 4.000000
0:20 Branch: Return with expression
0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 Constant:
0:11 0 (const int)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 0 (const int)
0:? Sequence
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 0 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 1 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 2 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 3 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out structure{})
0:? 'Position' (layout( location=0) in 4-component vector of float)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Parameters:
0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position})
0:? Sequence
0:13 move second child to first child ( temp 4-component vector of float)
0:13 Position: direct index for structure ( temp 4-component vector of float)
0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:13 Constant:
0:13 0 (const int)
0:13 Constant:
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:13 0.000000
0:15 move second child to first child ( temp float)
0:15 direct index ( temp float)
0:15 direct index ( temp 2-component vector of float)
0:15 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 1.000000
0:16 move second child to first child ( temp float)
0:16 direct index ( temp float)
0:16 direct index ( temp 2-component vector of float)
0:16 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 1 (const int)
0:16 Constant:
0:16 2.000000
0:17 move second child to first child ( temp float)
0:17 direct index ( temp float)
0:17 direct index ( temp 2-component vector of float)
0:17 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 1 (const int)
0:17 Constant:
0:17 0 (const int)
0:17 Constant:
0:17 3.000000
0:18 move second child to first child ( temp float)
0:18 direct index ( temp float)
0:18 direct index ( temp 2-component vector of float)
0:18 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 1 (const int)
0:18 Constant:
0:18 4.000000
0:20 Branch: Return with expression
0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 Constant:
0:11 0 (const int)
0:? 'Position' (layout( location=0) in 4-component vector of float)
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:? 'v' ( temp structure{ temp 4-component vector of float Position})
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput_Position' ( out 4-component vector of float Position)
0:11 Position: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 0 (const int)
0:? Sequence
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 0 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 1 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 2 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:? '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
0:11 Constant:
0:11 3 (const int)
0:11 direct index ( temp float)
0:11 direct index ( temp 2-component vector of float)
0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect})
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out structure{})
0:? 'Position' (layout( location=0) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 76
Capability Shader
Capability ClipDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 44 51 57 75
Source HLSL 500
Name 4 "main"
Name 8 "VS_INPUT"
MemberName 8(VS_INPUT) 0 "Position"
Name 13 "VS_OUTPUT"
MemberName 13(VS_OUTPUT) 0 "Position"
MemberName 13(VS_OUTPUT) 1 "ClipRect"
Name 16 "@main(struct-VS_INPUT-vf41;"
Name 15 "v"
Name 19 "Output"
Name 42 "v"
Name 44 "Position"
Name 47 "flattenTemp"
Name 51 "@entryPointOutput_Position"
Name 57 "@entryPointOutput_ClipRect"
Name 73 "VS_OUTPUT"
Name 75 "@entryPointOutput"
Decorate 44(Position) Location 0
Decorate 51(@entryPointOutput_Position) BuiltIn Position
Decorate 57(@entryPointOutput_ClipRect) BuiltIn ClipDistance
Decorate 75(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(VS_INPUT): TypeStruct 7(fvec4)
9: TypeVector 6(float) 2
10: TypeInt 32 0
11: 10(int) Constant 2
12: TypeArray 9(fvec2) 11
13(VS_OUTPUT): TypeStruct 7(fvec4) 12
14: TypeFunction 13(VS_OUTPUT) 8(VS_INPUT)
18: TypePointer Function 13(VS_OUTPUT)
20: TypeInt 32 1
21: 20(int) Constant 0
22: 6(float) Constant 0
23: 7(fvec4) ConstantComposite 22 22 22 22
24: TypePointer Function 7(fvec4)
26: 20(int) Constant 1
27: 6(float) Constant 1065353216
28: 10(int) Constant 0
29: TypePointer Function 6(float)
31: 6(float) Constant 1073741824
32: 10(int) Constant 1
34: 6(float) Constant 1077936128
36: 6(float) Constant 1082130432
41: TypePointer Function 8(VS_INPUT)
43: TypePointer Input 7(fvec4)
44(Position): 43(ptr) Variable Input
50: TypePointer Output 7(fvec4)
51(@entryPointOutput_Position): 50(ptr) Variable Output
54: 10(int) Constant 4
55: TypeArray 6(float) 54
56: TypePointer Output 55
57(@entryPointOutput_ClipRect): 56(ptr) Variable Output
60: TypePointer Output 6(float)
65: 20(int) Constant 2
69: 20(int) Constant 3
73(VS_OUTPUT): TypeStruct
74: TypePointer Output 73(VS_OUTPUT)
75(@entryPointOutput): 74(ptr) Variable Output
4(main): 2 Function None 3
5: Label
42(v): 41(ptr) Variable Function
47(flattenTemp): 18(ptr) Variable Function
45: 7(fvec4) Load 44(Position)
46: 24(ptr) AccessChain 42(v) 21
Store 46 45
48: 8(VS_INPUT) Load 42(v)
49:13(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-vf41;) 48
Store 47(flattenTemp) 49
52: 24(ptr) AccessChain 47(flattenTemp) 21
53: 7(fvec4) Load 52
Store 51(@entryPointOutput_Position) 53
58: 29(ptr) AccessChain 47(flattenTemp) 26 21 28
59: 6(float) Load 58
61: 60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 21
Store 61 59
62: 29(ptr) AccessChain 47(flattenTemp) 26 21 32
63: 6(float) Load 62
64: 60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 26
Store 64 63
66: 29(ptr) AccessChain 47(flattenTemp) 26 26 28
67: 6(float) Load 66
68: 60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 65
Store 68 67
70: 29(ptr) AccessChain 47(flattenTemp) 26 26 32
71: 6(float) Load 70
72: 60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 69
Store 72 71
Return
FunctionEnd
16(@main(struct-VS_INPUT-vf41;):13(VS_OUTPUT) Function None 14
15(v): 8(VS_INPUT) FunctionParameter
17: Label
19(Output): 18(ptr) Variable Function
25: 24(ptr) AccessChain 19(Output) 21
Store 25 23
30: 29(ptr) AccessChain 19(Output) 26 21 28
Store 30 27
33: 29(ptr) AccessChain 19(Output) 26 21 32
Store 33 31
35: 29(ptr) AccessChain 19(Output) 26 26 28
Store 35 34
37: 29(ptr) AccessChain 19(Output) 26 26 32
Store 37 36
38:13(VS_OUTPUT) Load 19(Output)
ReturnValue 38
FunctionEnd

View File

@ -24,18 +24,26 @@ output primitive = line_strip
0:12 Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
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:? '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:? '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:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? 'OutputStream_clip0' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
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:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? 'OutputStream_cull0' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
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:? 'OutputStream_vpai' ( out uint ViewportIndex)
0:12 vpai: direct index for structure ( temp uint)
@ -92,18 +100,26 @@ output primitive = line_strip
0:12 Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; ( temp structure{ temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
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:? '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:? '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:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? 'OutputStream_clip0' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
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:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? 'OutputStream_cull0' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
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:? 'OutputStream_vpai' ( out uint ViewportIndex)
0:12 vpai: direct index for structure ( temp uint)
@ -133,7 +149,7 @@ output primitive = line_strip
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 66
// Id's are bound by 71
Capability Geometry
Capability ClipDistance
@ -141,7 +157,7 @@ output primitive = line_strip
Capability MultiViewport
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 25 35 40 45 50 56 65
EntryPoint Geometry 4 "main" 25 37 44 50 55 61 70
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputLineStrip
@ -164,23 +180,23 @@ output primitive = line_strip
Name 28 "OutputStream"
Name 29 "param"
Name 31 "param"
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"
Name 37 "OutputStream_clip0"
Name 44 "OutputStream_cull0"
Name 50 "OutputStream_vpai"
Name 55 "OutputStream_rtai"
Name 59 "S"
MemberName 59(S) 0 "ii"
Name 61 "@entryPointOutput"
Name 68 "S"
MemberName 68(S) 0 "ii"
Name 70 "OutputStream"
Decorate 25(VertexID) 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
Decorate 37(OutputStream_clip0) BuiltIn ClipDistance
Decorate 44(OutputStream_cull0) BuiltIn CullDistance
Decorate 50(OutputStream_vpai) BuiltIn ViewportIndex
Decorate 55(OutputStream_rtai) BuiltIn Layer
Decorate 61(@entryPointOutput) Location 0
Decorate 70(OutputStream) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -194,27 +210,30 @@ output primitive = line_strip
14: TypeFunction 12(S) 9(ptr) 13(ptr)
24: TypePointer Input 8
25(VertexID): 24(ptr) Variable Input
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
34: 6(int) Constant 1
35: TypeArray 10(float) 34
36: TypePointer Output 35
37(OutputStream_clip0): 36(ptr) Variable Output
38: 11(int) Constant 0
39: TypePointer Function 10(float)
42: TypePointer Output 10(float)
44(OutputStream_cull0): 36(ptr) Variable Output
45: 11(int) Constant 1
49: TypePointer Output 6(int)
50(OutputStream_vpai): 49(ptr) Variable Output
51: 11(int) Constant 2
52: TypePointer Function 6(int)
55(OutputStream_rtai): 49(ptr) Variable Output
56: 11(int) Constant 3
59(S): TypeStruct 11(int)
60: TypePointer Output 59(S)
61(@entryPointOutput): 60(ptr) Variable Output
62: 11(int) Constant 4
63: TypePointer Function 11(int)
66: TypePointer Output 11(int)
68(S): TypeStruct 11(int)
69: TypePointer Output 68(S)
70(OutputStream): 69(ptr) Variable Output
4(main): 2 Function None 3
5: Label
23(VertexID): 9(ptr) Variable Function
@ -230,22 +249,24 @@ output primitive = line_strip
33: 12(S) Load 31(param)
Store 28(OutputStream) 33
Store 27(flattenTemp) 32
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
40: 39(ptr) AccessChain 27(flattenTemp) 38
41: 10(float) Load 40
43: 42(ptr) AccessChain 37(OutputStream_clip0) 38
Store 43 41
46: 39(ptr) AccessChain 27(flattenTemp) 45
47: 10(float) Load 46
48: 42(ptr) AccessChain 44(OutputStream_cull0) 38
Store 48 47
53: 52(ptr) AccessChain 27(flattenTemp) 51
54: 6(int) Load 53
Store 50(OutputStream_vpai) 54
57: 52(ptr) AccessChain 27(flattenTemp) 56
58: 6(int) Load 57
Store 55(OutputStream_rtai) 58
64: 63(ptr) AccessChain 27(flattenTemp) 62
65: 11(int) Load 64
67: 66(ptr) AccessChain 61(@entryPointOutput) 38
Store 67 65
Return
FunctionEnd
17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;): 12(S) Function None 14

View File

@ -58,42 +58,66 @@ Shader version: 500
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:? 'ins' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 0 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip0: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 1 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip7: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 2 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 3 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull2: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 4 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull5: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 5 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 0 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip0: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 1 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip7: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 2 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 3 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull2: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 4 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull5: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 5 (const int)
0:12 move second child to first child ( temp int)
0:12 ii: direct index for structure ( temp int)
0:12 '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
@ -176,42 +200,66 @@ Shader version: 500
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:? 'ins' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 0 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip0: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 1 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_clip7' ( out float ClipDistance)
0:12 clip7: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 2 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 3 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull2: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 4 (const int)
0:12 move second child to first child ( temp float)
0:? '@entryPointOutput_cull5' ( out float CullDistance)
0:12 cull5: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 5 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 0 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip0: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 1 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_clip7' ( out 1-element array of float ClipDistance)
0:12 Constant:
0:12 0 (const int)
0:12 clip7: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 2 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 3 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull2: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 4 (const int)
0:? Sequence
0:12 move second child to first child ( temp float)
0:12 direct index ( temp float)
0:? '@entryPointOutput_cull5' ( out 1-element array of float CullDistance)
0:12 Constant:
0:12 0 (const int)
0:12 cull5: direct index for structure ( temp float)
0:12 'flattenTemp' ( temp structure{ temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
0:12 Constant:
0:12 5 (const int)
0:12 move second child to first child ( temp int)
0:12 ii: direct index for structure ( temp int)
0:12 '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
@ -233,14 +281,14 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 77
// Id's are bound by 87
Capability Shader
Capability ClipDistance
Capability CullDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 21 26 30 34 38 42 47 56 63 72
EntryPoint Vertex 4 "main" 21 26 30 34 38 42 47 59 70 82
Source HLSL 500
Name 4 "main"
Name 8 "S"
@ -264,11 +312,11 @@ Shader version: 500
Name 47 "ii"
Name 51 "flattenTemp"
Name 52 "param"
Name 56 "@entryPointOutput_clip7"
Name 63 "@entryPointOutput_cull5"
Name 70 "S"
MemberName 70(S) 0 "ii"
Name 72 "@entryPointOutput"
Name 59 "@entryPointOutput_clip7"
Name 70 "@entryPointOutput_cull5"
Name 80 "S"
MemberName 80(S) 0 "ii"
Name 82 "@entryPointOutput"
Decorate 21(clip) Location 0
Decorate 26(clip0) Location 1
Decorate 30(clip7) Location 2
@ -276,9 +324,9 @@ Shader version: 500
Decorate 38(cull2) Location 4
Decorate 42(cull5) Location 5
Decorate 47(ii) BuiltIn InstanceIndex
Decorate 56(@entryPointOutput_clip7) BuiltIn ClipDistance
Decorate 63(@entryPointOutput_cull5) BuiltIn CullDistance
Decorate 72(@entryPointOutput) Location 0
Decorate 59(@entryPointOutput_clip7) BuiltIn ClipDistance
Decorate 70(@entryPointOutput_cull5) BuiltIn CullDistance
Decorate 82(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -304,13 +352,17 @@ Shader version: 500
46: TypePointer Input 7(int)
47(ii): 46(ptr) Variable Input
49: TypePointer Function 7(int)
55: TypePointer Output 6(float)
56(@entryPointOutput_clip7): 55(ptr) Variable Output
63(@entryPointOutput_cull5): 55(ptr) Variable Output
70(S): TypeStruct 7(int)
71: TypePointer Output 70(S)
72(@entryPointOutput): 71(ptr) Variable Output
75: TypePointer Output 7(int)
55: TypeInt 32 0
56: 55(int) Constant 1
57: TypeArray 6(float) 56
58: TypePointer Output 57
59(@entryPointOutput_clip7): 58(ptr) Variable Output
62: TypePointer Output 6(float)
70(@entryPointOutput_cull5): 58(ptr) Variable Output
80(S): TypeStruct 7(int)
81: TypePointer Output 80(S)
82(@entryPointOutput): 81(ptr) Variable Output
85: TypePointer Output 7(int)
4(main): 2 Function None 3
5: Label
18(ins): 9(ptr) Variable Function
@ -341,28 +393,34 @@ Shader version: 500
Store 52(param) 53
54: 8(S) FunctionCall 12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;) 52(param)
Store 51(flattenTemp) 54
57: 23(ptr) AccessChain 51(flattenTemp) 19
58: 6(float) Load 57
Store 56(@entryPointOutput_clip7) 58
59: 23(ptr) AccessChain 51(flattenTemp) 25
60: 6(float) Load 59
Store 56(@entryPointOutput_clip7) 60
61: 23(ptr) AccessChain 51(flattenTemp) 29
62: 6(float) Load 61
Store 56(@entryPointOutput_clip7) 62
64: 23(ptr) AccessChain 51(flattenTemp) 33
60: 23(ptr) AccessChain 51(flattenTemp) 19
61: 6(float) Load 60
63: 62(ptr) AccessChain 59(@entryPointOutput_clip7) 19
Store 63 61
64: 23(ptr) AccessChain 51(flattenTemp) 25
65: 6(float) Load 64
Store 63(@entryPointOutput_cull5) 65
66: 23(ptr) AccessChain 51(flattenTemp) 37
67: 6(float) Load 66
Store 63(@entryPointOutput_cull5) 67
68: 23(ptr) AccessChain 51(flattenTemp) 41
69: 6(float) Load 68
Store 63(@entryPointOutput_cull5) 69
73: 49(ptr) AccessChain 51(flattenTemp) 45
74: 7(int) Load 73
76: 75(ptr) AccessChain 72(@entryPointOutput) 19
Store 76 74
66: 62(ptr) AccessChain 59(@entryPointOutput_clip7) 19
Store 66 65
67: 23(ptr) AccessChain 51(flattenTemp) 29
68: 6(float) Load 67
69: 62(ptr) AccessChain 59(@entryPointOutput_clip7) 19
Store 69 68
71: 23(ptr) AccessChain 51(flattenTemp) 33
72: 6(float) Load 71
73: 62(ptr) AccessChain 70(@entryPointOutput_cull5) 19
Store 73 72
74: 23(ptr) AccessChain 51(flattenTemp) 37
75: 6(float) Load 74
76: 62(ptr) AccessChain 70(@entryPointOutput_cull5) 19
Store 76 75
77: 23(ptr) AccessChain 51(flattenTemp) 41
78: 6(float) Load 77
79: 62(ptr) AccessChain 70(@entryPointOutput_cull5) 19
Store 79 78
83: 49(ptr) AccessChain 51(flattenTemp) 45
84: 7(int) Load 83
86: 85(ptr) AccessChain 82(@entryPointOutput) 19
Store 86 84
Return
FunctionEnd
12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;): 8(S) Function None 10

View File

@ -0,0 +1,8 @@
void main(out float4 pos : SV_Position,
out float clip : SV_ClipDistance, // scalar float
out float cull : SV_CullDistance) // scalar float
{
pos = 1.0f.xxxx;
clip = 0.5f;
cull = 0.51f;
}

View File

@ -0,0 +1,15 @@
void main(out float4 pos : SV_Position,
out float2 clip[2] : SV_ClipDistance, // array of vector float
out float2 cull[2] : SV_CullDistance) // array of vector float
{
pos = 1.0f.xxxx;
clip[0].x = 0.5f;
clip[0].y = 0.6f;
clip[1].x = 0.7f;
clip[1].y = 0.8f;
cull[0].x = 0.525f;
cull[0].y = 0.625f;
cull[1].x = 0.725f;
cull[1].y = 0.825f;
}

View File

@ -0,0 +1,13 @@
void main(out float4 pos : SV_Position,
out float clip[2] : SV_ClipDistance, // array of scalar float
out float cull[2] : SV_CullDistance) // array of scalar float
{
pos = 1.0f.xxxx;
clip[0] = 0.5f;
clip[1] = 0.6f;
cull[0] = 0.525f;
cull[1] = 0.625f;
}

View File

@ -0,0 +1,21 @@
struct VS_INPUT {
float4 Position : POSITION;
};
struct VS_OUTPUT {
float4 Position : SV_Position;
float4 ClipRect : SV_ClipDistance0; // vector in split struct
};
VS_OUTPUT main(const VS_INPUT v)
{
VS_OUTPUT Output;
Output.Position = 0;
Output.ClipRect.x = 1;
Output.ClipRect.y = 2;
Output.ClipRect.z = 3;
Output.ClipRect.w = 4;
return Output;
}

View File

@ -0,0 +1,21 @@
struct VS_INPUT {
float4 Position : POSITION;
};
struct VS_OUTPUT {
float4 Position : SV_Position;
float2 ClipRect[2] : SV_ClipDistance0; // array of float2 in split struct
};
VS_OUTPUT main(const VS_INPUT v)
{
VS_OUTPUT Output;
Output.Position = 0;
Output.ClipRect[0].x = 1;
Output.ClipRect[0].y = 2;
Output.ClipRect[1].x = 3;
Output.ClipRect[1].y = 4;
return Output;
}

View File

@ -97,6 +97,11 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.cast.frag", "PixelShaderFunction"},
{"hlsl.charLit.vert", "main"},
{"hlsl.clip.frag", "main"},
{"hlsl.clipdistance-1.vert", "main"},
{"hlsl.clipdistance-2.vert", "main"},
{"hlsl.clipdistance-3.vert", "main"},
{"hlsl.clipdistance-4.vert", "main"},
{"hlsl.clipdistance-5.vert", "main"},
{"hlsl.comparison.vec.frag", "main"},
{"hlsl.conditional.frag", "PixelShaderFunction"},
{"hlsl.constantbuffer.frag", "main"},

View File

@ -1492,9 +1492,25 @@ void HlslParseContext::fixBuiltInIoType(TType& type)
switch (type.getQualifier().builtIn) {
case EbvTessLevelOuter: requiredArraySize = 4; break;
case EbvTessLevelInner: requiredArraySize = 2; break;
case EbvClipDistance: // TODO: ...
case EbvCullDistance: // TODO: ...
return;
case EbvClipDistance:
case EbvCullDistance:
{
// ClipDistance and CullDistance are handled specially in the entry point output
// copy algorithm, because they may need to be unpacked from components of vectors
// (or a scalar) into a float array. Here, we make the array the right size and type,
// which is the number of components per vector times the array size (or 1 if not
// an array). The copy itself is handled in assignClipCullDistance().
requiredArraySize = type.getVectorSize() * (type.isArray() ? type.getOuterArraySize() : 1);
TType clipCullType(EbtFloat, type.getQualifier().storage, 1);
clipCullType.getQualifier() = type.getQualifier();
type.shallowCopy(clipCullType);
break;
}
case EbvTessCoord:
{
// tesscoord is always a vec3 for the IO variable, no matter the shader's
@ -2290,6 +2306,88 @@ void HlslParseContext::handleFunctionArgument(TFunction* function,
arguments = newArg;
}
// Clip and cull distance require special handling due to a semantic mismatch. In HLSL,
// these can be float scalar, float vector, or arrays of float scalar or float vector.
// In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components
// (e.g, both x and y components of a float2) out into the destination float array.
//
// The values are assigned to sequential members of the output array. The inner dimension
// is vector components. The outer dimension is array elements.
TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc, TOperator op,
TIntermTyped* left, TIntermTyped* right)
{
// ***
// TODO: this does not yet handle the index coming from the semantic's ID, as in SV_ClipDistance[012345...]
// ***
// left has got to be an array of scalar floats, per SPIR-V semantics.
// fixBuiltInIoType() should have handled that upstream.
assert(left->getType().isArray());
assert(left->getType().getVectorSize() == 1);
assert(left->getType().getBasicType() == EbtFloat);
// array sizes, or 1 if it's not an array:
const int lhsArraySize = (left->getType().isArray() ? left->getType().getOuterArraySize() : 1);
const int rhsArraySize = (right->getType().isArray() ? right->getType().getOuterArraySize() : 1);
// vector sizes:
const int lhsVectorSize = left->getType().getVectorSize();
const int rhsVectorSize = right->getType().getVectorSize();
// We may be creating multiple sub-assignments. This is an aggregate to hold them.
// TODO: it would be possible to be clever sometimes and avoid the sequence node if not needed.
TIntermAggregate* assignList = nullptr;
// If the types are homomorphic, use a simple assign. No need to mess about with
// individual components.
if (left->getType().isArray() == right->getType().isArray() &&
lhsArraySize == rhsArraySize &&
lhsVectorSize == rhsVectorSize) {
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc));
assignList->setOperator(EOpSequence);
return assignList;
}
// We are going to copy each component of the right (per array element if indicated) to sequential
// array elements of the left. This tracks the lhs element we're writing to as we go along.
int lhsArrayPos = 0;
// Loop through every component of every element of the RHS, and copy to LHS elements in turn.
for (int rhsArrayPos = 0; rhsArrayPos < rhsArraySize; ++rhsArrayPos) {
for (int rhsComponent = 0; rhsComponent < rhsVectorSize; ++rhsComponent) {
// LHS array member to write to:
TIntermTyped* lhsMember = intermediate.addIndex(EOpIndexDirect, left,
intermediate.addConstantUnion(lhsArrayPos++, loc), loc);
TIntermTyped* rhsMember = right;
// If right is an array, extract the element of interest
if (right->getType().isArray()) {
const TType derefType(rhsMember->getType(), 0);
rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember,
intermediate.addConstantUnion(rhsArrayPos, loc), loc);
rhsMember->setType(derefType);
}
// If right is a vector, extract the component of interest.
if (right->getType().isVector()) {
const TType derefType(rhsMember->getType(), 0);
rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember,
intermediate.addConstantUnion(rhsComponent, loc), loc);
rhsMember->setType(derefType);
}
// Assign: to the proper lhs member.
assignList = intermediate.growAggregate(assignList,
intermediate.addAssign(op, lhsMember, rhsMember, loc));
}
}
assert(assignList != nullptr);
assignList->setOperator(EOpSequence);
return assignList;
}
// Some simple source assignments need to be flattened to a sequence
// of AST assignments. Catch these and flatten, otherwise, pass through
// to intermediate.addAssign().
@ -2312,8 +2410,14 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
// OK to do a single assign if both are split, or both are unsplit. But if one is and the other
// isn't, we fall back to a member-wise copy.
if (! isFlattenLeft && ! isFlattenRight && !isSplitLeft && !isSplitRight)
if (! isFlattenLeft && ! isFlattenRight && !isSplitLeft && !isSplitRight) {
// Clip and cull distance requires more processing. See comment above assignClipCullDistance.
const TBuiltInVariable leftBuiltIn = left->getType().getQualifier().builtIn;
if (leftBuiltIn == EbvClipDistance || leftBuiltIn == EbvCullDistance)
return assignClipCullDistance(loc, op, left, right);
return intermediate.addAssign(op, left, right, loc);
}
TIntermAggregate* assignList = nullptr;
const TVector<TVariable*>* leftVariables = nullptr;
@ -2474,13 +2578,21 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left, member, splitLeft, memberL) : subLeft;
TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR) : subRight;
// If this is the final flattening (no nested types below to flatten) we'll copy the member, else
// recurse into the type hierarchy. However, if splitting the struct, that means we can copy a whole
// subtree here IFF it does not itself contain any interstage built-in IO variables, so we only have to
// recurse into it if there's something for splitting to do. That can save a lot of AST verbosity for
// a bunch of memberwise copies.
if ((!isFlattenLeft && !isFlattenRight &&
!typeL.containsBuiltInInterstageIO(language) && !typeR.containsBuiltInInterstageIO(language))) {
const TBuiltInVariable leftBuiltIn = subSplitLeft->getType().getQualifier().builtIn;
if (leftBuiltIn == EbvClipDistance || leftBuiltIn == EbvCullDistance) {
// Clip and cull distance builtin assignment is complex in its own right, and is handled in
// a separate function dedicated to that task. See comment above assignClipCullDistance;
assignList = intermediate.growAggregate(assignList, assignClipCullDistance(loc, op, subSplitLeft, subSplitRight), loc);
} else if ((!isFlattenLeft && !isFlattenRight &&
!typeL.containsBuiltInInterstageIO(language) && !typeR.containsBuiltInInterstageIO(language))) {
// If this is the final flattening (no nested types below to flatten) we'll copy the member, else
// recurse into the type hierarchy. However, if splitting the struct, that means we can copy a whole
// subtree here IFF it does not itself contain any interstage built-in IO variables, so we only have to
// recurse into it if there's something for splitting to do. That can save a lot of AST verbosity for
// a bunch of memberwise copies.
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), loc);
} else {
traverse(subLeft, subRight, subSplitLeft, subSplitRight);

View File

@ -90,6 +90,7 @@ public:
TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);