Mesa (main): pan/mdg: Fix definition of UBO unpack
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 14 04:00:36 UTC 2021
Module: Mesa
Branch: main
Commit: d92e353a113ecf5f9026e6977e3e52abdc5ea162
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d92e353a113ecf5f9026e6977e3e52abdc5ea162
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Mon Dec 13 22:25:46 2021 -0500
pan/mdg: Fix definition of UBO unpack
Needed to link the disassembler separate from the rest of the compiler,
as in out-of-tree pandecode builds. Which I haven't done for Midgard in
well over a year, enough time for this to bit rot.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14185>
---
src/panfrost/midgard/helpers.h | 18 ++++++++++++++++--
src/panfrost/midgard/midgard_emit.c | 11 -----------
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/panfrost/midgard/helpers.h b/src/panfrost/midgard/helpers.h
index 4a4e51fd074..2109aa2d21c 100644
--- a/src/panfrost/midgard/helpers.h
+++ b/src/panfrost/midgard/helpers.h
@@ -377,10 +377,24 @@ midgard_ldst_comp(unsigned reg, unsigned component, unsigned size)
return component;
}
-/* Packs/unpacks a ubo index immediate */
+/* Packs/unpacks a ubo index immediate. The unpack must be defined here so it
+ * can be used with the disassembler, which need not be linked with the main
+ * compiler.
+ */
void midgard_pack_ubo_index_imm(midgard_load_store_word *word, unsigned index);
-unsigned midgard_unpack_ubo_index_imm(midgard_load_store_word word);
+
+static inline unsigned
+midgard_unpack_ubo_index_imm(midgard_load_store_word word)
+{
+ unsigned ubo = word.arg_comp |
+ (word.arg_reg << 2) |
+ (word.bitsize_toggle << 5) |
+ (word.index_format << 6);
+
+ return ubo;
+}
+
/* Packs/unpacks varying parameters.
* FIXME: IMPORTANT: We currently handle varying mode weirdly, by passing all
diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c
index c6e6f34d918..bcff2f114af 100644
--- a/src/panfrost/midgard/midgard_emit.c
+++ b/src/panfrost/midgard/midgard_emit.c
@@ -53,17 +53,6 @@ midgard_pack_ubo_index_imm(midgard_load_store_word *word, unsigned index)
word->index_format = (index >> 6) & 0x3;
}
-unsigned
-midgard_unpack_ubo_index_imm(midgard_load_store_word word)
-{
- unsigned ubo = word.arg_comp |
- (word.arg_reg << 2) |
- (word.bitsize_toggle << 5) |
- (word.index_format << 6);
-
- return ubo;
-}
-
void midgard_pack_varying_params(midgard_load_store_word *word, midgard_varying_params p)
{
/* Currently these parameters are not supported. */
More information about the mesa-commit
mailing list