This adds a lowering pass for transforming gl_Position to screenspace. Previously, the pass lived inside the Panfrost (Midgard) compiler, but now that Lima is en route to the tree, it's best we share it (Lima developed a separate machine-IR-based transform, but we can share the code as NIR).
We're careful to vectorize everything as well (related to last week's sysval patch), to ensure good performance on Midgard (a vector arch). This might be helpful for either GPUs too; I'm not sure. v2: Cleanup considerably by running before IO/var lowering. Alyssa Rosenzweig (2): nir: Add nir_lower_viewport_transform panfrost/midgard: Use shared nir_lower_viewport_transform src/compiler/nir/meson.build | 1 + src/compiler/nir/nir.h | 1 + .../nir/nir_lower_viewport_transform.c | 98 ++++++++++++++++ .../panfrost/midgard/midgard_compile.c | 105 +----------------- 4 files changed, 104 insertions(+), 101 deletions(-) create mode 100644 src/compiler/nir/nir_lower_viewport_transform.c -- 2.20.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev