summaryrefslogtreecommitdiff
path: root/src/vk/graphics_pipeline_2d_solid.cpp
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2023-10-02 14:36:20 -0300
committerFrederico Linhares <fred@linhares.blue>2023-10-02 14:36:20 -0300
commit8fa221cb60c19638d4ad0833965fee605593eea3 (patch)
tree95a2494f5581b72f949c92281ff0b793b9e29084 /src/vk/graphics_pipeline_2d_solid.cpp
parente5b15b871f0cf73563431565a492d9ae3e92e35b (diff)
refa Remove redundant framebuffers
* src/vk/framebuffer.hpp: Move to this class all the framebuffers.
Diffstat (limited to 'src/vk/graphics_pipeline_2d_solid.cpp')
-rw-r--r--src/vk/graphics_pipeline_2d_solid.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/vk/graphics_pipeline_2d_solid.cpp b/src/vk/graphics_pipeline_2d_solid.cpp
index 8432a8a..d0c1768 100644
--- a/src/vk/graphics_pipeline_2d_solid.cpp
+++ b/src/vk/graphics_pipeline_2d_solid.cpp
@@ -26,45 +26,6 @@ namespace
{
void
-load_framebuffer(void *obj)
-{
- auto self = static_cast<VK::GraphicsPipeline2DSolid*>(obj);
-
- self->swapchain_framebuffers.resize(cg_core.vk_swapchain->images_count);
- for (auto i{0}; i < cg_core.vk_swapchain->images_count; i++)
- {
- std::array<VkImageView, 1> attachments = {
- cg_core.vk_swapchain->image_views[i]
- };
-
- VkFramebufferCreateInfo framebuffer_info{};
- framebuffer_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
- framebuffer_info.renderPass = cg_core.vk_render_pass->pipeline_2d;
- framebuffer_info.attachmentCount = attachments.size();
- framebuffer_info.pAttachments = attachments.data();
- framebuffer_info.width = cg_core.display_width;
- framebuffer_info.height = cg_core.display_height;
- framebuffer_info.layers = 1;
-
- if(vkCreateFramebuffer(
- cg_core.vk_device_with_swapchain->device, &framebuffer_info, nullptr,
- &self->swapchain_framebuffers[i])
- != VK_SUCCESS)
- throw CommandError{"Failed to create Vulkan Framebuffer."};
- }
-}
-
-void
-unload_framebuffer(void *obj)
-{
- auto self = static_cast<VK::GraphicsPipeline2DSolid*>(obj);
-
- for(auto framebuffer: self->swapchain_framebuffers)
- vkDestroyFramebuffer(
- cg_core.vk_device_with_swapchain->device, framebuffer, nullptr);
-}
-
-void
load_pipeline(void *obj)
{
auto self = static_cast<VK::GraphicsPipeline2DSolid*>(obj);
@@ -253,7 +214,6 @@ unload_pipeline(void *obj)
}
const CommandChain loader{
- {&load_framebuffer, &unload_framebuffer},
{&load_pipeline, &unload_pipeline}
};