summaryrefslogtreecommitdiff
path: root/src/broadcom/compiler/v3d_compiler.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2021-02-18 08:32:13 +0100
committerMarge Bot <eric+marge@anholt.net>2021-02-23 08:08:01 +0000
commit54c17e45ae8596961b02f356254784c2ef46b9e1 (patch)
treee2761f4e4ba5c2879e6363544f0e35c2a1e46115 /src/broadcom/compiler/v3d_compiler.h
parente1cf2406da9bece65609c087373465b3f827f6f2 (diff)
broadcom/compiler: skip unnecessary unifa writes
If a new UBO load happens to read exactly at the offset right after the previous UBO load (something that is fairly common, for example when reading a matrix), we can skip the unifa write (with its 3 delay slots) and just continue to call ldunifa to continue reading consecutive addresses. Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>
Diffstat (limited to 'src/broadcom/compiler/v3d_compiler.h')
-rw-r--r--src/broadcom/compiler/v3d_compiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h
index 8e83a8ed90c..e1f3511fa8e 100644
--- a/src/broadcom/compiler/v3d_compiler.h
+++ b/src/broadcom/compiler/v3d_compiler.h
@@ -650,6 +650,15 @@ struct v3d_compile {
*/
bool disable_ldunif_opt;
+ /* Last UBO index and offset used with a unifa/ldunifa sequence and the
+ * block where it was emitted. This is used to skip unifa writes (and
+ * their 3 delay slot) when the next UBO load reads right after the
+ * previous one in the same block.
+ */
+ struct qblock *last_unifa_block;
+ int32_t last_unifa_index;
+ uint32_t last_unifa_offset;
+
/* State for whether we're executing on each channel currently. 0 if
* yes, otherwise a block number + 1 that the channel jumped to.
*/