SPV non-functional: minor readability improvements for texturing.

This commit is contained in:
John Kessenich
2016-06-16 12:43:23 -06:00
parent ac666e7368
commit 76d4dfcd51
7 changed files with 328 additions and 386 deletions

View File

@@ -7,12 +7,12 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 143
// Id's are bound by 136
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 18 43 93 101 111 138 142
EntryPoint Fragment 4 "main" 15 40 90 98 108 134 135
ExecutionMode 4 OriginUpperLeft
Source GLSL 400
Name 4 "main"
@@ -25,59 +25,27 @@ Linked fragment stage:
MemberName 10(s2) 2 "s1_1"
MemberName 10(s2) 3 "bleh"
Name 12 "locals2"
Name 13 "s1"
MemberName 13(s1) 0 "i"
MemberName 13(s1) 1 "f"
Name 14 "s2"
MemberName 14(s2) 0 "i"
MemberName 14(s2) 1 "f"
MemberName 14(s2) 2 "s1_1"
MemberName 14(s2) 3 "bleh"
Name 15 "s1"
MemberName 15(s1) 0 "i"
MemberName 15(s1) 1 "f"
Name 16 "s3"
MemberName 16(s3) 0 "s2_1"
MemberName 16(s3) 1 "i"
MemberName 16(s3) 2 "f"
MemberName 16(s3) 3 "s1_1"
Name 18 "foo3"
Name 39 "localFArray"
Name 43 "coord"
Name 52 "localIArray"
Name 71 "x"
Name 73 "localArray"
Name 78 "i"
Name 87 "a"
Name 93 "condition"
Name 101 "color"
Name 111 "gl_FragColor"
Name 131 "samp2D"
Name 136 "s1"
MemberName 136(s1) 0 "i"
MemberName 136(s1) 1 "f"
Name 138 "foo"
Name 139 "s1"
MemberName 139(s1) 0 "i"
MemberName 139(s1) 1 "f"
Name 140 "s2"
MemberName 140(s2) 0 "i"
MemberName 140(s2) 1 "f"
MemberName 140(s2) 2 "s1_1"
MemberName 140(s2) 3 "bleh"
Name 142 "foo2"
MemberDecorate 16(s3) 0 Flat
MemberDecorate 16(s3) 1 Flat
MemberDecorate 16(s3) 2 Flat
MemberDecorate 16(s3) 3 Flat
Decorate 93(condition) Flat
Decorate 131(samp2D) DescriptorSet 0
MemberDecorate 136(s1) 0 Flat
MemberDecorate 136(s1) 1 Flat
MemberDecorate 140(s2) 0 Flat
MemberDecorate 140(s2) 1 Flat
MemberDecorate 140(s2) 2 Flat
MemberDecorate 140(s2) 3 Flat
Name 13 "s3"
MemberName 13(s3) 0 "s2_1"
MemberName 13(s3) 1 "i"
MemberName 13(s3) 2 "f"
MemberName 13(s3) 3 "s1_1"
Name 15 "foo3"
Name 36 "localFArray"
Name 40 "coord"
Name 49 "localIArray"
Name 68 "x"
Name 70 "localArray"
Name 75 "i"
Name 84 "a"
Name 90 "condition"
Name 98 "color"
Name 108 "gl_FragColor"
Name 128 "samp2D"
Name 134 "foo"
Name 135 "foo2"
Decorate 90(condition) Flat
Decorate 128(samp2D) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@@ -86,171 +54,164 @@ Linked fragment stage:
9: TypeVector 7(float) 4
10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4)
11: TypePointer Function 10(s2)
13(s1): TypeStruct 6(int) 7(float)
14(s2): TypeStruct 6(int) 7(float) 13(s1) 9(fvec4)
15(s1): TypeStruct 6(int) 7(float)
16(s3): TypeStruct 14(s2) 6(int) 7(float) 15(s1)
17: TypePointer Input 16(s3)
18(foo3): 17(ptr) Variable Input
19: 6(int) Constant 0
20: TypePointer Input 14(s2)
23: TypePointer Input 6(int)
26: TypeBool
30: 6(int) Constant 2
31: 6(int) Constant 1
32: 7(float) Constant 1065353216
33: TypePointer Function 7(float)
35: TypeInt 32 0
36: 35(int) Constant 16
37: TypeArray 7(float) 36
38: TypePointer Function 37
40: 6(int) Constant 4
41: TypeVector 7(float) 2
42: TypePointer Input 41(fvec2)
43(coord): 42(ptr) Variable Input
44: 35(int) Constant 0
45: TypePointer Input 7(float)
49: 35(int) Constant 8
50: TypeArray 6(int) 49
51: TypePointer Function 50
55: TypePointer Function 6(int)
72: 6(int) Constant 5
85: 6(int) Constant 16
89: 7(float) Constant 0
93(condition): 23(ptr) Variable Input
99: 6(int) Constant 3
100: TypePointer Input 9(fvec4)
101(color): 100(ptr) Variable Input
103: TypePointer Function 9(fvec4)
105: 35(int) Constant 1
108: 35(int) Constant 2
110: TypePointer Output 9(fvec4)
111(gl_FragColor): 110(ptr) Variable Output
128: TypeImage 7(float) 2D sampled format:Unknown
129: TypeSampledImage 128
130: TypePointer UniformConstant 129
131(samp2D): 130(ptr) Variable UniformConstant
136(s1): TypeStruct 6(int) 7(float)
137: TypePointer Input 136(s1)
138(foo): 137(ptr) Variable Input
139(s1): TypeStruct 6(int) 7(float)
140(s2): TypeStruct 6(int) 7(float) 139(s1) 9(fvec4)
141: TypePointer Input 140(s2)
142(foo2): 141(ptr) Variable Input
13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1)
14: TypePointer Input 13(s3)
15(foo3): 14(ptr) Variable Input
16: 6(int) Constant 0
17: TypePointer Input 10(s2)
20: TypePointer Input 6(int)
23: TypeBool
27: 6(int) Constant 2
28: 6(int) Constant 1
29: 7(float) Constant 1065353216
30: TypePointer Function 7(float)
32: TypeInt 32 0
33: 32(int) Constant 16
34: TypeArray 7(float) 33
35: TypePointer Function 34
37: 6(int) Constant 4
38: TypeVector 7(float) 2
39: TypePointer Input 38(fvec2)
40(coord): 39(ptr) Variable Input
41: 32(int) Constant 0
42: TypePointer Input 7(float)
46: 32(int) Constant 8
47: TypeArray 6(int) 46
48: TypePointer Function 47
52: TypePointer Function 6(int)
69: 6(int) Constant 5
82: 6(int) Constant 16
86: 7(float) Constant 0
90(condition): 20(ptr) Variable Input
96: 6(int) Constant 3
97: TypePointer Input 9(fvec4)
98(color): 97(ptr) Variable Input
100: TypePointer Function 9(fvec4)
102: 32(int) Constant 1
105: 32(int) Constant 2
107: TypePointer Output 9(fvec4)
108(gl_FragColor): 107(ptr) Variable Output
125: TypeImage 7(float) 2D sampled format:Unknown
126: TypeSampledImage 125
127: TypePointer UniformConstant 126
128(samp2D): 127(ptr) Variable UniformConstant
133: TypePointer Input 8(s1)
134(foo): 133(ptr) Variable Input
135(foo2): 17(ptr) Variable Input
4(main): 2 Function None 3
5: Label
12(locals2): 11(ptr) Variable Function
39(localFArray): 38(ptr) Variable Function
52(localIArray): 51(ptr) Variable Function
71(x): 55(ptr) Variable Function
73(localArray): 38(ptr) Variable Function
78(i): 55(ptr) Variable Function
87(a): 38(ptr) Variable Function
21: 20(ptr) AccessChain 18(foo3) 19
22: 14(s2) Load 21
Store 12(locals2) 22
24: 23(ptr) AccessChain 18(foo3) 19 19
25: 6(int) Load 24
27: 26(bool) SGreaterThan 25 19
SelectionMerge 29 None
BranchConditional 27 28 57
28: Label
34: 33(ptr) AccessChain 12(locals2) 30 31
Store 34 32
46: 45(ptr) AccessChain 43(coord) 44
47: 7(float) Load 46
48: 33(ptr) AccessChain 39(localFArray) 40
Store 48 47
53: 23(ptr) AccessChain 18(foo3) 19 19
54: 6(int) Load 53
56: 55(ptr) AccessChain 52(localIArray) 30
Store 56 54
Branch 29
57: Label
58: 45(ptr) AccessChain 43(coord) 44
59: 7(float) Load 58
60: 33(ptr) AccessChain 12(locals2) 30 31
Store 60 59
61: 33(ptr) AccessChain 39(localFArray) 40
Store 61 32
62: 55(ptr) AccessChain 52(localIArray) 30
Store 62 19
Branch 29
29: Label
63: 55(ptr) AccessChain 52(localIArray) 30
64: 6(int) Load 63
65: 26(bool) IEqual 64 19
SelectionMerge 67 None
BranchConditional 65 66 67
66: Label
68: 33(ptr) AccessChain 39(localFArray) 40
69: 7(float) Load 68
70: 7(float) FAdd 69 32
Store 68 70
Branch 67
67: Label
Store 71(x) 72
74: 6(int) Load 71(x)
75: 45(ptr) AccessChain 43(coord) 44
76: 7(float) Load 75
77: 33(ptr) AccessChain 73(localArray) 74
Store 77 76
Store 78(i) 19
Branch 79
79: Label
LoopMerge 81 82 None
Branch 83
83: Label
84: 6(int) Load 78(i)
86: 26(bool) SLessThan 84 85
BranchConditional 86 80 81
80: Label
88: 6(int) Load 78(i)
90: 33(ptr) AccessChain 87(a) 88
Store 90 89
Branch 82
82: Label
91: 6(int) Load 78(i)
92: 6(int) IAdd 91 31
Store 78(i) 92
36(localFArray): 35(ptr) Variable Function
49(localIArray): 48(ptr) Variable Function
68(x): 52(ptr) Variable Function
70(localArray): 35(ptr) Variable Function
75(i): 52(ptr) Variable Function
84(a): 35(ptr) Variable Function
18: 17(ptr) AccessChain 15(foo3) 16
19: 10(s2) Load 18
Store 12(locals2) 19
21: 20(ptr) AccessChain 15(foo3) 16 16
22: 6(int) Load 21
24: 23(bool) SGreaterThan 22 16
SelectionMerge 26 None
BranchConditional 24 25 54
25: Label
31: 30(ptr) AccessChain 12(locals2) 27 28
Store 31 29
43: 42(ptr) AccessChain 40(coord) 41
44: 7(float) Load 43
45: 30(ptr) AccessChain 36(localFArray) 37
Store 45 44
50: 20(ptr) AccessChain 15(foo3) 16 16
51: 6(int) Load 50
53: 52(ptr) AccessChain 49(localIArray) 27
Store 53 51
Branch 26
54: Label
55: 42(ptr) AccessChain 40(coord) 41
56: 7(float) Load 55
57: 30(ptr) AccessChain 12(locals2) 27 28
Store 57 56
58: 30(ptr) AccessChain 36(localFArray) 37
Store 58 29
59: 52(ptr) AccessChain 49(localIArray) 27
Store 59 16
Branch 26
26: Label
60: 52(ptr) AccessChain 49(localIArray) 27
61: 6(int) Load 60
62: 23(bool) IEqual 61 16
SelectionMerge 64 None
BranchConditional 62 63 64
63: Label
65: 30(ptr) AccessChain 36(localFArray) 37
66: 7(float) Load 65
67: 7(float) FAdd 66 29
Store 65 67
Branch 64
64: Label
Store 68(x) 69
71: 6(int) Load 68(x)
72: 42(ptr) AccessChain 40(coord) 41
73: 7(float) Load 72
74: 30(ptr) AccessChain 70(localArray) 71
Store 74 73
Store 75(i) 16
Branch 76
76: Label
LoopMerge 78 79 None
Branch 80
80: Label
81: 6(int) Load 75(i)
83: 23(bool) SLessThan 81 82
BranchConditional 83 77 78
77: Label
85: 6(int) Load 75(i)
87: 30(ptr) AccessChain 84(a) 85
Store 87 86
Branch 79
81: Label
94: 6(int) Load 93(condition)
95: 26(bool) IEqual 94 31
SelectionMerge 97 None
BranchConditional 95 96 97
96: Label
98: 37 Load 73(localArray)
Store 87(a) 98
Branch 97
97: Label
102: 9(fvec4) Load 101(color)
104: 103(ptr) AccessChain 12(locals2) 99
Store 104 102
106: 45(ptr) AccessChain 43(coord) 105
107: 7(float) Load 106
109: 33(ptr) AccessChain 12(locals2) 99 108
Store 109 107
112: 103(ptr) AccessChain 12(locals2) 99
113: 9(fvec4) Load 112
114: 33(ptr) AccessChain 39(localFArray) 40
115: 7(float) Load 114
116: 33(ptr) AccessChain 12(locals2) 30 31
117: 7(float) Load 116
118: 7(float) FAdd 115 117
119: 6(int) Load 71(x)
120: 33(ptr) AccessChain 73(localArray) 119
121: 7(float) Load 120
122: 7(float) FAdd 118 121
123: 6(int) Load 71(x)
124: 33(ptr) AccessChain 87(a) 123
125: 7(float) Load 124
126: 7(float) FAdd 122 125
127: 9(fvec4) VectorTimesScalar 113 126
132: 129 Load 131(samp2D)
133: 41(fvec2) Load 43(coord)
134: 9(fvec4) ImageSampleImplicitLod 132 133
135: 9(fvec4) FMul 127 134
Store 111(gl_FragColor) 135
79: Label
88: 6(int) Load 75(i)
89: 6(int) IAdd 88 28
Store 75(i) 89
Branch 76
78: Label
91: 6(int) Load 90(condition)
92: 23(bool) IEqual 91 28
SelectionMerge 94 None
BranchConditional 92 93 94
93: Label
95: 34 Load 70(localArray)
Store 84(a) 95
Branch 94
94: Label
99: 9(fvec4) Load 98(color)
101: 100(ptr) AccessChain 12(locals2) 96
Store 101 99
103: 42(ptr) AccessChain 40(coord) 102
104: 7(float) Load 103
106: 30(ptr) AccessChain 12(locals2) 96 105
Store 106 104
109: 100(ptr) AccessChain 12(locals2) 96
110: 9(fvec4) Load 109
111: 30(ptr) AccessChain 36(localFArray) 37
112: 7(float) Load 111
113: 30(ptr) AccessChain 12(locals2) 27 28
114: 7(float) Load 113
115: 7(float) FAdd 112 114
116: 6(int) Load 68(x)
117: 30(ptr) AccessChain 70(localArray) 116
118: 7(float) Load 117
119: 7(float) FAdd 115 118
120: 6(int) Load 68(x)
121: 30(ptr) AccessChain 84(a) 120
122: 7(float) Load 121
123: 7(float) FAdd 119 122
124: 9(fvec4) VectorTimesScalar 110 123
129: 126 Load 128(samp2D)
130: 38(fvec2) Load 40(coord)
131: 9(fvec4) ImageSampleImplicitLod 129 130
132: 9(fvec4) FMul 124 131
Store 108(gl_FragColor) 132
Return
FunctionEnd