Skip to content

Use the SPIR-V / NIR implementation of atan on GLSL

Neil Roberts requested to merge nroberts/mesa:glsl-nir-atan into master

This moves the NIR implementation of atan and atan2 from the SPIR-V compiler to be a generic NIR builtin. It then adds new IR opcodes for the two atan functions which get lowered during glsl_to_nir using the newly accessible NIR implementation. The IR builtin function declarations now have alternate versions which are used if the compiler has NirOptions set under the assumption that this means the compiler is going to pass it through NIR.

This has the advantage that the atan implementation is now shared between GLSL and SPIR-V on most drivers. It is particularly useful because the SPIR-V implementation has already been modified to handle half floats. This will help when we eventually enable mediump support.

Merge request reports