nir: account for point-coord origin when lowering it

Graphics / Mesa 3D Graphics Library / Mesa - Danylo Piliaiev [igalia.com] - 4 January 2021 13:41 UTC

The resulting point-coord origin not only depends on whether the draw buffer is flipped but also on GL_POINT_SPRITE_COORD_ORIGIN state. Which makes its transform differ from a transform of wpos.

On freedreno fixes: gl-3.2-pointsprite-origin gl-3.2-pointsprite-origin -fbo

Fixes: d934d320 "nir: Add flipping of gl_PointCoord.y in nir_lower_wpos_ytransform."

33fd9e5d8a6 nir: account for point-coord origin when lowering it
src/compiler/nir/meson.build | 1 +
src/compiler/nir/nir.h | 8 +-
src/compiler/nir/nir_lower_pntc_ytransform.c | 134 +++++++++++++++++++++++++++
src/compiler/nir/nir_lower_wpos_ytransform.c | 29 ------
src/mesa/program/prog_statevars.c | 18 ++++
src/mesa/program/prog_statevars.h | 1 +
src/mesa/state_tracker/st_glsl_to_nir.cpp | 8 ++
7 files changed, 169 insertions(+), 30 deletions(-)

Upstream: cgit.freedesktop.org


  • Share