From 631c01fc421cf60a81cd0af26f64520180685b18 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 11 Dec 2021 18:08:47 -0500 Subject: [PATCH] panfrost: Add an enum for Valhall resource tables Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/util/pan_ir.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 94a3045..63a4586 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -29,6 +29,24 @@ #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 -- 2.7.4