diff options
author | Chuyan Zhang <me@zcy.moe> | 2024-09-07 00:40:38 -0700 |
---|---|---|
committer | Chuyan Zhang <me@zcy.moe> | 2024-09-07 00:40:38 -0700 |
commit | 2ead02037dc89e987fbc0a021fe470e29d226cfd (patch) | |
tree | 473011eda50080299be844e69f82cec75aa4fb95 /src/vulkan_swapchain.h | |
parent | e12ca33626bdadedc3158cb69f2a4d2f9bbeeeb0 (diff) | |
download | iris-2ead02037dc89e987fbc0a021fe470e29d226cfd.tar.gz iris-2ead02037dc89e987fbc0a021fe470e29d226cfd.zip |
Add more encapsulation, use VMA for allocation
Diffstat (limited to 'src/vulkan_swapchain.h')
-rw-r--r-- | src/vulkan_swapchain.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vulkan_swapchain.h b/src/vulkan_swapchain.h index 99405b6..509753f 100644 --- a/src/vulkan_swapchain.h +++ b/src/vulkan_swapchain.h @@ -1,5 +1,4 @@ #include "imgui_impl_glfw.h" -#include "imgui_impl_vulkan.h" #include "vulkan_helper.h" #include "vulkan/vulkan_core.h" #include <cstdint> @@ -12,7 +11,7 @@ std::vector<std::string> get_glfw_instance_extensions(); namespace iris { struct Swapchain { - iris::Device device; + Device device; VkSurfaceKHR surface = VK_NULL_HANDLE; VkSwapchainKHR swapchain = VK_NULL_HANDLE; @@ -21,12 +20,16 @@ struct Swapchain { GLFWwindow *window = nullptr; uint32_t width = -1; uint32_t height = -1; + bool needs_recreate = false; static constexpr uint32_t SWAPCHAIN_IMAGE_COUNT = 3; VkImage swapchain_images[SWAPCHAIN_IMAGE_COUNT]; VkImageView swapchain_image_views[SWAPCHAIN_IMAGE_COUNT]; VkFramebuffer framebuffers[SWAPCHAIN_IMAGE_COUNT]; + Texture2D upload_texture; + + void resize(uint32_t new_width, uint32_t new_height); Swapchain(GLFWwindow *window, iris::Device device); ~Swapchain(); }; |