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 @@ -59,6 +59,17 @@ tu_cs_reserve_space(struct tu_device *dev, 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. */