summaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-01-16 14:05:55 -0800
committerChia-I Wu <[email protected]>2019-03-11 10:01:41 -0700
commit2bcaa78236447dd696888b9da67103af74c42bc4 (patch)
treea33c12463763400aa7c1a02c2c00a2802a65caba /src/freedreno/vulkan
parentb01d1618a4d5d3802dce9cfafee072353566a9a8 (diff)
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.
Diffstat (limited to 'src/freedreno/vulkan')
-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;
}