HLSL: handle type conversion for any/all intrinsics

HLSL allows float/etc types for any/all intrinsics, while the
SPIR-V opcode requires bool.  This adds a simple decomposition
to type convert the argument.  It could get a little more clever
in some of the type cases if it ever had to.
This commit is contained in:
LoopDawg 2017-07-05 12:07:16 -06:00
parent 17b5f9175d
commit 54b9ff9c34
4 changed files with 3930 additions and 3800 deletions

View File

@ -11,6 +11,7 @@ local_size = (1, 1, 1)
0:17 'inU1' ( in uint) 0:17 'inU1' ( in uint)
0:? Sequence 0:? Sequence
0:21 all ( temp bool) 0:21 all ( temp bool)
0:21 Convert float to bool ( temp bool)
0:21 'inF0' ( in float) 0:21 'inF0' ( in float)
0:24 AtomicAdd ( temp void) 0:24 AtomicAdd ( temp void)
0:24 'gs_ua' ( shared uint) 0:24 'gs_ua' ( shared uint)
@ -92,6 +93,7 @@ local_size = (1, 1, 1)
0:51 'inU1' ( in 2-component vector of uint) 0:51 'inU1' ( in 2-component vector of uint)
0:? Sequence 0:? Sequence
0:55 all ( temp bool) 0:55 all ( temp bool)
0:55 Convert float to bool ( temp 2-component vector of bool)
0:55 'inF0' ( in 2-component vector of float) 0:55 'inF0' ( in 2-component vector of float)
0:58 AtomicAdd ( temp void) 0:58 AtomicAdd ( temp void)
0:58 'gs_ua2' ( shared 2-component vector of uint) 0:58 'gs_ua2' ( shared 2-component vector of uint)
@ -165,6 +167,7 @@ local_size = (1, 1, 1)
0:78 'inU1' ( in 3-component vector of uint) 0:78 'inU1' ( in 3-component vector of uint)
0:? Sequence 0:? Sequence
0:82 all ( temp bool) 0:82 all ( temp bool)
0:82 Convert float to bool ( temp 3-component vector of bool)
0:82 'inF0' ( in 3-component vector of float) 0:82 'inF0' ( in 3-component vector of float)
0:85 AtomicAdd ( temp void) 0:85 AtomicAdd ( temp void)
0:85 'gs_ua3' ( shared 3-component vector of uint) 0:85 'gs_ua3' ( shared 3-component vector of uint)
@ -239,6 +242,7 @@ local_size = (1, 1, 1)
0:105 'inU1' ( in 4-component vector of uint) 0:105 'inU1' ( in 4-component vector of uint)
0:? Sequence 0:? Sequence
0:109 all ( temp bool) 0:109 all ( temp bool)
0:109 Convert float to bool ( temp 4-component vector of bool)
0:109 'inF0' ( in 4-component vector of float) 0:109 'inF0' ( in 4-component vector of float)
0:112 AtomicAdd ( temp void) 0:112 AtomicAdd ( temp void)
0:112 'gs_ua4' ( shared 4-component vector of uint) 0:112 'gs_ua4' ( shared 4-component vector of uint)
@ -367,6 +371,7 @@ local_size = (1, 1, 1)
0:17 'inU1' ( in uint) 0:17 'inU1' ( in uint)
0:? Sequence 0:? Sequence
0:21 all ( temp bool) 0:21 all ( temp bool)
0:21 Convert float to bool ( temp bool)
0:21 'inF0' ( in float) 0:21 'inF0' ( in float)
0:24 AtomicAdd ( temp void) 0:24 AtomicAdd ( temp void)
0:24 'gs_ua' ( shared uint) 0:24 'gs_ua' ( shared uint)
@ -448,6 +453,7 @@ local_size = (1, 1, 1)
0:51 'inU1' ( in 2-component vector of uint) 0:51 'inU1' ( in 2-component vector of uint)
0:? Sequence 0:? Sequence
0:55 all ( temp bool) 0:55 all ( temp bool)
0:55 Convert float to bool ( temp 2-component vector of bool)
0:55 'inF0' ( in 2-component vector of float) 0:55 'inF0' ( in 2-component vector of float)
0:58 AtomicAdd ( temp void) 0:58 AtomicAdd ( temp void)
0:58 'gs_ua2' ( shared 2-component vector of uint) 0:58 'gs_ua2' ( shared 2-component vector of uint)
@ -521,6 +527,7 @@ local_size = (1, 1, 1)
0:78 'inU1' ( in 3-component vector of uint) 0:78 'inU1' ( in 3-component vector of uint)
0:? Sequence 0:? Sequence
0:82 all ( temp bool) 0:82 all ( temp bool)
0:82 Convert float to bool ( temp 3-component vector of bool)
0:82 'inF0' ( in 3-component vector of float) 0:82 'inF0' ( in 3-component vector of float)
0:85 AtomicAdd ( temp void) 0:85 AtomicAdd ( temp void)
0:85 'gs_ua3' ( shared 3-component vector of uint) 0:85 'gs_ua3' ( shared 3-component vector of uint)
@ -595,6 +602,7 @@ local_size = (1, 1, 1)
0:105 'inU1' ( in 4-component vector of uint) 0:105 'inU1' ( in 4-component vector of uint)
0:? Sequence 0:? Sequence
0:109 all ( temp bool) 0:109 all ( temp bool)
0:109 Convert float to bool ( temp 4-component vector of bool)
0:109 'inF0' ( in 4-component vector of float) 0:109 'inF0' ( in 4-component vector of float)
0:112 AtomicAdd ( temp void) 0:112 AtomicAdd ( temp void)
0:112 'gs_ua4' ( shared 4-component vector of uint) 0:112 'gs_ua4' ( shared 4-component vector of uint)
@ -709,12 +717,12 @@ local_size = (1, 1, 1)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 255 // Id's are bound by 265
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "ComputeShaderFunction" 227 230 233 237 240 243 EntryPoint GLCompute 4 "ComputeShaderFunction" 237 240 243 247 250 253
ExecutionMode 4 LocalSize 1 1 1 ExecutionMode 4 LocalSize 1 1 1
Source HLSL 500 Source HLSL 500
Name 4 "ComputeShaderFunction" Name 4 "ComputeShaderFunction"
@ -746,44 +754,44 @@ local_size = (1, 1, 1)
Name 55 "inF2" Name 55 "inF2"
Name 56 "inU0" Name 56 "inU0"
Name 57 "inU1" Name 57 "inU1"
Name 64 "gs_ua" Name 66 "gs_ua"
Name 65 "gs_ub" Name 67 "gs_ub"
Name 70 "out_u1" Name 72 "out_u1"
Name 78 "gs_uc" Name 80 "gs_uc"
Name 107 "gs_ua2" Name 111 "gs_ua2"
Name 108 "gs_ub2" Name 112 "gs_ub2"
Name 111 "out_u2" Name 115 "out_u2"
Name 119 "gs_uc2" Name 123 "gs_uc2"
Name 148 "gs_ua3" Name 155 "gs_ua3"
Name 149 "gs_ub3" Name 156 "gs_ub3"
Name 152 "out_u3" Name 159 "out_u3"
Name 160 "gs_uc3" Name 167 "gs_uc3"
Name 188 "gs_ua4" Name 198 "gs_ua4"
Name 189 "gs_ub4" Name 199 "gs_ub4"
Name 192 "out_u4" Name 202 "out_u4"
Name 200 "gs_uc4" Name 210 "gs_uc4"
Name 225 "inF0" Name 235 "inF0"
Name 227 "inF0" Name 237 "inF0"
Name 229 "inF1" Name 239 "inF1"
Name 230 "inF1" Name 240 "inF1"
Name 232 "inF2" Name 242 "inF2"
Name 233 "inF2" Name 243 "inF2"
Name 235 "inU0" Name 245 "inU0"
Name 237 "inU0" Name 247 "inU0"
Name 239 "inU1" Name 249 "inU1"
Name 240 "inU1" Name 250 "inU1"
Name 243 "@entryPointOutput" Name 253 "@entryPointOutput"
Name 244 "param" Name 254 "param"
Name 246 "param" Name 256 "param"
Name 248 "param" Name 258 "param"
Name 250 "param" Name 260 "param"
Name 252 "param" Name 262 "param"
Decorate 227(inF0) Location 0 Decorate 237(inF0) Location 0
Decorate 230(inF1) Location 1 Decorate 240(inF1) Location 1
Decorate 233(inF2) Location 2 Decorate 243(inF2) Location 2
Decorate 237(inU0) Location 3 Decorate 247(inU0) Location 3
Decorate 240(inU1) Location 4 Decorate 250(inU1) Location 4
Decorate 243(@entryPointOutput) Location 0 Decorate 253(@entryPointOutput) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -808,75 +816,81 @@ local_size = (1, 1, 1)
51: TypePointer Function 50(ivec4) 51: TypePointer Function 50(ivec4)
52: TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr) 52: TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr)
61: TypeBool 61: TypeBool
63: TypePointer Workgroup 8(int) 62: 6(float) Constant 0
64(gs_ua): 63(ptr) Variable Workgroup 65: TypePointer Workgroup 8(int)
65(gs_ub): 63(ptr) Variable Workgroup 66(gs_ua): 65(ptr) Variable Workgroup
67: 8(int) Constant 1 67(gs_ub): 65(ptr) Variable Workgroup
68: 8(int) Constant 0 69: 8(int) Constant 1
78(gs_uc): 63(ptr) Variable Workgroup 70: 8(int) Constant 0
99: 6(float) Constant 0 80(gs_uc): 65(ptr) Variable Workgroup
106: TypePointer Workgroup 26(ivec2) 106: TypeVector 61(bool) 2
107(gs_ua2): 106(ptr) Variable Workgroup 107: 24(fvec2) ConstantComposite 62 62
108(gs_ub2): 106(ptr) Variable Workgroup 110: TypePointer Workgroup 26(ivec2)
119(gs_uc2): 106(ptr) Variable Workgroup 111(gs_ua2): 110(ptr) Variable Workgroup
140: 6(float) Constant 1065353216 112(gs_ub2): 110(ptr) Variable Workgroup
141: 6(float) Constant 1073741824 123(gs_uc2): 110(ptr) Variable Workgroup
142: 24(fvec2) ConstantComposite 140 141 144: 6(float) Constant 1065353216
147: TypePointer Workgroup 38(ivec3) 145: 6(float) Constant 1073741824
148(gs_ua3): 147(ptr) Variable Workgroup 146: 24(fvec2) ConstantComposite 144 145
149(gs_ub3): 147(ptr) Variable Workgroup 150: TypeVector 61(bool) 3
160(gs_uc3): 147(ptr) Variable Workgroup 151: 36(fvec3) ConstantComposite 62 62 62
181: 6(float) Constant 1077936128 154: TypePointer Workgroup 38(ivec3)
182: 36(fvec3) ConstantComposite 140 141 181 155(gs_ua3): 154(ptr) Variable Workgroup
187: TypePointer Workgroup 50(ivec4) 156(gs_ub3): 154(ptr) Variable Workgroup
188(gs_ua4): 187(ptr) Variable Workgroup 167(gs_uc3): 154(ptr) Variable Workgroup
189(gs_ub4): 187(ptr) Variable Workgroup 188: 6(float) Constant 1077936128
200(gs_uc4): 187(ptr) Variable Workgroup 189: 36(fvec3) ConstantComposite 144 145 188
221: 6(float) Constant 1082130432 193: TypeVector 61(bool) 4
222: 48(fvec4) ConstantComposite 140 141 181 221 194: 48(fvec4) ConstantComposite 62 62 62 62
226: TypePointer Input 48(fvec4) 197: TypePointer Workgroup 50(ivec4)
227(inF0): 226(ptr) Variable Input 198(gs_ua4): 197(ptr) Variable Workgroup
230(inF1): 226(ptr) Variable Input 199(gs_ub4): 197(ptr) Variable Workgroup
233(inF2): 226(ptr) Variable Input 210(gs_uc4): 197(ptr) Variable Workgroup
236: TypePointer Input 50(ivec4) 231: 6(float) Constant 1082130432
237(inU0): 236(ptr) Variable Input 232: 48(fvec4) ConstantComposite 144 145 188 231
240(inU1): 236(ptr) Variable Input 236: TypePointer Input 48(fvec4)
242: TypePointer Output 48(fvec4) 237(inF0): 236(ptr) Variable Input
243(@entryPointOutput): 242(ptr) Variable Output 240(inF1): 236(ptr) Variable Input
243(inF2): 236(ptr) Variable Input
246: TypePointer Input 50(ivec4)
247(inU0): 246(ptr) Variable Input
250(inU1): 246(ptr) Variable Input
252: TypePointer Output 48(fvec4)
253(@entryPointOutput): 252(ptr) Variable Output
4(ComputeShaderFunction): 2 Function None 3 4(ComputeShaderFunction): 2 Function None 3
5: Label 5: Label
225(inF0): 49(ptr) Variable Function 235(inF0): 49(ptr) Variable Function
229(inF1): 49(ptr) Variable Function 239(inF1): 49(ptr) Variable Function
232(inF2): 49(ptr) Variable Function 242(inF2): 49(ptr) Variable Function
235(inU0): 51(ptr) Variable Function 245(inU0): 51(ptr) Variable Function
239(inU1): 51(ptr) Variable Function 249(inU1): 51(ptr) Variable Function
244(param): 49(ptr) Variable Function 254(param): 49(ptr) Variable Function
246(param): 49(ptr) Variable Function 256(param): 49(ptr) Variable Function
248(param): 49(ptr) Variable Function 258(param): 49(ptr) Variable Function
250(param): 51(ptr) Variable Function 260(param): 51(ptr) Variable Function
252(param): 51(ptr) Variable Function 262(param): 51(ptr) Variable Function
228: 48(fvec4) Load 227(inF0) 238: 48(fvec4) Load 237(inF0)
Store 225(inF0) 228 Store 235(inF0) 238
231: 48(fvec4) Load 230(inF1) 241: 48(fvec4) Load 240(inF1)
Store 229(inF1) 231 Store 239(inF1) 241
234: 48(fvec4) Load 233(inF2) 244: 48(fvec4) Load 243(inF2)
Store 232(inF2) 234 Store 242(inF2) 244
238: 50(ivec4) Load 237(inU0) 248: 50(ivec4) Load 247(inU0)
Store 235(inU0) 238 Store 245(inU0) 248
241: 50(ivec4) Load 240(inU1) 251: 50(ivec4) Load 250(inU1)
Store 239(inU1) 241 Store 249(inU1) 251
245: 48(fvec4) Load 225(inF0) 255: 48(fvec4) Load 235(inF0)
Store 244(param) 245 Store 254(param) 255
247: 48(fvec4) Load 229(inF1) 257: 48(fvec4) Load 239(inF1)
Store 246(param) 247 Store 256(param) 257
249: 48(fvec4) Load 232(inF2) 259: 48(fvec4) Load 242(inF2)
Store 248(param) 249 Store 258(param) 259
251: 50(ivec4) Load 235(inU0) 261: 50(ivec4) Load 245(inU0)
Store 250(param) 251 Store 260(param) 261
253: 50(ivec4) Load 239(inU1) 263: 50(ivec4) Load 249(inU1)
Store 252(param) 253 Store 262(param) 263
254: 48(fvec4) FunctionCall 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;) 244(param) 246(param) 248(param) 250(param) 252(param) 264: 48(fvec4) FunctionCall 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;) 254(param) 256(param) 258(param) 260(param) 262(param)
Store 243(@entryPointOutput) 254 Store 253(@entryPointOutput) 264
Return Return
FunctionEnd FunctionEnd
16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10 16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10
@ -886,54 +900,55 @@ local_size = (1, 1, 1)
14(inU0): 9(ptr) FunctionParameter 14(inU0): 9(ptr) FunctionParameter
15(inU1): 9(ptr) FunctionParameter 15(inU1): 9(ptr) FunctionParameter
17: Label 17: Label
70(out_u1): 9(ptr) Variable Function 72(out_u1): 9(ptr) Variable Function
60: 6(float) Load 11(inF0) 60: 6(float) Load 11(inF0)
62: 61(bool) All 60 63: 61(bool) FOrdNotEqual 60 62
66: 8(int) Load 65(gs_ub) 64: 61(bool) All 63
69: 2 AtomicIAdd 64(gs_ua) 67 68 66 68: 8(int) Load 67(gs_ub)
71: 8(int) Load 65(gs_ub) 71: 2 AtomicIAdd 66(gs_ua) 69 70 68
72: 8(int) AtomicIAdd 64(gs_ua) 67 68 71 73: 8(int) Load 67(gs_ub)
Store 70(out_u1) 72 74: 8(int) AtomicIAdd 66(gs_ua) 69 70 73
73: 8(int) Load 65(gs_ub) Store 72(out_u1) 74
74: 2 AtomicAnd 64(gs_ua) 67 68 73 75: 8(int) Load 67(gs_ub)
75: 8(int) Load 65(gs_ub) 76: 2 AtomicAnd 66(gs_ua) 69 70 75
76: 8(int) AtomicAnd 64(gs_ua) 67 68 75 77: 8(int) Load 67(gs_ub)
Store 70(out_u1) 76 78: 8(int) AtomicAnd 66(gs_ua) 69 70 77
77: 8(int) Load 65(gs_ub) Store 72(out_u1) 78
79: 8(int) Load 78(gs_uc) 79: 8(int) Load 67(gs_ub)
80: 8(int) AtomicCompareExchange 64(gs_ua) 67 68 68 79 77 81: 8(int) Load 80(gs_uc)
Store 70(out_u1) 80 82: 8(int) AtomicCompareExchange 66(gs_ua) 69 70 70 81 79
81: 8(int) Load 65(gs_ub) Store 72(out_u1) 82
82: 8(int) AtomicExchange 64(gs_ua) 67 68 81 83: 8(int) Load 67(gs_ub)
Store 70(out_u1) 82 84: 8(int) AtomicExchange 66(gs_ua) 69 70 83
83: 8(int) Load 65(gs_ub) Store 72(out_u1) 84
84: 2 AtomicSMax 64(gs_ua) 67 68 83 85: 8(int) Load 67(gs_ub)
85: 8(int) Load 65(gs_ub) 86: 2 AtomicSMax 66(gs_ua) 69 70 85
86: 8(int) AtomicUMax 64(gs_ua) 67 68 85 87: 8(int) Load 67(gs_ub)
Store 70(out_u1) 86 88: 8(int) AtomicUMax 66(gs_ua) 69 70 87
87: 8(int) Load 65(gs_ub) Store 72(out_u1) 88
88: 2 AtomicSMin 64(gs_ua) 67 68 87 89: 8(int) Load 67(gs_ub)
89: 8(int) Load 65(gs_ub) 90: 2 AtomicSMin 66(gs_ua) 69 70 89
90: 8(int) AtomicUMin 64(gs_ua) 67 68 89 91: 8(int) Load 67(gs_ub)
Store 70(out_u1) 90 92: 8(int) AtomicUMin 66(gs_ua) 69 70 91
91: 8(int) Load 65(gs_ub) Store 72(out_u1) 92
92: 2 AtomicOr 64(gs_ua) 67 68 91 93: 8(int) Load 67(gs_ub)
93: 8(int) Load 65(gs_ub) 94: 2 AtomicOr 66(gs_ua) 69 70 93
94: 8(int) AtomicOr 64(gs_ua) 67 68 93 95: 8(int) Load 67(gs_ub)
Store 70(out_u1) 94 96: 8(int) AtomicOr 66(gs_ua) 69 70 95
95: 8(int) Load 65(gs_ub) Store 72(out_u1) 96
96: 2 AtomicXor 64(gs_ua) 67 68 95 97: 8(int) Load 67(gs_ub)
97: 8(int) Load 65(gs_ub) 98: 2 AtomicXor 66(gs_ua) 69 70 97
98: 8(int) AtomicXor 64(gs_ua) 67 68 97 99: 8(int) Load 67(gs_ub)
Store 70(out_u1) 98 100: 8(int) AtomicXor 66(gs_ua) 69 70 99
ReturnValue 99 Store 72(out_u1) 100
ReturnValue 62
FunctionEnd FunctionEnd
22(ComputeShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 18 22(ComputeShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 18
19(inF0): 7(ptr) FunctionParameter 19(inF0): 7(ptr) FunctionParameter
20(inF1): 7(ptr) FunctionParameter 20(inF1): 7(ptr) FunctionParameter
21(inF2): 7(ptr) FunctionParameter 21(inF2): 7(ptr) FunctionParameter
23: Label 23: Label
ReturnValue 99 ReturnValue 62
FunctionEnd FunctionEnd
34(ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 24(fvec2) Function None 28 34(ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 24(fvec2) Function None 28
29(inF0): 25(ptr) FunctionParameter 29(inF0): 25(ptr) FunctionParameter
@ -942,47 +957,48 @@ local_size = (1, 1, 1)
32(inU0): 27(ptr) FunctionParameter 32(inU0): 27(ptr) FunctionParameter
33(inU1): 27(ptr) FunctionParameter 33(inU1): 27(ptr) FunctionParameter
35: Label 35: Label
111(out_u2): 27(ptr) Variable Function 115(out_u2): 27(ptr) Variable Function
104: 24(fvec2) Load 29(inF0) 105: 24(fvec2) Load 29(inF0)
105: 61(bool) All 104 108: 106(bvec2) FOrdNotEqual 105 107
109: 26(ivec2) Load 108(gs_ub2) 109: 61(bool) All 108
110: 2 AtomicIAdd 107(gs_ua2) 67 68 109 113: 26(ivec2) Load 112(gs_ub2)
112: 26(ivec2) Load 108(gs_ub2) 114: 2 AtomicIAdd 111(gs_ua2) 69 70 113
113: 26(ivec2) AtomicIAdd 107(gs_ua2) 67 68 112 116: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 113 117: 26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 116
114: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 117
115: 2 AtomicAnd 107(gs_ua2) 67 68 114 118: 26(ivec2) Load 112(gs_ub2)
116: 26(ivec2) Load 108(gs_ub2) 119: 2 AtomicAnd 111(gs_ua2) 69 70 118
117: 26(ivec2) AtomicAnd 107(gs_ua2) 67 68 116 120: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 117 121: 26(ivec2) AtomicAnd 111(gs_ua2) 69 70 120
118: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 121
120: 26(ivec2) Load 119(gs_uc2) 122: 26(ivec2) Load 112(gs_ub2)
121: 26(ivec2) AtomicCompareExchange 107(gs_ua2) 67 68 68 120 118 124: 26(ivec2) Load 123(gs_uc2)
Store 111(out_u2) 121 125: 26(ivec2) AtomicCompareExchange 111(gs_ua2) 69 70 70 124 122
122: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 125
123: 26(ivec2) AtomicExchange 107(gs_ua2) 67 68 122 126: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 123 127: 26(ivec2) AtomicExchange 111(gs_ua2) 69 70 126
124: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 127
125: 2 AtomicSMax 107(gs_ua2) 67 68 124 128: 26(ivec2) Load 112(gs_ub2)
126: 26(ivec2) Load 108(gs_ub2) 129: 2 AtomicSMax 111(gs_ua2) 69 70 128
127: 26(ivec2) AtomicUMax 107(gs_ua2) 67 68 126 130: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 127 131: 26(ivec2) AtomicUMax 111(gs_ua2) 69 70 130
128: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 131
129: 2 AtomicSMin 107(gs_ua2) 67 68 128 132: 26(ivec2) Load 112(gs_ub2)
130: 26(ivec2) Load 108(gs_ub2) 133: 2 AtomicSMin 111(gs_ua2) 69 70 132
131: 26(ivec2) AtomicUMin 107(gs_ua2) 67 68 130 134: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 131 135: 26(ivec2) AtomicUMin 111(gs_ua2) 69 70 134
132: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 135
133: 2 AtomicOr 107(gs_ua2) 67 68 132 136: 26(ivec2) Load 112(gs_ub2)
134: 26(ivec2) Load 108(gs_ub2) 137: 2 AtomicOr 111(gs_ua2) 69 70 136
135: 26(ivec2) AtomicOr 107(gs_ua2) 67 68 134 138: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 135 139: 26(ivec2) AtomicOr 111(gs_ua2) 69 70 138
136: 26(ivec2) Load 108(gs_ub2) Store 115(out_u2) 139
137: 2 AtomicXor 107(gs_ua2) 67 68 136 140: 26(ivec2) Load 112(gs_ub2)
138: 26(ivec2) Load 108(gs_ub2) 141: 2 AtomicXor 111(gs_ua2) 69 70 140
139: 26(ivec2) AtomicXor 107(gs_ua2) 67 68 138 142: 26(ivec2) Load 112(gs_ub2)
Store 111(out_u2) 139 143: 26(ivec2) AtomicXor 111(gs_ua2) 69 70 142
ReturnValue 142 Store 115(out_u2) 143
ReturnValue 146
FunctionEnd FunctionEnd
46(ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 36(fvec3) Function None 40 46(ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 36(fvec3) Function None 40
41(inF0): 37(ptr) FunctionParameter 41(inF0): 37(ptr) FunctionParameter
@ -991,47 +1007,48 @@ local_size = (1, 1, 1)
44(inU0): 39(ptr) FunctionParameter 44(inU0): 39(ptr) FunctionParameter
45(inU1): 39(ptr) FunctionParameter 45(inU1): 39(ptr) FunctionParameter
47: Label 47: Label
152(out_u3): 39(ptr) Variable Function 159(out_u3): 39(ptr) Variable Function
145: 36(fvec3) Load 41(inF0) 149: 36(fvec3) Load 41(inF0)
146: 61(bool) All 145 152: 150(bvec3) FOrdNotEqual 149 151
150: 38(ivec3) Load 149(gs_ub3) 153: 61(bool) All 152
151: 2 AtomicIAdd 148(gs_ua3) 67 68 150 157: 38(ivec3) Load 156(gs_ub3)
153: 38(ivec3) Load 149(gs_ub3) 158: 2 AtomicIAdd 155(gs_ua3) 69 70 157
154: 38(ivec3) AtomicIAdd 148(gs_ua3) 67 68 153 160: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 154 161: 38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 160
155: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 161
156: 2 AtomicAnd 148(gs_ua3) 67 68 155 162: 38(ivec3) Load 156(gs_ub3)
157: 38(ivec3) Load 149(gs_ub3) 163: 2 AtomicAnd 155(gs_ua3) 69 70 162
158: 38(ivec3) AtomicAnd 148(gs_ua3) 67 68 157 164: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 158 165: 38(ivec3) AtomicAnd 155(gs_ua3) 69 70 164
159: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 165
161: 38(ivec3) Load 160(gs_uc3) 166: 38(ivec3) Load 156(gs_ub3)
162: 38(ivec3) AtomicCompareExchange 148(gs_ua3) 67 68 68 161 159 168: 38(ivec3) Load 167(gs_uc3)
Store 152(out_u3) 162 169: 38(ivec3) AtomicCompareExchange 155(gs_ua3) 69 70 70 168 166
163: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 169
164: 38(ivec3) AtomicExchange 148(gs_ua3) 67 68 163 170: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 164 171: 38(ivec3) AtomicExchange 155(gs_ua3) 69 70 170
165: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 171
166: 2 AtomicSMax 148(gs_ua3) 67 68 165 172: 38(ivec3) Load 156(gs_ub3)
167: 38(ivec3) Load 149(gs_ub3) 173: 2 AtomicSMax 155(gs_ua3) 69 70 172
168: 38(ivec3) AtomicUMax 148(gs_ua3) 67 68 167 174: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 168 175: 38(ivec3) AtomicUMax 155(gs_ua3) 69 70 174
169: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 175
170: 2 AtomicSMin 148(gs_ua3) 67 68 169 176: 38(ivec3) Load 156(gs_ub3)
171: 38(ivec3) Load 149(gs_ub3) 177: 2 AtomicSMin 155(gs_ua3) 69 70 176
172: 38(ivec3) AtomicUMin 148(gs_ua3) 67 68 171 178: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 172 179: 38(ivec3) AtomicUMin 155(gs_ua3) 69 70 178
173: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 179
174: 2 AtomicOr 148(gs_ua3) 67 68 173 180: 38(ivec3) Load 156(gs_ub3)
175: 38(ivec3) Load 149(gs_ub3) 181: 2 AtomicOr 155(gs_ua3) 69 70 180
176: 38(ivec3) AtomicOr 148(gs_ua3) 67 68 175 182: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 176 183: 38(ivec3) AtomicOr 155(gs_ua3) 69 70 182
177: 38(ivec3) Load 149(gs_ub3) Store 159(out_u3) 183
178: 2 AtomicXor 148(gs_ua3) 67 68 177 184: 38(ivec3) Load 156(gs_ub3)
179: 38(ivec3) Load 149(gs_ub3) 185: 2 AtomicXor 155(gs_ua3) 69 70 184
180: 38(ivec3) AtomicXor 148(gs_ua3) 67 68 179 186: 38(ivec3) Load 156(gs_ub3)
Store 152(out_u3) 180 187: 38(ivec3) AtomicXor 155(gs_ua3) 69 70 186
ReturnValue 182 Store 159(out_u3) 187
ReturnValue 189
FunctionEnd FunctionEnd
58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;): 48(fvec4) Function None 52 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;): 48(fvec4) Function None 52
53(inF0): 49(ptr) FunctionParameter 53(inF0): 49(ptr) FunctionParameter
@ -1040,45 +1057,46 @@ local_size = (1, 1, 1)
56(inU0): 51(ptr) FunctionParameter 56(inU0): 51(ptr) FunctionParameter
57(inU1): 51(ptr) FunctionParameter 57(inU1): 51(ptr) FunctionParameter
59: Label 59: Label
192(out_u4): 51(ptr) Variable Function 202(out_u4): 51(ptr) Variable Function
185: 48(fvec4) Load 53(inF0) 192: 48(fvec4) Load 53(inF0)
186: 61(bool) All 185 195: 193(bvec4) FOrdNotEqual 192 194
190: 50(ivec4) Load 189(gs_ub4) 196: 61(bool) All 195
191: 2 AtomicIAdd 188(gs_ua4) 67 68 190 200: 50(ivec4) Load 199(gs_ub4)
193: 50(ivec4) Load 189(gs_ub4) 201: 2 AtomicIAdd 198(gs_ua4) 69 70 200
194: 50(ivec4) AtomicIAdd 188(gs_ua4) 67 68 193 203: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 194 204: 50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 203
195: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 204
196: 2 AtomicAnd 188(gs_ua4) 67 68 195 205: 50(ivec4) Load 199(gs_ub4)
197: 50(ivec4) Load 189(gs_ub4) 206: 2 AtomicAnd 198(gs_ua4) 69 70 205
198: 50(ivec4) AtomicAnd 188(gs_ua4) 67 68 197 207: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 198 208: 50(ivec4) AtomicAnd 198(gs_ua4) 69 70 207
199: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 208
201: 50(ivec4) Load 200(gs_uc4) 209: 50(ivec4) Load 199(gs_ub4)
202: 50(ivec4) AtomicCompareExchange 188(gs_ua4) 67 68 68 201 199 211: 50(ivec4) Load 210(gs_uc4)
Store 192(out_u4) 202 212: 50(ivec4) AtomicCompareExchange 198(gs_ua4) 69 70 70 211 209
203: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 212
204: 50(ivec4) AtomicExchange 188(gs_ua4) 67 68 203 213: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 204 214: 50(ivec4) AtomicExchange 198(gs_ua4) 69 70 213
205: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 214
206: 2 AtomicSMax 188(gs_ua4) 67 68 205 215: 50(ivec4) Load 199(gs_ub4)
207: 50(ivec4) Load 189(gs_ub4) 216: 2 AtomicSMax 198(gs_ua4) 69 70 215
208: 50(ivec4) AtomicUMax 188(gs_ua4) 67 68 207 217: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 208 218: 50(ivec4) AtomicUMax 198(gs_ua4) 69 70 217
209: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 218
210: 2 AtomicSMin 188(gs_ua4) 67 68 209 219: 50(ivec4) Load 199(gs_ub4)
211: 50(ivec4) Load 189(gs_ub4) 220: 2 AtomicSMin 198(gs_ua4) 69 70 219
212: 50(ivec4) AtomicUMin 188(gs_ua4) 67 68 211 221: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 212 222: 50(ivec4) AtomicUMin 198(gs_ua4) 69 70 221
213: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 222
214: 2 AtomicOr 188(gs_ua4) 67 68 213 223: 50(ivec4) Load 199(gs_ub4)
215: 50(ivec4) Load 189(gs_ub4) 224: 2 AtomicOr 198(gs_ua4) 69 70 223
216: 50(ivec4) AtomicOr 188(gs_ua4) 67 68 215 225: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 216 226: 50(ivec4) AtomicOr 198(gs_ua4) 69 70 225
217: 50(ivec4) Load 189(gs_ub4) Store 202(out_u4) 226
218: 2 AtomicXor 188(gs_ua4) 67 68 217 227: 50(ivec4) Load 199(gs_ub4)
219: 50(ivec4) Load 189(gs_ub4) 228: 2 AtomicXor 198(gs_ua4) 69 70 227
220: 50(ivec4) AtomicXor 188(gs_ua4) 67 68 219 229: 50(ivec4) Load 199(gs_ub4)
Store 192(out_u4) 220 230: 50(ivec4) AtomicXor 198(gs_ua4) 69 70 229
ReturnValue 222 Store 202(out_u4) 230
ReturnValue 232
FunctionEnd FunctionEnd

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4101,6 +4101,28 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
break; break;
} }
case EOpAny: // fall through
case EOpAll:
{
TIntermTyped* typedArg = arguments->getAsTyped();
// HLSL allows float/etc types here, and the SPIR-V opcode requires a bool.
// We'll convert here. Note that for efficiency, we could add a smarter
// decomposition for some type cases, e.g, maybe by decomposing a dot product.
if (typedArg->getType().getBasicType() != EbtBool) {
const TType boolType(EbtBool, EvqTemporary,
typedArg->getVectorSize(),
typedArg->getMatrixCols(),
typedArg->getMatrixRows(),
typedArg->isVector());
typedArg = intermediate.addConversion(EOpConstructBool, boolType, typedArg);
node->getAsUnaryNode()->setOperand(typedArg);
}
break;
}
case EOpSaturate: case EOpSaturate:
{ {
// saturate(a) -> clamp(a,0,1) // saturate(a) -> clamp(a,0,1)