Generate separate stores for partially swizzled memory stores
Full vector and fully specified vector swizzle stores are not affected by this change, only partial swizzles ie swizzles with fewer components than the vector being stored to. Previously the vector being stored to loaded and any components not specified in the swizzle were used to create a full store to the vector. While this change generates more SPIR-V instructions, it is necessary for correctness. Fixes #2518.
This commit is contained in:
parent
9158061398
commit
6d5b40f051
50 changed files with 31343 additions and 26594 deletions
|
|
@ -1,71 +1,71 @@
|
|||
spv.310.bitcast.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 153
|
||||
// Id's are bound by 179
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 14 26 37 48 89 98 107 116 122 130 139 148
|
||||
EntryPoint Fragment 4 "main" 14 26 40 56 103 112 123 136 142 150 161 174
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source ESSL 310
|
||||
Name 4 "main"
|
||||
Name 9 "idata"
|
||||
Name 14 "f1"
|
||||
Name 26 "f2"
|
||||
Name 37 "f3"
|
||||
Name 48 "f4"
|
||||
Name 55 "udata"
|
||||
Name 85 "fdata"
|
||||
Name 89 "i1"
|
||||
Name 98 "i2"
|
||||
Name 107 "i3"
|
||||
Name 116 "i4"
|
||||
Name 122 "u1"
|
||||
Name 130 "u2"
|
||||
Name 139 "u3"
|
||||
Name 148 "u4"
|
||||
Name 40 "f3"
|
||||
Name 56 "f4"
|
||||
Name 63 "udata"
|
||||
Name 99 "fdata"
|
||||
Name 103 "i1"
|
||||
Name 112 "i2"
|
||||
Name 123 "i3"
|
||||
Name 136 "i4"
|
||||
Name 142 "u1"
|
||||
Name 150 "u2"
|
||||
Name 161 "u3"
|
||||
Name 174 "u4"
|
||||
Decorate 14(f1) RelaxedPrecision
|
||||
Decorate 14(f1) Location 8
|
||||
Decorate 15 RelaxedPrecision
|
||||
Decorate 26(f2) RelaxedPrecision
|
||||
Decorate 26(f2) Location 9
|
||||
Decorate 27 RelaxedPrecision
|
||||
Decorate 37(f3) RelaxedPrecision
|
||||
Decorate 37(f3) Location 10
|
||||
Decorate 38 RelaxedPrecision
|
||||
Decorate 48(f4) Location 11
|
||||
Decorate 57 RelaxedPrecision
|
||||
Decorate 64 RelaxedPrecision
|
||||
Decorate 40(f3) RelaxedPrecision
|
||||
Decorate 40(f3) Location 10
|
||||
Decorate 41 RelaxedPrecision
|
||||
Decorate 56(f4) Location 11
|
||||
Decorate 65 RelaxedPrecision
|
||||
Decorate 72 RelaxedPrecision
|
||||
Decorate 89(i1) RelaxedPrecision
|
||||
Decorate 89(i1) Flat
|
||||
Decorate 89(i1) Location 0
|
||||
Decorate 90 RelaxedPrecision
|
||||
Decorate 98(i2) RelaxedPrecision
|
||||
Decorate 98(i2) Flat
|
||||
Decorate 98(i2) Location 1
|
||||
Decorate 99 RelaxedPrecision
|
||||
Decorate 107(i3) RelaxedPrecision
|
||||
Decorate 107(i3) Flat
|
||||
Decorate 107(i3) Location 2
|
||||
Decorate 108 RelaxedPrecision
|
||||
Decorate 116(i4) Flat
|
||||
Decorate 116(i4) Location 3
|
||||
Decorate 122(u1) RelaxedPrecision
|
||||
Decorate 122(u1) Flat
|
||||
Decorate 122(u1) Location 4
|
||||
Decorate 123 RelaxedPrecision
|
||||
Decorate 130(u2) RelaxedPrecision
|
||||
Decorate 130(u2) Flat
|
||||
Decorate 130(u2) Location 5
|
||||
Decorate 131 RelaxedPrecision
|
||||
Decorate 139(u3) RelaxedPrecision
|
||||
Decorate 139(u3) Flat
|
||||
Decorate 139(u3) Location 6
|
||||
Decorate 140 RelaxedPrecision
|
||||
Decorate 148(u4) Flat
|
||||
Decorate 148(u4) Location 7
|
||||
Decorate 82 RelaxedPrecision
|
||||
Decorate 103(i1) RelaxedPrecision
|
||||
Decorate 103(i1) Flat
|
||||
Decorate 103(i1) Location 0
|
||||
Decorate 104 RelaxedPrecision
|
||||
Decorate 112(i2) RelaxedPrecision
|
||||
Decorate 112(i2) Flat
|
||||
Decorate 112(i2) Location 1
|
||||
Decorate 113 RelaxedPrecision
|
||||
Decorate 123(i3) RelaxedPrecision
|
||||
Decorate 123(i3) Flat
|
||||
Decorate 123(i3) Location 2
|
||||
Decorate 124 RelaxedPrecision
|
||||
Decorate 136(i4) Flat
|
||||
Decorate 136(i4) Location 3
|
||||
Decorate 142(u1) RelaxedPrecision
|
||||
Decorate 142(u1) Flat
|
||||
Decorate 142(u1) Location 4
|
||||
Decorate 143 RelaxedPrecision
|
||||
Decorate 150(u2) RelaxedPrecision
|
||||
Decorate 150(u2) Flat
|
||||
Decorate 150(u2) Location 5
|
||||
Decorate 151 RelaxedPrecision
|
||||
Decorate 161(u3) RelaxedPrecision
|
||||
Decorate 161(u3) Flat
|
||||
Decorate 161(u3) Location 6
|
||||
Decorate 162 RelaxedPrecision
|
||||
Decorate 174(u4) Flat
|
||||
Decorate 174(u4) Location 7
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
|
|
@ -83,44 +83,46 @@ spv.310.bitcast.frag
|
|||
25: TypePointer Input 24(fvec2)
|
||||
26(f2): 25(ptr) Variable Input
|
||||
28: TypeVector 6(int) 2
|
||||
35: TypeVector 12(float) 3
|
||||
36: TypePointer Input 35(fvec3)
|
||||
37(f3): 36(ptr) Variable Input
|
||||
39: TypeVector 6(int) 3
|
||||
46: TypeVector 12(float) 4
|
||||
47: TypePointer Input 46(fvec4)
|
||||
48(f4): 47(ptr) Variable Input
|
||||
53: TypeVector 17(int) 4
|
||||
54: TypePointer Function 53(ivec4)
|
||||
56: 53(ivec4) ConstantComposite 18 18 18 18
|
||||
59: TypePointer Function 17(int)
|
||||
65: TypeVector 17(int) 2
|
||||
73: TypeVector 17(int) 3
|
||||
84: TypePointer Function 46(fvec4)
|
||||
86: 12(float) Constant 0
|
||||
87: 46(fvec4) ConstantComposite 86 86 86 86
|
||||
88: TypePointer Input 6(int)
|
||||
89(i1): 88(ptr) Variable Input
|
||||
92: TypePointer Function 12(float)
|
||||
97: TypePointer Input 28(ivec2)
|
||||
98(i2): 97(ptr) Variable Input
|
||||
106: TypePointer Input 39(ivec3)
|
||||
107(i3): 106(ptr) Variable Input
|
||||
115: TypePointer Input 7(ivec4)
|
||||
116(i4): 115(ptr) Variable Input
|
||||
121: TypePointer Input 17(int)
|
||||
122(u1): 121(ptr) Variable Input
|
||||
129: TypePointer Input 65(ivec2)
|
||||
130(u2): 129(ptr) Variable Input
|
||||
138: TypePointer Input 73(ivec3)
|
||||
139(u3): 138(ptr) Variable Input
|
||||
147: TypePointer Input 53(ivec4)
|
||||
148(u4): 147(ptr) Variable Input
|
||||
35: 17(int) Constant 1
|
||||
38: TypeVector 12(float) 3
|
||||
39: TypePointer Input 38(fvec3)
|
||||
40(f3): 39(ptr) Variable Input
|
||||
42: TypeVector 6(int) 3
|
||||
51: 17(int) Constant 2
|
||||
54: TypeVector 12(float) 4
|
||||
55: TypePointer Input 54(fvec4)
|
||||
56(f4): 55(ptr) Variable Input
|
||||
61: TypeVector 17(int) 4
|
||||
62: TypePointer Function 61(ivec4)
|
||||
64: 61(ivec4) ConstantComposite 18 18 18 18
|
||||
67: TypePointer Function 17(int)
|
||||
73: TypeVector 17(int) 2
|
||||
83: TypeVector 17(int) 3
|
||||
98: TypePointer Function 54(fvec4)
|
||||
100: 12(float) Constant 0
|
||||
101: 54(fvec4) ConstantComposite 100 100 100 100
|
||||
102: TypePointer Input 6(int)
|
||||
103(i1): 102(ptr) Variable Input
|
||||
106: TypePointer Function 12(float)
|
||||
111: TypePointer Input 28(ivec2)
|
||||
112(i2): 111(ptr) Variable Input
|
||||
122: TypePointer Input 42(ivec3)
|
||||
123(i3): 122(ptr) Variable Input
|
||||
135: TypePointer Input 7(ivec4)
|
||||
136(i4): 135(ptr) Variable Input
|
||||
141: TypePointer Input 17(int)
|
||||
142(u1): 141(ptr) Variable Input
|
||||
149: TypePointer Input 73(ivec2)
|
||||
150(u2): 149(ptr) Variable Input
|
||||
160: TypePointer Input 83(ivec3)
|
||||
161(u3): 160(ptr) Variable Input
|
||||
173: TypePointer Input 61(ivec4)
|
||||
174(u4): 173(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9(idata): 8(ptr) Variable Function
|
||||
55(udata): 54(ptr) Variable Function
|
||||
85(fdata): 84(ptr) Variable Function
|
||||
63(udata): 62(ptr) Variable Function
|
||||
99(fdata): 98(ptr) Variable Function
|
||||
Store 9(idata) 11
|
||||
15: 12(float) Load 14(f1)
|
||||
16: 6(int) Bitcast 15
|
||||
|
|
@ -134,107 +136,143 @@ spv.310.bitcast.frag
|
|||
30: 7(ivec4) Load 9(idata)
|
||||
31: 28(ivec2) VectorShuffle 30 30 0 1
|
||||
32: 28(ivec2) IAdd 31 29
|
||||
33: 7(ivec4) Load 9(idata)
|
||||
34: 7(ivec4) VectorShuffle 33 32 4 5 2 3
|
||||
Store 9(idata) 34
|
||||
38: 35(fvec3) Load 37(f3)
|
||||
40: 39(ivec3) Bitcast 38
|
||||
41: 7(ivec4) Load 9(idata)
|
||||
42: 39(ivec3) VectorShuffle 41 41 0 1 2
|
||||
43: 39(ivec3) IAdd 42 40
|
||||
33: 19(ptr) AccessChain 9(idata) 18
|
||||
34: 6(int) CompositeExtract 32 0
|
||||
Store 33 34
|
||||
36: 19(ptr) AccessChain 9(idata) 35
|
||||
37: 6(int) CompositeExtract 32 1
|
||||
Store 36 37
|
||||
41: 38(fvec3) Load 40(f3)
|
||||
43: 42(ivec3) Bitcast 41
|
||||
44: 7(ivec4) Load 9(idata)
|
||||
45: 7(ivec4) VectorShuffle 44 43 4 5 6 3
|
||||
Store 9(idata) 45
|
||||
49: 46(fvec4) Load 48(f4)
|
||||
50: 7(ivec4) Bitcast 49
|
||||
51: 7(ivec4) Load 9(idata)
|
||||
52: 7(ivec4) IAdd 51 50
|
||||
Store 9(idata) 52
|
||||
Store 55(udata) 56
|
||||
57: 12(float) Load 14(f1)
|
||||
58: 17(int) Bitcast 57
|
||||
60: 59(ptr) AccessChain 55(udata) 18
|
||||
61: 17(int) Load 60
|
||||
62: 17(int) IAdd 61 58
|
||||
63: 59(ptr) AccessChain 55(udata) 18
|
||||
Store 63 62
|
||||
64: 24(fvec2) Load 26(f2)
|
||||
66: 65(ivec2) Bitcast 64
|
||||
67: 53(ivec4) Load 55(udata)
|
||||
68: 65(ivec2) VectorShuffle 67 67 0 1
|
||||
69: 65(ivec2) IAdd 68 66
|
||||
70: 53(ivec4) Load 55(udata)
|
||||
71: 53(ivec4) VectorShuffle 70 69 4 5 2 3
|
||||
Store 55(udata) 71
|
||||
72: 35(fvec3) Load 37(f3)
|
||||
74: 73(ivec3) Bitcast 72
|
||||
75: 53(ivec4) Load 55(udata)
|
||||
76: 73(ivec3) VectorShuffle 75 75 0 1 2
|
||||
77: 73(ivec3) IAdd 76 74
|
||||
78: 53(ivec4) Load 55(udata)
|
||||
79: 53(ivec4) VectorShuffle 78 77 4 5 6 3
|
||||
Store 55(udata) 79
|
||||
80: 46(fvec4) Load 48(f4)
|
||||
81: 53(ivec4) Bitcast 80
|
||||
82: 53(ivec4) Load 55(udata)
|
||||
83: 53(ivec4) IAdd 82 81
|
||||
Store 55(udata) 83
|
||||
Store 85(fdata) 87
|
||||
90: 6(int) Load 89(i1)
|
||||
91: 12(float) Bitcast 90
|
||||
93: 92(ptr) AccessChain 85(fdata) 18
|
||||
94: 12(float) Load 93
|
||||
95: 12(float) FAdd 94 91
|
||||
96: 92(ptr) AccessChain 85(fdata) 18
|
||||
Store 96 95
|
||||
99: 28(ivec2) Load 98(i2)
|
||||
100: 24(fvec2) Bitcast 99
|
||||
101: 46(fvec4) Load 85(fdata)
|
||||
102: 24(fvec2) VectorShuffle 101 101 0 1
|
||||
103: 24(fvec2) FAdd 102 100
|
||||
104: 46(fvec4) Load 85(fdata)
|
||||
105: 46(fvec4) VectorShuffle 104 103 4 5 2 3
|
||||
Store 85(fdata) 105
|
||||
108: 39(ivec3) Load 107(i3)
|
||||
109: 35(fvec3) Bitcast 108
|
||||
110: 46(fvec4) Load 85(fdata)
|
||||
111: 35(fvec3) VectorShuffle 110 110 0 1 2
|
||||
112: 35(fvec3) FAdd 111 109
|
||||
113: 46(fvec4) Load 85(fdata)
|
||||
114: 46(fvec4) VectorShuffle 113 112 4 5 6 3
|
||||
Store 85(fdata) 114
|
||||
117: 7(ivec4) Load 116(i4)
|
||||
118: 46(fvec4) Bitcast 117
|
||||
119: 46(fvec4) Load 85(fdata)
|
||||
120: 46(fvec4) FAdd 119 118
|
||||
Store 85(fdata) 120
|
||||
123: 17(int) Load 122(u1)
|
||||
124: 12(float) Bitcast 123
|
||||
125: 92(ptr) AccessChain 85(fdata) 18
|
||||
126: 12(float) Load 125
|
||||
127: 12(float) FAdd 126 124
|
||||
128: 92(ptr) AccessChain 85(fdata) 18
|
||||
Store 128 127
|
||||
131: 65(ivec2) Load 130(u2)
|
||||
132: 24(fvec2) Bitcast 131
|
||||
133: 46(fvec4) Load 85(fdata)
|
||||
134: 24(fvec2) VectorShuffle 133 133 0 1
|
||||
135: 24(fvec2) FAdd 134 132
|
||||
136: 46(fvec4) Load 85(fdata)
|
||||
137: 46(fvec4) VectorShuffle 136 135 4 5 2 3
|
||||
Store 85(fdata) 137
|
||||
140: 73(ivec3) Load 139(u3)
|
||||
141: 35(fvec3) Bitcast 140
|
||||
142: 46(fvec4) Load 85(fdata)
|
||||
143: 35(fvec3) VectorShuffle 142 142 0 1 2
|
||||
144: 35(fvec3) FAdd 143 141
|
||||
145: 46(fvec4) Load 85(fdata)
|
||||
146: 46(fvec4) VectorShuffle 145 144 4 5 6 3
|
||||
Store 85(fdata) 146
|
||||
149: 53(ivec4) Load 148(u4)
|
||||
150: 46(fvec4) Bitcast 149
|
||||
151: 46(fvec4) Load 85(fdata)
|
||||
152: 46(fvec4) FAdd 151 150
|
||||
Store 85(fdata) 152
|
||||
45: 42(ivec3) VectorShuffle 44 44 0 1 2
|
||||
46: 42(ivec3) IAdd 45 43
|
||||
47: 19(ptr) AccessChain 9(idata) 18
|
||||
48: 6(int) CompositeExtract 46 0
|
||||
Store 47 48
|
||||
49: 19(ptr) AccessChain 9(idata) 35
|
||||
50: 6(int) CompositeExtract 46 1
|
||||
Store 49 50
|
||||
52: 19(ptr) AccessChain 9(idata) 51
|
||||
53: 6(int) CompositeExtract 46 2
|
||||
Store 52 53
|
||||
57: 54(fvec4) Load 56(f4)
|
||||
58: 7(ivec4) Bitcast 57
|
||||
59: 7(ivec4) Load 9(idata)
|
||||
60: 7(ivec4) IAdd 59 58
|
||||
Store 9(idata) 60
|
||||
Store 63(udata) 64
|
||||
65: 12(float) Load 14(f1)
|
||||
66: 17(int) Bitcast 65
|
||||
68: 67(ptr) AccessChain 63(udata) 18
|
||||
69: 17(int) Load 68
|
||||
70: 17(int) IAdd 69 66
|
||||
71: 67(ptr) AccessChain 63(udata) 18
|
||||
Store 71 70
|
||||
72: 24(fvec2) Load 26(f2)
|
||||
74: 73(ivec2) Bitcast 72
|
||||
75: 61(ivec4) Load 63(udata)
|
||||
76: 73(ivec2) VectorShuffle 75 75 0 1
|
||||
77: 73(ivec2) IAdd 76 74
|
||||
78: 67(ptr) AccessChain 63(udata) 18
|
||||
79: 17(int) CompositeExtract 77 0
|
||||
Store 78 79
|
||||
80: 67(ptr) AccessChain 63(udata) 35
|
||||
81: 17(int) CompositeExtract 77 1
|
||||
Store 80 81
|
||||
82: 38(fvec3) Load 40(f3)
|
||||
84: 83(ivec3) Bitcast 82
|
||||
85: 61(ivec4) Load 63(udata)
|
||||
86: 83(ivec3) VectorShuffle 85 85 0 1 2
|
||||
87: 83(ivec3) IAdd 86 84
|
||||
88: 67(ptr) AccessChain 63(udata) 18
|
||||
89: 17(int) CompositeExtract 87 0
|
||||
Store 88 89
|
||||
90: 67(ptr) AccessChain 63(udata) 35
|
||||
91: 17(int) CompositeExtract 87 1
|
||||
Store 90 91
|
||||
92: 67(ptr) AccessChain 63(udata) 51
|
||||
93: 17(int) CompositeExtract 87 2
|
||||
Store 92 93
|
||||
94: 54(fvec4) Load 56(f4)
|
||||
95: 61(ivec4) Bitcast 94
|
||||
96: 61(ivec4) Load 63(udata)
|
||||
97: 61(ivec4) IAdd 96 95
|
||||
Store 63(udata) 97
|
||||
Store 99(fdata) 101
|
||||
104: 6(int) Load 103(i1)
|
||||
105: 12(float) Bitcast 104
|
||||
107: 106(ptr) AccessChain 99(fdata) 18
|
||||
108: 12(float) Load 107
|
||||
109: 12(float) FAdd 108 105
|
||||
110: 106(ptr) AccessChain 99(fdata) 18
|
||||
Store 110 109
|
||||
113: 28(ivec2) Load 112(i2)
|
||||
114: 24(fvec2) Bitcast 113
|
||||
115: 54(fvec4) Load 99(fdata)
|
||||
116: 24(fvec2) VectorShuffle 115 115 0 1
|
||||
117: 24(fvec2) FAdd 116 114
|
||||
118: 106(ptr) AccessChain 99(fdata) 18
|
||||
119: 12(float) CompositeExtract 117 0
|
||||
Store 118 119
|
||||
120: 106(ptr) AccessChain 99(fdata) 35
|
||||
121: 12(float) CompositeExtract 117 1
|
||||
Store 120 121
|
||||
124: 42(ivec3) Load 123(i3)
|
||||
125: 38(fvec3) Bitcast 124
|
||||
126: 54(fvec4) Load 99(fdata)
|
||||
127: 38(fvec3) VectorShuffle 126 126 0 1 2
|
||||
128: 38(fvec3) FAdd 127 125
|
||||
129: 106(ptr) AccessChain 99(fdata) 18
|
||||
130: 12(float) CompositeExtract 128 0
|
||||
Store 129 130
|
||||
131: 106(ptr) AccessChain 99(fdata) 35
|
||||
132: 12(float) CompositeExtract 128 1
|
||||
Store 131 132
|
||||
133: 106(ptr) AccessChain 99(fdata) 51
|
||||
134: 12(float) CompositeExtract 128 2
|
||||
Store 133 134
|
||||
137: 7(ivec4) Load 136(i4)
|
||||
138: 54(fvec4) Bitcast 137
|
||||
139: 54(fvec4) Load 99(fdata)
|
||||
140: 54(fvec4) FAdd 139 138
|
||||
Store 99(fdata) 140
|
||||
143: 17(int) Load 142(u1)
|
||||
144: 12(float) Bitcast 143
|
||||
145: 106(ptr) AccessChain 99(fdata) 18
|
||||
146: 12(float) Load 145
|
||||
147: 12(float) FAdd 146 144
|
||||
148: 106(ptr) AccessChain 99(fdata) 18
|
||||
Store 148 147
|
||||
151: 73(ivec2) Load 150(u2)
|
||||
152: 24(fvec2) Bitcast 151
|
||||
153: 54(fvec4) Load 99(fdata)
|
||||
154: 24(fvec2) VectorShuffle 153 153 0 1
|
||||
155: 24(fvec2) FAdd 154 152
|
||||
156: 106(ptr) AccessChain 99(fdata) 18
|
||||
157: 12(float) CompositeExtract 155 0
|
||||
Store 156 157
|
||||
158: 106(ptr) AccessChain 99(fdata) 35
|
||||
159: 12(float) CompositeExtract 155 1
|
||||
Store 158 159
|
||||
162: 83(ivec3) Load 161(u3)
|
||||
163: 38(fvec3) Bitcast 162
|
||||
164: 54(fvec4) Load 99(fdata)
|
||||
165: 38(fvec3) VectorShuffle 164 164 0 1 2
|
||||
166: 38(fvec3) FAdd 165 163
|
||||
167: 106(ptr) AccessChain 99(fdata) 18
|
||||
168: 12(float) CompositeExtract 166 0
|
||||
Store 167 168
|
||||
169: 106(ptr) AccessChain 99(fdata) 35
|
||||
170: 12(float) CompositeExtract 166 1
|
||||
Store 169 170
|
||||
171: 106(ptr) AccessChain 99(fdata) 51
|
||||
172: 12(float) CompositeExtract 166 2
|
||||
Store 171 172
|
||||
175: 61(ivec4) Load 174(u4)
|
||||
176: 54(fvec4) Bitcast 175
|
||||
177: 54(fvec4) Load 99(fdata)
|
||||
178: 54(fvec4) FAdd 177 176
|
||||
Store 99(fdata) 178
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue