wip
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
light7734 2025-10-09 14:29:07 +03:30
parent 6b1c46a06d
commit e6d8798296
Signed by: light7734
GPG key ID: 8C30176798F1A6BA

View file

@ -49,33 +49,33 @@ Swapchain::Swapchain(ISurface *surface, IGpu *gpu, IDevice *device)
m_device->wait_idle(); m_device->wait_idle();
m_images = m_device->get_swapchain_images(m_swapchain); // m_images = m_device->get_swapchain_images(m_swapchain);
m_image_views.resize(m_images.size()); // m_image_views.resize(m_images.size());
for (auto idx = 0u; auto [image, view] : std::views::zip(m_images, m_image_views)) // for (auto idx = 0u; auto [image, view] : std::views::zip(m_images, m_image_views))
{ // {
view = m_device->create_image_view(VkImageViewCreateInfo { // view = m_device->create_image_view(VkImageViewCreateInfo {
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, // .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.image = image, // .image = image,
.viewType = VK_IMAGE_VIEW_TYPE_2D, // .viewType = VK_IMAGE_VIEW_TYPE_2D,
.format = surface_format.format, // .format = surface_format.format,
.components = VkComponentMapping { // .components = VkComponentMapping {
.r = VK_COMPONENT_SWIZZLE_IDENTITY, // .r = VK_COMPONENT_SWIZZLE_IDENTITY,
.g = VK_COMPONENT_SWIZZLE_IDENTITY, // .g = VK_COMPONENT_SWIZZLE_IDENTITY,
.b = VK_COMPONENT_SWIZZLE_IDENTITY, // .b = VK_COMPONENT_SWIZZLE_IDENTITY,
.a = VK_COMPONENT_SWIZZLE_IDENTITY, // .a = VK_COMPONENT_SWIZZLE_IDENTITY,
}, // },
.subresourceRange = VkImageSubresourceRange { // .subresourceRange = VkImageSubresourceRange {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, // .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0u, // .baseMipLevel = 0u,
.levelCount = 1u, // .levelCount = 1u,
.baseArrayLayer = 0u, // .baseArrayLayer = 0u,
.layerCount = 1u, // .layerCount = 1u,
} // }
}); // });
//
m_device->name(image, "swapchain image {}", idx++); // m_device->name(image, "swapchain image {}", idx++);
m_device->name(view, "swapchain image view {}", idx++); // m_device->name(view, "swapchain image view {}", idx++);
} // }
} }
Swapchain::~Swapchain() Swapchain::~Swapchain()
@ -88,7 +88,7 @@ Swapchain::~Swapchain()
try try
{ {
m_device->wait_idle(); m_device->wait_idle();
m_device->destroy_image_views(m_image_views); // m_device->destroy_image_views(m_image_views);
m_device->destroy_swapchain(m_swapchain); m_device->destroy_swapchain(m_swapchain);
} }
catch (const std::exception &exp) catch (const std::exception &exp)