aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/freedreno/vulkan/tu_cs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/freedreno/vulkan/tu_cs.c b/src/freedreno/vulkan/tu_cs.c
index e85925f3a15..cf21d5176c6 100644
--- a/src/freedreno/vulkan/tu_cs.c
+++ b/src/freedreno/vulkan/tu_cs.c
@@ -104,7 +104,8 @@ tu_cs_add_bo(struct tu_device *dev, struct tu_cs *cs, uint32_t byte_size)
VkResult
tu_cs_begin(struct tu_device *dev, struct tu_cs *cs, uint32_t reserve_size)
{
- assert(reserve_size);
+ /* no dangling command packet */
+ assert(cs->start == cs->cur);
if (cs->end - cs->cur < reserve_size) {
uint32_t new_size = MAX2(16384, reserve_size * sizeof(uint32_t));
@@ -115,7 +116,6 @@ tu_cs_begin(struct tu_device *dev, struct tu_cs *cs, uint32_t reserve_size)
if (result != VK_SUCCESS)
return result;
}
- cs->start = cs->cur;
return VK_SUCCESS;
}
@@ -153,6 +153,8 @@ tu_cs_end(struct tu_cs *cs)
.offset = (cs->start - (uint32_t *) bo->map) * sizeof(uint32_t),
};
+ cs->start = cs->cur;
+
return VK_SUCCESS;
}