summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2021-02-07 11:08:33 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-11 17:24:37 +0000
commitd4dccea0ba37d6b8f91b689dd441ba6a4c8ff58c (patch)
treee452364e9ac69aae1be8a5e589b77a9993b4273f
parented810eb0a0c795dcfdf0d22f389a4020203bdff4 (diff)
panfrost: Add UBO push data structure
Will be used to generalize RMU on Midgard and also to support Bifrost's FAU (which is essentially the same thing). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8973>
-rw-r--r--src/panfrost/util/pan_ir.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index 7dd01e63647..02af7174911 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -78,6 +78,25 @@ struct panfrost_sysvals {
struct hash_table_u64 *sysval_to_id;
};
+/* Technically Midgard could go up to 92 in a pathological case but we don't
+ * take advantage of that. Likewise Bifrost's FAU encoding can address 128
+ * words but actual implementations (G72, G76) are capped at 64 */
+
+#define PAN_MAX_PUSH 64
+
+/* Architectural invariants (Midgard and Bifrost): UBO must be <= 2^16 bytes so
+ * an offset to a word must be < 2^16. There are less than 2^8 UBOs */
+
+struct panfrost_ubo_word {
+ uint16_t ubo;
+ uint16_t offset;
+};
+
+struct panfrost_ubo_push {
+ unsigned count;
+ struct panfrost_ubo_word words[PAN_MAX_PUSH];
+};
+
void
panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, void *memctx, nir_shader *shader);
@@ -100,6 +119,10 @@ typedef struct {
unsigned sysval_count;
unsigned sysvals[MAX_SYSVAL_COUNT];
+ /* UBOs to push to Register Mapped Uniforms (Midgard) or Fast Access
+ * Uniforms (Bifrost) */
+ struct panfrost_ubo_push push;
+
int first_tag;
struct util_dynarray compiled;