nir: add rcp(w) lowering for gl_FragCoord

Graphics / Mesa 3D Graphics Library / Mesa - Andreas Baierl [imkreisrum.de] - 29 April 2019 02:46 EDT

On some hardware (e.g. Mali400) the shader needs to apply some transformations for correct gl_FragCoord handling. The lowering actions look like the following in pseudocode: gl_FragCoord.xyz = gl_FragCoord_orig.xyz gl_FragCoord.w = 1.0 / gl_FragCoord_orig.w

Add this lowering as a nir pass in preparation for using it in the driver.

b82de2b4d70 nir: add rcp(w) lowering for gl_FragCoord
src/compiler/Makefile.sources | 1 +
src/compiler/nir/meson.build | 1 +
src/compiler/nir/nir.h | 1 +
src/compiler/nir/nir_lower_fragcoord_wtrans.c | 81 +++++++++++++++++++++++++++
4 files changed, 84 insertions(+)

Upstream: cgit.freedesktop.org


  • Share