Two new passes have been added to spirv-opt to automatically convert SPIR-V shaders to utilize RelaxedPrecision semantics. These passes allow the developer to take advantage of lower precision computations without having to make changes to the shader source. The first pass can be used to automatically convert a whole SPIR-V shader to use RelaxedPrecision, which can be advantageous on both mobile and desktop GPUs. The second pass can be used to automatically convert a RelaxedPrecision-decorated shader to explicitly use 16-bit precision on devices that do not support RelaxedPrecision, but do support the VK_KHR_shader_float16_int8 extension, such as iOS/MoltenVK.
Automatic RelaxedPrecision Decoration and Conversion in Spirv-Opt
