diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 19:52:12 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 19:52:12 +0100 |
| commit | 676c6abae3ca07ca1d3498c26bb12b4e90e21c3e (patch) | |
| tree | 93f21b78c6dc4340075556286a18eae5ce12c909 /runtime/src/vulkan_present.h | |
| parent | dd678a7681f7a046aa5ff173edcbec60a1552f31 (diff) | |
| parent | 162821017ea3c286c8bec860f3ff94f037912061 (diff) | |
Merge main into coverage-gaps (#1299)
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/test_value_semantics.py
AI-assisted.
Diffstat (limited to 'runtime/src/vulkan_present.h')
| -rw-r--r-- | runtime/src/vulkan_present.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/src/vulkan_present.h b/runtime/src/vulkan_present.h index 15a706668..9a73d2f82 100644 --- a/runtime/src/vulkan_present.h +++ b/runtime/src/vulkan_present.h | |||
| @@ -224,11 +224,12 @@ public: | |||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | // The last presented frame as the swapchain stores it (4 bytes a texel, rows tightly packed, format() order). | 226 | // The last presented frame as the swapchain stores it (4 bytes a texel, rows tightly packed, format() order). |
| 227 | // Waits for the frame to finish. False when nothing was presented since enable_capture(). | 227 | // Waits for the frame to finish. False if no captured frame is available or the wait fails. |
| 228 | bool read_back(std::vector<std::uint8_t>& pixels, VkExtent2D* extent, VkFormat* format) { | 228 | bool read_back(std::vector<std::uint8_t>& pixels, VkExtent2D* extent, VkFormat* format) { |
| 229 | if (!capture_ || !capture_ptr_ || !captured_) return false; | 229 | if (!capture_ || !capture_ptr_ || !captured_) return false; |
| 230 | const Frame& frame = frames_[(frame_index_ + frames_.size() - 1) % frames_.size()]; | 230 | const Frame& frame = frames_[(frame_index_ + frames_.size() - 1) % frames_.size()]; |
| 231 | vkWaitForFences_(context_.device(), 1, &frame.done, VK_TRUE, UINT64_MAX); | 231 | if (vkWaitForFences_(context_.device(), 1, &frame.done, VK_TRUE, UINT64_MAX) != VK_SUCCESS) |
| 232 | return false; | ||
| 232 | pixels.assign(capture_ptr_, capture_ptr_ + std::size_t(captured_extent_.width) * captured_extent_.height * 4); | 233 | pixels.assign(capture_ptr_, capture_ptr_ + std::size_t(captured_extent_.width) * captured_extent_.height * 4); |
| 233 | if (extent) *extent = captured_extent_; | 234 | if (extent) *extent = captured_extent_; |
| 234 | if (format) *format = captured_format_; | 235 | if (format) *format = captured_format_; |