Mesa (master): nir: Add "viewport vector" system values

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 4 03:48:28 UTC 2019


Module: Mesa
Branch: master
Commit: a83862754e94ea11602ac8c43b940b26775b9c4d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a83862754e94ea11602ac8c43b940b26775b9c4d

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Wed Apr  3 01:45:44 2019 +0000

nir: Add "viewport vector" system values

While a partial set of viewport system values exist, these are scalar
values, which is a poor fit for viewport transformations on vector ISAs
like Midgard (where the vec3 values for scale and offset each need to be
coherent in a vec4 uniform slot to take advantage of vectorized
transform math). This patch adds vec3 scale/offset fields corresponding
to the 3D Gallium viewport / glViewport+depth

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/compiler/nir/nir_intrinsics.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index fd06393d308..9b307b34c75 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -547,10 +547,15 @@ system_value("work_dim", 1)
 # VC4 and V3D need to emit a scaled version of the position in the vertex
 # shaders for binning, and having system values lets us move the math for that
 # into NIR.
+#
+# Panfrost needs to implement all coordinate transformation in the
+# vertex shader; system values allow us to share this routine in NIR.
 system_value("viewport_x_scale", 1)
 system_value("viewport_y_scale", 1)
 system_value("viewport_z_scale", 1)
 system_value("viewport_z_offset", 1)
+system_value("viewport_scale", 3)
+system_value("viewport_offset", 3)
 
 # Blend constant color values.  Float values are clamped.#
 system_value("blend_const_color_r_float", 1)




More information about the mesa-commit mailing list