SPV: Emit OpSelect when a selection node is simple enough.
Also, ensures it has a type, no disallowed side effects, or performance trade offs.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
spv.140.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 101
|
||||
// Id's are bound by 96
|
||||
|
||||
Capability Shader
|
||||
Capability ClipDistance
|
||||
@@ -10,168 +10,157 @@ spv.140.frag
|
||||
Capability ImageQuery
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 16 28 33 43
|
||||
EntryPoint Fragment 4 "main" 14 23 28 38
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 140
|
||||
Name 4 "main"
|
||||
Name 8 "foo("
|
||||
Name 11 "i1"
|
||||
Name 16 "gl_FrontFacing"
|
||||
Name 24 "i2"
|
||||
Name 28 "o"
|
||||
Name 33 "gl_ClipDistance"
|
||||
Name 43 "k"
|
||||
Name 55 "sampR"
|
||||
Name 63 "sampB"
|
||||
Name 87 "samp2Da"
|
||||
Name 92 "bn"
|
||||
MemberName 92(bn) 0 "matra"
|
||||
MemberName 92(bn) 1 "matca"
|
||||
MemberName 92(bn) 2 "matr"
|
||||
MemberName 92(bn) 3 "matc"
|
||||
MemberName 92(bn) 4 "matrdef"
|
||||
Name 94 ""
|
||||
Name 97 "bi"
|
||||
MemberName 97(bi) 0 "v"
|
||||
Name 100 "bname"
|
||||
Decorate 16(gl_FrontFacing) BuiltIn FrontFacing
|
||||
Decorate 33(gl_ClipDistance) BuiltIn ClipDistance
|
||||
Decorate 55(sampR) DescriptorSet 0
|
||||
Decorate 63(sampB) DescriptorSet 0
|
||||
Decorate 87(samp2Da) DescriptorSet 0
|
||||
Decorate 90 ArrayStride 64
|
||||
Decorate 91 ArrayStride 64
|
||||
MemberDecorate 92(bn) 0 RowMajor
|
||||
MemberDecorate 92(bn) 0 Offset 0
|
||||
MemberDecorate 92(bn) 0 MatrixStride 16
|
||||
MemberDecorate 92(bn) 1 ColMajor
|
||||
MemberDecorate 92(bn) 1 Offset 256
|
||||
MemberDecorate 92(bn) 1 MatrixStride 16
|
||||
MemberDecorate 92(bn) 2 RowMajor
|
||||
MemberDecorate 92(bn) 2 Offset 512
|
||||
MemberDecorate 92(bn) 2 MatrixStride 16
|
||||
MemberDecorate 92(bn) 3 ColMajor
|
||||
MemberDecorate 92(bn) 3 Offset 576
|
||||
MemberDecorate 92(bn) 3 MatrixStride 16
|
||||
MemberDecorate 92(bn) 4 RowMajor
|
||||
MemberDecorate 92(bn) 4 Offset 640
|
||||
MemberDecorate 92(bn) 4 MatrixStride 16
|
||||
Decorate 92(bn) Block
|
||||
Decorate 94 DescriptorSet 0
|
||||
Decorate 96 ArrayStride 16
|
||||
MemberDecorate 97(bi) 0 Offset 0
|
||||
Decorate 97(bi) Block
|
||||
Decorate 100(bname) DescriptorSet 0
|
||||
Name 14 "gl_FrontFacing"
|
||||
Name 19 "i2"
|
||||
Name 23 "o"
|
||||
Name 28 "gl_ClipDistance"
|
||||
Name 38 "k"
|
||||
Name 50 "sampR"
|
||||
Name 58 "sampB"
|
||||
Name 82 "samp2Da"
|
||||
Name 87 "bn"
|
||||
MemberName 87(bn) 0 "matra"
|
||||
MemberName 87(bn) 1 "matca"
|
||||
MemberName 87(bn) 2 "matr"
|
||||
MemberName 87(bn) 3 "matc"
|
||||
MemberName 87(bn) 4 "matrdef"
|
||||
Name 89 ""
|
||||
Name 92 "bi"
|
||||
MemberName 92(bi) 0 "v"
|
||||
Name 95 "bname"
|
||||
Decorate 14(gl_FrontFacing) BuiltIn FrontFacing
|
||||
Decorate 28(gl_ClipDistance) BuiltIn ClipDistance
|
||||
Decorate 50(sampR) DescriptorSet 0
|
||||
Decorate 58(sampB) DescriptorSet 0
|
||||
Decorate 82(samp2Da) DescriptorSet 0
|
||||
Decorate 85 ArrayStride 64
|
||||
Decorate 86 ArrayStride 64
|
||||
MemberDecorate 87(bn) 0 RowMajor
|
||||
MemberDecorate 87(bn) 0 Offset 0
|
||||
MemberDecorate 87(bn) 0 MatrixStride 16
|
||||
MemberDecorate 87(bn) 1 ColMajor
|
||||
MemberDecorate 87(bn) 1 Offset 256
|
||||
MemberDecorate 87(bn) 1 MatrixStride 16
|
||||
MemberDecorate 87(bn) 2 RowMajor
|
||||
MemberDecorate 87(bn) 2 Offset 512
|
||||
MemberDecorate 87(bn) 2 MatrixStride 16
|
||||
MemberDecorate 87(bn) 3 ColMajor
|
||||
MemberDecorate 87(bn) 3 Offset 576
|
||||
MemberDecorate 87(bn) 3 MatrixStride 16
|
||||
MemberDecorate 87(bn) 4 RowMajor
|
||||
MemberDecorate 87(bn) 4 Offset 640
|
||||
MemberDecorate 87(bn) 4 MatrixStride 16
|
||||
Decorate 87(bn) Block
|
||||
Decorate 89 DescriptorSet 0
|
||||
Decorate 91 ArrayStride 16
|
||||
MemberDecorate 92(bi) 0 Offset 0
|
||||
Decorate 92(bi) Block
|
||||
Decorate 95(bname) DescriptorSet 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeFunction 6(float)
|
||||
10: TypePointer Private 6(float)
|
||||
11(i1): 10(ptr) Variable Private
|
||||
12: TypePointer Function 6(float)
|
||||
14: TypeBool
|
||||
15: TypePointer Input 14(bool)
|
||||
16(gl_FrontFacing): 15(ptr) Variable Input
|
||||
20: 6(float) Constant 3221225472
|
||||
22: 6(float) Constant 1073741824
|
||||
24(i2): 10(ptr) Variable Private
|
||||
25: 6(float) Constant 1120665600
|
||||
26: TypeVector 6(float) 4
|
||||
27: TypePointer Output 26(fvec4)
|
||||
28(o): 27(ptr) Variable Output
|
||||
29: TypeInt 32 0
|
||||
30: 29(int) Constant 5
|
||||
31: TypeArray 6(float) 30
|
||||
32: TypePointer Input 31
|
||||
33(gl_ClipDistance): 32(ptr) Variable Input
|
||||
34: TypeInt 32 1
|
||||
35: 34(int) Constant 2
|
||||
36: TypePointer Input 6(float)
|
||||
39: 29(int) Constant 1
|
||||
40: TypePointer Output 6(float)
|
||||
42: TypePointer Input 26(fvec4)
|
||||
43(k): 42(ptr) Variable Input
|
||||
45: TypeVector 34(int) 4
|
||||
50: 29(int) Constant 2
|
||||
52: TypeImage 6(float) Rect sampled format:Unknown
|
||||
53: TypeSampledImage 52
|
||||
54: TypePointer UniformConstant 53
|
||||
55(sampR): 54(ptr) Variable UniformConstant
|
||||
58: TypeVector 34(int) 2
|
||||
60: TypeImage 34(int) Buffer sampled format:Unknown
|
||||
61: TypeSampledImage 60
|
||||
62: TypePointer UniformConstant 61
|
||||
63(sampB): 62(ptr) Variable UniformConstant
|
||||
69: TypeVector 6(float) 2
|
||||
72: 6(float) Constant 1120403456
|
||||
74: 29(int) Constant 3
|
||||
83: TypeImage 6(float) 2D sampled format:Unknown
|
||||
84: TypeSampledImage 83
|
||||
85: TypeArray 84 74
|
||||
86: TypePointer UniformConstant 85
|
||||
87(samp2Da): 86(ptr) Variable UniformConstant
|
||||
88: TypeMatrix 26(fvec4) 4
|
||||
89: 29(int) Constant 4
|
||||
90: TypeArray 88 89
|
||||
91: TypeArray 88 89
|
||||
92(bn): TypeStruct 90 91 88 88 88
|
||||
93: TypePointer Uniform 92(bn)
|
||||
94: 93(ptr) Variable Uniform
|
||||
95: TypeVector 6(float) 3
|
||||
96: TypeArray 95(fvec3) 50
|
||||
97(bi): TypeStruct 96
|
||||
98: TypeArray 97(bi) 89
|
||||
99: TypePointer Uniform 98
|
||||
100(bname): 99(ptr) Variable Uniform
|
||||
12: TypeBool
|
||||
13: TypePointer Input 12(bool)
|
||||
14(gl_FrontFacing): 13(ptr) Variable Input
|
||||
16: 6(float) Constant 3221225472
|
||||
17: 6(float) Constant 1073741824
|
||||
19(i2): 10(ptr) Variable Private
|
||||
20: 6(float) Constant 1120665600
|
||||
21: TypeVector 6(float) 4
|
||||
22: TypePointer Output 21(fvec4)
|
||||
23(o): 22(ptr) Variable Output
|
||||
24: TypeInt 32 0
|
||||
25: 24(int) Constant 5
|
||||
26: TypeArray 6(float) 25
|
||||
27: TypePointer Input 26
|
||||
28(gl_ClipDistance): 27(ptr) Variable Input
|
||||
29: TypeInt 32 1
|
||||
30: 29(int) Constant 2
|
||||
31: TypePointer Input 6(float)
|
||||
34: 24(int) Constant 1
|
||||
35: TypePointer Output 6(float)
|
||||
37: TypePointer Input 21(fvec4)
|
||||
38(k): 37(ptr) Variable Input
|
||||
40: TypeVector 29(int) 4
|
||||
45: 24(int) Constant 2
|
||||
47: TypeImage 6(float) Rect sampled format:Unknown
|
||||
48: TypeSampledImage 47
|
||||
49: TypePointer UniformConstant 48
|
||||
50(sampR): 49(ptr) Variable UniformConstant
|
||||
53: TypeVector 29(int) 2
|
||||
55: TypeImage 29(int) Buffer sampled format:Unknown
|
||||
56: TypeSampledImage 55
|
||||
57: TypePointer UniformConstant 56
|
||||
58(sampB): 57(ptr) Variable UniformConstant
|
||||
64: TypeVector 6(float) 2
|
||||
67: 6(float) Constant 1120403456
|
||||
69: 24(int) Constant 3
|
||||
78: TypeImage 6(float) 2D sampled format:Unknown
|
||||
79: TypeSampledImage 78
|
||||
80: TypeArray 79 69
|
||||
81: TypePointer UniformConstant 80
|
||||
82(samp2Da): 81(ptr) Variable UniformConstant
|
||||
83: TypeMatrix 21(fvec4) 4
|
||||
84: 24(int) Constant 4
|
||||
85: TypeArray 83 84
|
||||
86: TypeArray 83 84
|
||||
87(bn): TypeStruct 85 86 83 83 83
|
||||
88: TypePointer Uniform 87(bn)
|
||||
89: 88(ptr) Variable Uniform
|
||||
90: TypeVector 6(float) 3
|
||||
91: TypeArray 90(fvec3) 45
|
||||
92(bi): TypeStruct 91
|
||||
93: TypeArray 92(bi) 84
|
||||
94: TypePointer Uniform 93
|
||||
95(bname): 94(ptr) Variable Uniform
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
13: 12(ptr) Variable Function
|
||||
17: 14(bool) Load 16(gl_FrontFacing)
|
||||
SelectionMerge 19 None
|
||||
BranchConditional 17 18 21
|
||||
18: Label
|
||||
Store 13 20
|
||||
Branch 19
|
||||
21: Label
|
||||
Store 13 22
|
||||
Branch 19
|
||||
19: Label
|
||||
23: 6(float) Load 13
|
||||
Store 11(i1) 23
|
||||
Store 24(i2) 25
|
||||
37: 36(ptr) AccessChain 33(gl_ClipDistance) 35
|
||||
38: 6(float) Load 37
|
||||
41: 40(ptr) AccessChain 28(o) 39
|
||||
Store 41 38
|
||||
44: 26(fvec4) Load 43(k)
|
||||
46: 45(ivec4) ConvertFToS 44
|
||||
47: 34(int) CompositeExtract 46 0
|
||||
48: 36(ptr) AccessChain 33(gl_ClipDistance) 47
|
||||
49: 6(float) Load 48
|
||||
51: 40(ptr) AccessChain 28(o) 50
|
||||
Store 51 49
|
||||
56: 53 Load 55(sampR)
|
||||
57: 52 Image 56
|
||||
59: 58(ivec2) ImageQuerySize 57
|
||||
64: 61 Load 63(sampB)
|
||||
65: 60 Image 64
|
||||
66: 34(int) ImageQuerySize 65
|
||||
67: 58(ivec2) CompositeConstruct 66 66
|
||||
68: 58(ivec2) IAdd 59 67
|
||||
70: 69(fvec2) ConvertSToF 68
|
||||
71: 6(float) CompositeExtract 70 0
|
||||
73: 6(float) FDiv 71 72
|
||||
75: 40(ptr) AccessChain 28(o) 74
|
||||
Store 75 73
|
||||
76: 6(float) FunctionCall 8(foo()
|
||||
77: 40(ptr) AccessChain 28(o) 50
|
||||
Store 77 76
|
||||
15: 12(bool) Load 14(gl_FrontFacing)
|
||||
18: 6(float) Select 15 16 17
|
||||
Store 11(i1) 18
|
||||
Store 19(i2) 20
|
||||
32: 31(ptr) AccessChain 28(gl_ClipDistance) 30
|
||||
33: 6(float) Load 32
|
||||
36: 35(ptr) AccessChain 23(o) 34
|
||||
Store 36 33
|
||||
39: 21(fvec4) Load 38(k)
|
||||
41: 40(ivec4) ConvertFToS 39
|
||||
42: 29(int) CompositeExtract 41 0
|
||||
43: 31(ptr) AccessChain 28(gl_ClipDistance) 42
|
||||
44: 6(float) Load 43
|
||||
46: 35(ptr) AccessChain 23(o) 45
|
||||
Store 46 44
|
||||
51: 48 Load 50(sampR)
|
||||
52: 47 Image 51
|
||||
54: 53(ivec2) ImageQuerySize 52
|
||||
59: 56 Load 58(sampB)
|
||||
60: 55 Image 59
|
||||
61: 29(int) ImageQuerySize 60
|
||||
62: 53(ivec2) CompositeConstruct 61 61
|
||||
63: 53(ivec2) IAdd 54 62
|
||||
65: 64(fvec2) ConvertSToF 63
|
||||
66: 6(float) CompositeExtract 65 0
|
||||
68: 6(float) FDiv 66 67
|
||||
70: 35(ptr) AccessChain 23(o) 69
|
||||
Store 70 68
|
||||
71: 6(float) FunctionCall 8(foo()
|
||||
72: 35(ptr) AccessChain 23(o) 45
|
||||
Store 72 71
|
||||
Return
|
||||
FunctionEnd
|
||||
8(foo(): 6(float) Function None 7
|
||||
9: Label
|
||||
78: 6(float) Load 11(i1)
|
||||
79: 6(float) Load 24(i2)
|
||||
80: 6(float) FAdd 78 79
|
||||
ReturnValue 80
|
||||
73: 6(float) Load 11(i1)
|
||||
74: 6(float) Load 19(i2)
|
||||
75: 6(float) FAdd 73 74
|
||||
ReturnValue 75
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user