This is needed by Mali Utgard/Midgard GPU which don't have viewport transform HW, and Lima/Panfrost driver can share same implementation in a common place.
I send out this patch series seperatly because Lima is under review in https://gitlab.freedesktop.org/mesa/mesa/merge_requests/465 and Panfrost driver need additinal changes in special uniform handling which I'm not familiar with. I expect Panfrost guys will send out patch to use this and Lima will be another user of it when upstreamed. Qiang Yu (4): mesa: seperate scale and translate in viewport calculation mesa: add STATE_VIEWPORT_SCALE/TRANSLATE nir: add nir_lower_viewport_transform mesa/st: do nir_lower_viewport_transform src/compiler/Makefile.sources | 1 + src/compiler/nir/meson.build | 1 + src/compiler/nir/nir.h | 8 + .../nir/nir_lower_viewport_transform.c | 142 ++++++++++++++++++ src/gallium/auxiliary/util/u_screen.c | 3 + src/gallium/include/pipe/p_defines.h | 1 + src/mesa/main/viewport.c | 26 ++-- src/mesa/program/prog_statevars.c | 35 +++++ src/mesa/program/prog_statevars.h | 2 + src/mesa/state_tracker/st_glsl_to_nir.cpp | 23 +++ src/mesa/state_tracker/st_nir.h | 4 + src/mesa/state_tracker/st_program.c | 1 + 12 files changed, 233 insertions(+), 14 deletions(-) create mode 100644 src/compiler/nir/nir_lower_viewport_transform.c -- 2.17.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev