panfrost: Add an enum for Valhall resource tables
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 11 Dec 2021 23:08:47 +0000 (18:08 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 1 Mar 2022 19:43:22 +0000 (19:43 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>

src/panfrost/util/pan_ir.h

index 94a3045..63a4586 100644 (file)
 #include "util/u_dynarray.h"
 #include "util/hash_table.h"
 
+/* On Valhall, the driver gives the hardware a table of resource tables.
+ * Resources are addressed as the index of the table together with the index of
+ * the resource within the table. For simplicity, we put one type of resource
+ * in each table and fix the numbering of the tables.
+ *
+ * This numbering is arbitrary. It is a software ABI between the
+ * Gallium driver and the Valhall compiler.
+ */
+enum pan_resource_table {
+        PAN_TABLE_UBO = 0,
+        PAN_TABLE_ATTRIBUTE,
+        PAN_TABLE_ATTRIBUTE_BUFFER,
+        PAN_TABLE_SAMPLER,
+        PAN_TABLE_TEXTURE,
+
+        PAN_NUM_RESOURCE_TABLES
+};
+
 /* 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