KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.33k stars 648 forks source link

`choose_surface_format` called twice #972

Closed jherico closed 5 months ago

jherico commented 8 months ago

https://github.com/KhronosGroup/Vulkan-Samples/blob/8ba37b44a693d165c2ab8b9cfdcf1c8774efd407/framework/core/hpp_swapchain.cpp#L330

https://github.com/KhronosGroup/Vulkan-Samples/blob/8ba37b44a693d165c2ab8b9cfdcf1c8774efd407/framework/core/hpp_swapchain.cpp#L320

As far as I can tell, none of the parameters to the call can possibly change between the two calls.

jherico commented 8 months ago

Additionally, surface_formats and present_modes are both stored in the class, but never referenced except in this one function (with the exception of the move constructor, which doesn't really count).

Both these issues are also present in the non-hpp version of the class.