[Feat] (MG_Test/Backend/DirectVulkan): RecreateSwapchain()

This commit is contained in:
2026-02-15 19:34:25 +08:00
parent 7c67c99717
commit 1357435e94
2 changed files with 80 additions and 42 deletions
@@ -40,6 +40,8 @@ namespace MobileGL::MG_Backend::DirectVulkan {
void Render();
void Present();
void RecreateSwapchain();
private:
struct QueueFamilyIndices {
Int32 graphicsFamily = -1;
@@ -84,7 +86,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
VkSwapchainKHR m_swapchain = VK_NULL_HANDLE;
VkSurfaceFormatKHR m_swapchainSurfaceFormat;
Vector<VkImage> m_swapchainImages;
VkExtent2D m_swapChainExtent;
VkExtent2D m_swapchainExtent;
Vector<VkImageView> m_swapchainImageViews;
// Vector<VkQueueFamilyProperties> m_queueFamilies;
@@ -120,9 +122,12 @@ namespace MobileGL::MG_Backend::DirectVulkan {
void CreateCommandPool();
void CreateCommandBuffers();
void CreateDefaultRenderPass();
void CreateDefaultFramebuffers();
void PrepareDemoPipeline();
void CreateSyncObjects();
void ShutdownSwapchain();
static Int GetPresentQueueFamilyIndex(
const PhysicalDevice& physicalDevice, VkSurfaceKHR surface,
const Vector<VkQueueFamilyProperties>& queueFamilies, Int preferredFamilyIndex = -1);