f7dad9da66
In SPIR-V, builtin integral vectors can be either signed or unsigned, but in MSL they're always unsigned. Unfortunately, the MSL spec forbids implicit conversions between vector types--even if the corresponding scalar types would implicitly convert. If you try, the result is a cryptic error message such as: ``` program_source:37:60: error: cannot convert between vector values of different size ('int4' (aka 'vector_int4') and 'vector_uint4' (vector of 4 'unsigned int' values)) float4 r3 = as_type<float4>((as_type<int4>(r0) * gl_LocalInvocationID.xyyy) + as_type<int4>(r2)); ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Therefore, uses of these builtins must be explicitly cast, since the rest of the binary likely assumes that the builtin is of its declared type. |
||
---|---|---|
.. | ||
bitcast_iadd.asm.comp | ||
bitcast_sar.asm.comp | ||
bitcast_sdiv.asm.comp | ||
bitcast_slr.asm.comp | ||
buffer-write-relative-addr.asm.comp | ||
buffer-write.asm.comp | ||
global-parameter-name-alias.asm.comp | ||
multiple-entry.asm.comp | ||
quantize.asm.comp | ||
specialization-constant-workgroup.asm.comp | ||
storage-buffer-basic.invalid.asm.comp | ||
vector-builtin-type-cast-func.asm.comp | ||
vector-builtin-type-cast.asm.comp |