Mesa (main): nir: Add nir_intrinsic_load_back_face_agx

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 5 21:05:53 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Sat Jun  5 15:05:37 2021 -0400

nir: Add nir_intrinsic_load_back_face_agx

On AGX, the special register for front facing is inverted from its meaning in
APIs. We need to lower load_front_face to inot(load_back_face). Doing this in
the backend is trivial, but then we would miss out on algebraic optimizations
for the inot.

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Acked-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199>

---

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

diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index 072a366c786..18d24b90a9e 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -1183,6 +1183,9 @@ store("tlb_sample_color_v3d", [1], [BASE, COMPONENT, SRC_TYPE], [])
 # the target framebuffer
 intrinsic("load_fb_layers_v3d", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER])
 
+# Logical complement of load_front_face, mapping to an AGX system value
+system_value("back_face_agx", 1, bit_sizes=[1, 32])
+
 # Intel-specific query for loading from the brw_image_param struct passed
 # into the shader as a uniform.  The variable is a deref to the image
 # variable. The const index specifies which of the six parameters to load.



More information about the mesa-commit mailing list