diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:19 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:19 -0500 |
| commit | f50dac3b8b3b823dc5101beb559448304b4e652b (patch) | |
| tree | 09f028ceeb24041f847043fd1f5fe63c2834a7f5 /runtime/src/vulkan_backend.h | |
| parent | 074ea72818f58c3de33cd6bcdceddb9ee0b88020 (diff) | |
| parent | 00832c18cd3e429d7d9357466a9514be4101dfe1 (diff) | |
Merge pull request #4501 from pmilewsskiedu-gif
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/vulkan_backend.h')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index 217f1e3d5..dc042bf73 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -2891,9 +2891,12 @@ private: | |||
| 2891 | } | 2891 | } |
| 2892 | 2892 | ||
| 2893 | std::uint64_t completed() const { | 2893 | std::uint64_t completed() const { |
| 2894 | if (context_.is_device_lost()) return 0; | ||
| 2894 | std::uint64_t done = 0; | 2895 | std::uint64_t done = 0; |
| 2895 | context_.vk.vkGetSemaphoreCounterValue(context_.device(), progress_, &done); | 2896 | const VkResult result = context_.vk.vkGetSemaphoreCounterValue(context_.device(), progress_, &done); |
| 2896 | return done; | 2897 | if (result == VK_ERROR_DEVICE_LOST) context_.mark_device_lost(); |
| 2898 | // A failed timeline query cannot be used as a resource-retirement or command-buffer reuse ticket. | ||
| 2899 | return result == VK_SUCCESS ? done : 0; | ||
| 2897 | } | 2900 | } |
| 2898 | 2901 | ||
| 2899 | void collect_bindings(std::uint64_t done) { | 2902 | void collect_bindings(std::uint64_t done) { |
| @@ -2905,6 +2908,7 @@ private: | |||
| 2905 | // Releases what every finished command buffer holds; the first of them, or null when none has finished. | 2908 | // Releases what every finished command buffer holds; the first of them, or null when none has finished. |
| 2906 | CommandSlot* recycle_finished() { | 2909 | CommandSlot* recycle_finished() { |
| 2907 | const auto done = completed(); | 2910 | const auto done = completed(); |
| 2911 | if (context_.is_device_lost()) return nullptr; | ||
| 2908 | collect_bindings(done); | 2912 | collect_bindings(done); |
| 2909 | CommandSlot* reuse = nullptr; | 2913 | CommandSlot* reuse = nullptr; |
| 2910 | for (auto& slot : buffers_) { | 2914 | for (auto& slot : buffers_) { |
| @@ -2999,7 +3003,10 @@ private: | |||
| 2999 | bool submit(VkCommandBuffer command_buffer, VkSemaphore fence, std::uint64_t value) { | 3003 | bool submit(VkCommandBuffer command_buffer, VkSemaphore fence, std::uint64_t value) { |
| 3000 | if (context_.is_device_lost()) return false; | 3004 | if (context_.is_device_lost()) return false; |
| 3001 | const std::uint64_t ticket = submitted_ + 1; | 3005 | const std::uint64_t ticket = submitted_ + 1; |
| 3002 | if (last_sparse_) collect_bindings(completed()); | 3006 | if (last_sparse_) { |
| 3007 | collect_bindings(completed()); | ||
| 3008 | if (context_.is_device_lost()) return false; | ||
| 3009 | } | ||
| 3003 | std::span<const VkSemaphore> semaphores = waits_; | 3010 | std::span<const VkSemaphore> semaphores = waits_; |
| 3004 | std::span<const std::uint64_t> values = wait_values_; | 3011 | std::span<const std::uint64_t> values = wait_values_; |
| 3005 | std::vector<VkSemaphore> sparse_waits; | 3012 | std::vector<VkSemaphore> sparse_waits; |