From 6271f5ce797bf12be64c710b66b1b9e93a239829 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Thu, 10 Oct 2024 18:51:05 -0700 Subject: move to new resource abstraction --- src/vulkan_swapchain.h | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/vulkan_swapchain.h (limited to 'src/vulkan_swapchain.h') diff --git a/src/vulkan_swapchain.h b/src/vulkan_swapchain.h deleted file mode 100644 index 8d4604e..0000000 --- a/src/vulkan_swapchain.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once -#include "imgui_impl_glfw.h" -#include "vulkan_helper.h" -#include "vulkan/vulkan_core.h" -#include -#include -#include -#include - -std::vector get_glfw_instance_extensions(); - -namespace iris { - -struct Swapchain { - Device device; - - VkSurfaceKHR surface = VK_NULL_HANDLE; - VkSwapchainKHR swapchain = VK_NULL_HANDLE; - VkRenderPass render_pass = VK_NULL_HANDLE; - VkDescriptorPool descriptor_pool = VK_NULL_HANDLE; - 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]; - VkSemaphore image_available_semaphores[SWAPCHAIN_IMAGE_COUNT]; - VkSemaphore render_finished_semaphores[SWAPCHAIN_IMAGE_COUNT]; - CommandBuffer cmd_buf; - - Texture2D upload_texture; - - ImGuiContext *imgui_context = nullptr; - uint32_t semaphore_index = 0; - uint32_t frame_index = 0; - - void resize(uint32_t new_width, uint32_t new_height); - void start_frame(); - void display(Texture2D &texture); - void release(); - Swapchain(GLFWwindow *window, iris::Device device, uint32_t width, uint32_t height); -}; - -} // namespace iris \ No newline at end of file -- cgit v1.2.3-70-g09d2