Mesa (main): panfrost: Move special_varying to compiler definitions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 5 21:42:39 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Sep 27 16:48:33 2021 -0400

panfrost: Move special_varying to compiler definitions

The number of special varyings on midgard can influence how much space
we need to allocate for varyings in the compiler ABI. Move the enum so
we can get access it.

No functional change. This is cc stable purely so the following patches
can be backported.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>

---

 src/panfrost/lib/pan_encoder.h | 24 ------------------------
 src/panfrost/util/pan_ir.h     | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h
index 70621ba5b7f..20dc84fe2c2 100644
--- a/src/panfrost/lib/pan_encoder.h
+++ b/src/panfrost/lib/pan_encoder.h
@@ -36,30 +36,6 @@
 #include "genxml/gen_macros.h"
 #include "pan_device.h"
 
-/* Indices for named (non-XFB) varyings that are present. These are packed
- * tightly so they correspond to a bitfield present (P) indexed by (1 <<
- * PAN_VARY_*). This has the nice property that you can lookup the buffer index
- * of a given special field given a shift S by:
- *
- *      idx = popcount(P & ((1 << S) - 1))
- *
- * That is... look at all of the varyings that come earlier and count them, the
- * count is the new index since plus one. Likewise, the total number of special
- * buffers required is simply popcount(P)
- */
-
-enum pan_special_varying {
-        PAN_VARY_GENERAL = 0,
-        PAN_VARY_POSITION = 1,
-        PAN_VARY_PSIZ = 2,
-        PAN_VARY_PNTCOORD = 3,
-        PAN_VARY_FACE = 4,
-        PAN_VARY_FRAGCOORD = 5,
-
-        /* Keep last */
-        PAN_VARY_MAX,
-};
-
 /* Tiler structure size computation */
 
 unsigned
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index fb714becb7b..c3f166415c6 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -29,6 +29,30 @@
 #include "util/u_dynarray.h"
 #include "util/hash_table.h"
 
+/* Indices for named (non-XFB) varyings that are present. These are packed
+ * tightly so they correspond to a bitfield present (P) indexed by (1 <<
+ * PAN_VARY_*). This has the nice property that you can lookup the buffer index
+ * of a given special field given a shift S by:
+ *
+ *      idx = popcount(P & ((1 << S) - 1))
+ *
+ * That is... look at all of the varyings that come earlier and count them, the
+ * count is the new index since plus one. Likewise, the total number of special
+ * buffers required is simply popcount(P)
+ */
+
+enum pan_special_varying {
+        PAN_VARY_GENERAL = 0,
+        PAN_VARY_POSITION = 1,
+        PAN_VARY_PSIZ = 2,
+        PAN_VARY_PNTCOORD = 3,
+        PAN_VARY_FACE = 4,
+        PAN_VARY_FRAGCOORD = 5,
+
+        /* Keep last */
+        PAN_VARY_MAX,
+};
+
 /* Define the general compiler entry point */
 
 #define MAX_SYSVAL_COUNT 32



More information about the mesa-commit mailing list