diff options
Diffstat (limited to 'runtime/src/vulkan_scratch.h')
| -rw-r--r-- | runtime/src/vulkan_scratch.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/src/vulkan_scratch.h b/runtime/src/vulkan_scratch.h index fe29d1a5c..4a8a59ddd 100644 --- a/runtime/src/vulkan_scratch.h +++ b/runtime/src/vulkan_scratch.h | |||
| @@ -94,11 +94,14 @@ public: | |||
| 94 | // Keeps for reuse (or frees) the chunks of finished submissions. | 94 | // Keeps for reuse (or frees) the chunks of finished submissions. |
| 95 | void collect() { | 95 | void collect() { |
| 96 | for (std::size_t i = 0; i < retired_.size();) { | 96 | for (std::size_t i = 0; i < retired_.size();) { |
| 97 | std::uint64_t done = 0; | 97 | if (retired_[i].ticket != 0) { |
| 98 | if (retired_[i].timeline) vk_.vkGetSemaphoreCounterValue(device_, retired_[i].timeline, &done); | 98 | std::uint64_t done = 0; |
| 99 | if (done < retired_[i].ticket) { | 99 | if (!retired_[i].timeline || |
| 100 | ++i; | 100 | vk_.vkGetSemaphoreCounterValue(device_, retired_[i].timeline, &done) != VK_SUCCESS || |
| 101 | continue; | 101 | done < retired_[i].ticket) { |
| 102 | ++i; | ||
| 103 | continue; | ||
| 104 | } | ||
| 102 | } | 105 | } |
| 103 | for (auto& chunk : retired_[i].chunks) { | 106 | for (auto& chunk : retired_[i].chunks) { |
| 104 | chunk.used = 0; | 107 | chunk.used = 0; |