Skip to content

nir: lower frcp

Erik Faye-Lund requested to merge kusma/mesa:nir-lower-frcp into master

This MR adds a lower_frcp-flag to nir_shader_compiler_options that optionally lowers frcp instructions to fdivinstructions.

This allows us to emit code like x*rcp(y) as x/y for SPIR-V and DXIL instead of x*(1/y).

The reason this needs its own flag, is that it needs to prevent the 1.0/x -> rcp(x) lowering to avoid infinite loops during compilation.

Merge request reports