Skip to content

Commit

Permalink
* vk - Don't attempt to transition swapchain image layouts if the ren…
Browse files Browse the repository at this point in the history
…derer is not rendering into the window. This fixed a bug where a renderer that doesnt draw into the window (and thus is not affected by resizes) would keep its recorded commands and thus try to transition the image layout of the dead swapchain images
  • Loading branch information
harrand committed Apr 25, 2023
1 parent 10b845c commit 32fdb30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tz/gl/impl/vulkan/renderer2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ namespace tz::gl

// if 'no clear output' isn't specified, then we can say old layout is undefined, so we're guaranteed to be in colour attachment after.
// after a present, we want this to be the case so this should work?
if(!options.contains(tz::gl::renderer_option::no_clear_output))
if(!options.contains(tz::gl::renderer_option::no_clear_output) && renderer_output_manager::targets_window())
{
record.transition_image_layout
(vk2::VulkanCommand::TransitionImageLayout{
Expand Down

0 comments on commit 32fdb30

Please sign in to comment.