Skip to content

Commit

Permalink
Fix uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
krOoze committed Jun 18, 2021
1 parent f899e52 commit a6d556a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/HelloTriangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,14 +861,15 @@ std::pair<uint32_t, uint32_t> getQueueFamilies( const VkPhysicalDevice physDevic
return isGraphics( props ) && isPresent( props, queueFamily );
};

uint32_t graphicsQueueFamily, presentQueueFamily;
uint32_t graphicsQueueFamily = notFound;
uint32_t presentQueueFamily = notFound;
if( ::forceSeparatePresentQueue ){
graphicsQueueFamily = findQueueFamilyThat( isGraphics );

const auto isSeparatePresent = [graphicsQueueFamily, isPresent](const VkQueueFamilyProperties& props, const uint32_t queueFamily){
return queueFamily != graphicsQueueFamily && isPresent( props, queueFamily );
};
findQueueFamilyThat( isSeparatePresent );
presentQueueFamily = findQueueFamilyThat( isSeparatePresent );
}
else{
graphicsQueueFamily = presentQueueFamily = findQueueFamilyThat( isFusedGraphicsAndPresent );
Expand Down

0 comments on commit a6d556a

Please sign in to comment.