화면크기변경 로직 추가
This commit is contained in:
@@ -12,3 +12,5 @@
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "utilities.h"
|
||||
|
||||
#define MAX_BUFFERED_FRAMES (2)
|
||||
|
||||
@@ -8,6 +8,19 @@
|
||||
#include "vertex.h"
|
||||
|
||||
namespace veng {
|
||||
|
||||
struct Frame {
|
||||
VkSemaphore image_available_signal = VK_NULL_HANDLE;
|
||||
VkSemaphore render_finished_signal = VK_NULL_HANDLE;
|
||||
VkFence still_rendering_fence = VK_NULL_HANDLE;
|
||||
|
||||
VkCommandBuffer command_buffer = VK_NULL_HANDLE;
|
||||
|
||||
VkDescriptorSet uniform_set = VK_NULL_HANDLE;
|
||||
BufferHandle uniform_buffer;
|
||||
void* uniform_buffer_location;
|
||||
};
|
||||
|
||||
class Graphics final {
|
||||
public:
|
||||
Graphics(gsl::not_null<Window*> window);
|
||||
@@ -66,6 +79,7 @@ class Graphics final {
|
||||
void CreateDescriptorPools();
|
||||
void CreateDescriptorSets();
|
||||
void CreateTextureSampler();
|
||||
void CreateDepthResources();
|
||||
|
||||
void RecreateSwapChain();
|
||||
void CleanupSwapChain();
|
||||
@@ -111,11 +125,14 @@ class Graphics final {
|
||||
void EndTransientCommandBuffer(VkCommandBuffer command_buffer);
|
||||
void CreateUniformBuffers();
|
||||
|
||||
TextureHandle CreateImage(glm::ivec2 size, VkBufferUsageFlags usage,
|
||||
TextureHandle CreateImage(glm::ivec2 size, VkFormat image_format,
|
||||
VkBufferUsageFlags usage,
|
||||
VkMemoryPropertyFlags properties);
|
||||
void TransitionImageLayout(VkImage image, VkImageLayout old_layout, VkImageLayout new_layout);
|
||||
void TransitionImageLayout(VkImage image, VkImageLayout old_layout,
|
||||
VkImageLayout new_layout);
|
||||
void CopyBufferToImage(VkBuffer buffer, VkImage image, glm::ivec2 image_size);
|
||||
VkImageView CreateImageView(VkImage image, VkFormat format);
|
||||
VkImageView CreateImageView(VkImage image, VkFormat format,
|
||||
VkImageAspectFlags aspect_flag);
|
||||
|
||||
VkViewport GetViewport();
|
||||
VkRect2D GetScissor();
|
||||
@@ -147,23 +164,20 @@ class Graphics final {
|
||||
VkDescriptorSetLayout descriptor_set_layout_ = VK_NULL_HANDLE;
|
||||
|
||||
VkCommandPool command_pool_ = VK_NULL_HANDLE;
|
||||
VkCommandBuffer command_buffer_ = VK_NULL_HANDLE;
|
||||
|
||||
VkSemaphore image_available_signal_ = VK_NULL_HANDLE;
|
||||
VkSemaphore render_finished_signal_ = VK_NULL_HANDLE;
|
||||
VkFence still_rendering_fence_ = VK_NULL_HANDLE;
|
||||
|
||||
std::uint32_t current_image_index_ = 0;
|
||||
|
||||
VkDescriptorSetLayout uniform_set_layout_ = VK_NULL_HANDLE;
|
||||
VkDescriptorPool uniform_pool_ = VK_NULL_HANDLE;
|
||||
VkDescriptorSet uniform_set_ = VK_NULL_HANDLE;
|
||||
BufferHandle uniform_buffer_;
|
||||
void* uniform_buffer_location_;
|
||||
|
||||
|
||||
VkDescriptorSetLayout texture_set_layout_ = VK_NULL_HANDLE;
|
||||
VkDescriptorPool texture_pool_ = VK_NULL_HANDLE;
|
||||
VkSampler texture_sampler_ = VK_NULL_HANDLE;
|
||||
TextureHandle depth_texture_;
|
||||
|
||||
std::array<Frame, MAX_BUFFERED_FRAMES> frames_;
|
||||
std::int32_t current_frame_ = 0;
|
||||
|
||||
gsl::not_null<Window*> window_;
|
||||
bool validation_enabled_ = false;
|
||||
|
||||
Reference in New Issue
Block a user