summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-02-25 14:49:34 -0800
committerChia-I Wu <[email protected]>2019-03-11 10:02:13 -0700
commitfffaa9b4b36be4abdecefd4578ca685da57ed3e2 (patch)
treed89ca95bcb61070cb8d2068175888669567ad291 /src
parent10c50134422ae166fccfe4fbf4961407b63d20f5 (diff)
turnip: add tu_cs_discard_entries
We will start a draw IB at the beginning of a subpass and consume it at the end of the subpass. With tu_cs_discard_entries, we can reuse the same tu_cs for all subpasses.
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/vulkan/tu_cs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_cs.h b/src/freedreno/vulkan/tu_cs.h
index 24053c0af88..4df7fb806e3 100644
--- a/src/freedreno/vulkan/tu_cs.h
+++ b/src/freedreno/vulkan/tu_cs.h
@@ -60,6 +60,17 @@ void
tu_cs_reset(struct tu_device *dev, struct tu_cs *cs);
/**
+ * Discard all entries. This allows \a cs to be reused while keeping the
+ * existing BOs and command packets intact.
+ */
+static inline void
+tu_cs_discard_entries(struct tu_cs *cs)
+{
+ assert(cs->mode == TU_CS_MODE_GROW);
+ cs->entry_count = 0;
+}
+
+/**
* Get the size needed for tu_cs_emit_call.
*/
static inline uint32_t