diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-31 21:29:04 +0200 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-05-31 19:40:59 +0000 |
commit | ba276e5ac21ecfa5bf1e3b9c7ae140c4880e2a3a (patch) | |
tree | 79f2ba02beabe10a809ebfa3558153bd0317be02 /render | |
parent | 3f0487d310974f6ff889ca80e4fb4005553814ed (diff) |
render/vulkan: handle vulkan_record_stage_cb() failures
Diffstat (limited to 'render')
-rw-r--r-- | render/vulkan/renderer.c | 3 | ||||
-rw-r--r-- | render/vulkan/texture.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index f4af9caf..49e28d8f 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -1774,6 +1774,9 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer, } VkCommandBuffer cb = vulkan_record_stage_cb(vk_renderer); + if (cb == VK_NULL_HANDLE) { + return false; + } vulkan_change_layout(cb, dst_image, VK_IMAGE_LAYOUT_UNDEFINED, diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c index 6a895a42..eb4601b5 100644 --- a/render/vulkan/texture.c +++ b/render/vulkan/texture.c @@ -143,6 +143,11 @@ static bool write_pixels(struct wlr_vk_texture *texture, // record staging cb // will be executed before next frame VkCommandBuffer cb = vulkan_record_stage_cb(renderer); + if (cb == VK_NULL_HANDLE) { + free(copies); + return false; + } + vulkan_change_layout(cb, texture->image, old_layout, src_stage, src_access, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_PIPELINE_STAGE_TRANSFER_BIT, |