turnip: update cs->start in tu_cs_end

This allows us to assert that there is no dangling command in
tu_cs_begin, rather than discarding them silently.
This commit is contained in:
Chia-I Wu
2019-01-16 14:05:55 -08:00
parent b01d1618a4
commit 2bcaa78236
+4 -2
View File
@@ -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;
}