Avoid generating 8/16-bit constants when 8/16-bit arithmetic extensions aren't enabled

This commit is contained in:
Jeff Bolz
2019-07-10 13:06:15 -05:00
parent f970253a5d
commit c1ad396258
10 changed files with 136 additions and 80 deletions

View File

@@ -1,8 +1,7 @@
spv.16bitstorage-int.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 172
// Id's are bound by 171
Capability Shader
Capability StorageUniformBufferBlock16
@@ -210,10 +209,7 @@ Validation failed
114: 20(int) Constant 7
115: 20(int) Constant 6
116: TypePointer Uniform 20(int)
166: 6(int16_t) Constant 1
167: 6(int16_t) Constant 2
168: 7(i16vec2) ConstantComposite 166 167
170: 6(int16_t) Constant 3
166: 39(ivec2) ConstantComposite 32 33
4(main): 2 Function None 3
5: Label
69(x0): 68(ptr) Variable Function
@@ -333,9 +329,11 @@ Validation failed
164: 6(int16_t) Load 163
165: 28(ptr) AccessChain 19(b2) 21
Store 165 164
169: 42(ptr) AccessChain 19(b2) 32
Store 169 168
171: 28(ptr) AccessChain 19(b2) 21
Store 171 170
167: 7(i16vec2) SConvert 166
168: 42(ptr) AccessChain 19(b2) 32
Store 168 167
169: 6(int16_t) SConvert 58
170: 28(ptr) AccessChain 19(b2) 21
Store 170 169
Return
FunctionEnd

View File

@@ -1,5 +1,4 @@
spv.16bitstorage-uint.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 173
@@ -211,10 +210,8 @@ Validation failed
115: 20(int) Constant 7
116: 20(int) Constant 6
117: TypePointer Uniform 9(int)
167: 6(int16_t) Constant 1
168: 6(int16_t) Constant 2
169: 7(i16vec2) ConstantComposite 167 168
171: 6(int16_t) Constant 3
167: 39(ivec2) ConstantComposite 82 10
170: 9(int) Constant 3
4(main): 2 Function None 3
5: Label
69(x0): 68(ptr) Variable Function
@@ -334,8 +331,10 @@ Validation failed
165: 6(int16_t) Load 164
166: 28(ptr) AccessChain 19(b2) 21
Store 166 165
170: 42(ptr) AccessChain 19(b2) 32
Store 170 169
168: 7(i16vec2) UConvert 167
169: 42(ptr) AccessChain 19(b2) 32
Store 169 168
171: 6(int16_t) UConvert 170
172: 28(ptr) AccessChain 19(b2) 21
Store 172 171
Return

View File

@@ -1,8 +1,7 @@
spv.16bitstorage.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 172
// Id's are bound by 173
Capability Shader
Capability StorageUniformBufferBlock16
@@ -210,10 +209,9 @@ Validation failed
114: 20(int) Constant 7
115: 20(int) Constant 6
116: TypePointer Uniform 20(int)
166:6(float16_t) Constant 15360
167:6(float16_t) Constant 16384
168: 7(f16vec2) ConstantComposite 166 167
170:6(float16_t) Constant 16896
166: 37(float) Constant 1073741824
167: 40(fvec2) ConstantComposite 83 166
170: 37(float) Constant 1077936128
4(main): 2 Function None 3
5: Label
70(x0): 69(ptr) Variable Function
@@ -333,9 +331,11 @@ Validation failed
164:6(float16_t) Load 163
165: 28(ptr) AccessChain 19(b2) 21
Store 165 164
168: 7(f16vec2) FConvert 167
169: 43(ptr) AccessChain 19(b2) 32
Store 169 168
171: 28(ptr) AccessChain 19(b2) 21
Store 171 170
171:6(float16_t) FConvert 170
172: 28(ptr) AccessChain 19(b2) 21
Store 172 171
Return
FunctionEnd

View File

@@ -1,8 +1,7 @@
spv.8bitstorage-int.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 172
// Id's are bound by 171
Capability Shader
Capability UniformAndStorageBuffer8BitAccess
@@ -209,10 +208,7 @@ Validation failed
114: 20(int) Constant 7
115: 20(int) Constant 6
116: TypePointer Uniform 20(int)
166: 6(int8_t) Constant 1
167: 6(int8_t) Constant 2
168: 7(i8vec2) ConstantComposite 166 167
170: 6(int8_t) Constant 3
166: 39(ivec2) ConstantComposite 32 33
4(main): 2 Function None 3
5: Label
69(x0): 68(ptr) Variable Function
@@ -332,9 +328,11 @@ Validation failed
164: 6(int8_t) Load 163
165: 28(ptr) AccessChain 19(b2) 21
Store 165 164
169: 42(ptr) AccessChain 19(b2) 32
Store 169 168
171: 28(ptr) AccessChain 19(b2) 21
Store 171 170
167: 7(i8vec2) SConvert 166
168: 42(ptr) AccessChain 19(b2) 32
Store 168 167
169: 6(int8_t) SConvert 58
170: 28(ptr) AccessChain 19(b2) 21
Store 170 169
Return
FunctionEnd

View File

@@ -1,5 +1,4 @@
spv.8bitstorage-uint.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 173
@@ -210,10 +209,8 @@ Validation failed
115: 20(int) Constant 7
116: 20(int) Constant 6
117: TypePointer Uniform 9(int)
167: 6(int8_t) Constant 1
168: 6(int8_t) Constant 2
169: 7(i8vec2) ConstantComposite 167 168
171: 6(int8_t) Constant 3
167: 39(ivec2) ConstantComposite 82 10
170: 9(int) Constant 3
4(main): 2 Function None 3
5: Label
69(x0): 68(ptr) Variable Function
@@ -333,8 +330,10 @@ Validation failed
165: 6(int8_t) Load 164
166: 28(ptr) AccessChain 19(b2) 21
Store 166 165
170: 42(ptr) AccessChain 19(b2) 32
Store 170 169
168: 7(i8vec2) UConvert 167
169: 42(ptr) AccessChain 19(b2) 32
Store 169 168
171: 6(int8_t) UConvert 170
172: 28(ptr) AccessChain 19(b2) 21
Store 172 171
Return

View File

@@ -2,10 +2,9 @@ spv.bufferhandle11.frag
WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
"precision mediump int; precision highp float;"
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 60
// Id's are bound by 61
Capability Shader
Capability StorageBuffer8BitAccess
@@ -69,7 +68,7 @@ Validation failed
50: 49(ptr) Variable StorageBuffer
51: TypePointer StorageBuffer 6(int)
54: 31(int) Constant 1
58: 27(int8_t) Constant 9
58: 6(int) Constant 9
4(main): 2 Function None 3
5: Label
20(allOk): 19(ptr) Variable Function
@@ -104,8 +103,9 @@ Validation failed
47: Label
56: 33(ptr) AccessChain 30 32
57: 25(ptr) Load 56
59: 36(ptr) AccessChain 57 32
Store 59 58 Aligned 16
59: 27(int8_t) UConvert 58
60: 36(ptr) AccessChain 57 32
Store 60 59 Aligned 16
Return
FunctionEnd
12(compare_uint8_t(u1;u1;): 8(bool) Function None 9