Extended SwapchainSupportDetails API to force it to requery values, use darray's rather than initializer lists and extended the get_framebuffer_extent function to allow disabling the final clamping step at the end of the function. This is used by the swapchain to avoid repeatedly requerying when minimised.

This commit is contained in:
riley committed 2025-07-10 21:50:26 +10:00
1 parent 8ccafddb64
commit aa752bc208
2 files changed
+36 -8

No files matched your search

+6 -3
View File
@@ -19,9 +19,11 @@ namespace basalt
SwapchainSupportDetails(VkPhysicalDevice phy, VkSurfaceKHR surface);
~SwapchainSupportDetails();
VkSurfaceFormatKHR get_surface_format(const std::initializer_list<VkSurfaceFormatKHR>& allowed_formats);
VkPresentModeKHR get_present_mode(const std::initializer_list<VkPresentModeKHR>& allowed_present_modes);
VkExtent2D get_framebuffer_extent(basalt::Window& window);
void requery(basalt::Window& window, VkPhysicalDevice phy, const basalt::darray<VkSurfaceFormatKHR>& allowed_formats, const basalt::darray<VkPresentModeKHR>& allowed_present_modes);
VkSurfaceFormatKHR get_surface_format(const basalt::darray<VkSurfaceFormatKHR>& allowed_formats);
VkPresentModeKHR get_present_mode(const basalt::darray<VkPresentModeKHR>& allowed_present_modes);
VkExtent2D get_framebuffer_extent(basalt::Window& window, bool clamp=true);
VkSurfaceCapabilitiesKHR surface_capabilities;
basalt::darray<VkSurfaceFormatKHR> surface_formats;
@@ -37,6 +39,7 @@ namespace basalt
operator VkPhysicalDevice() noexcept;
VkPhysicalDeviceMemoryProperties memory_props;
basalt::darray<const char*> enabled_extensions;
DeviceQueueFamilyIndicies indicies;
VkSurfaceKHR surface;