Skip to content

Commit

Permalink
Merge branch 'wip_swapchain_dynamic' of github.com:tgfrerer/island in…
Browse files Browse the repository at this point in the history
…to wip_swapchain_dynamic
  • Loading branch information
tgfrerer committed Feb 8, 2023
2 parents f3d2e9e + 346d1d5 commit dd35ffd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/le_backend_vk/le_backend_vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ static le_swapchain_handle backend_add_swapchain( le_backend_o* self, le_swapcha

assert( swapchain );

uint64_t swapchain_index = ++self->swapchains_next_handle; // note pre-increment
uint64_t swapchain_index = ++self->swapchains_next_handle; // note pre-increment: this is so that index 0 means invalid swapchain

char swapchain_name[ 64 ];

Expand Down Expand Up @@ -1442,7 +1442,8 @@ static void backend_setup( le_backend_o* self ) {

if ( !self->swapchains.empty() ) {
// Take the first swapchain, and use this to specify the default format for a color attachment
self->defaultFormatColorAttachment = le::Format( self->swapchains.at( 0 ).swapchain_surface_format.format );
// Note that we take swapchain with index 1, as index 0 must not exist (it represents an invalid swapchain index or handle)
self->defaultFormatColorAttachment = le::Format( self->swapchains.at( 1 ).swapchain_surface_format.format );
} else {
self->defaultFormatColorAttachment = le::Format::eB8G8R8A8Unorm;
}
Expand Down

0 comments on commit dd35ffd

Please sign in to comment.