ci(amd64/clang/lsan): fix leak sanitizer errors #57
					 1 changed files with 28 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -49,33 +49,33 @@ Swapchain::Swapchain(ISurface *surface, IGpu *gpu, IDevice *device)
 | 
			
		|||
	m_device->wait_idle();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	m_images = m_device->get_swapchain_images(m_swapchain);
 | 
			
		||||
	m_image_views.resize(m_images.size());
 | 
			
		||||
	for (auto idx = 0u; auto [image, view] : std::views::zip(m_images, m_image_views))
 | 
			
		||||
	{
 | 
			
		||||
		view = m_device->create_image_view(VkImageViewCreateInfo {
 | 
			
		||||
			.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
 | 
			
		||||
			.image = image,
 | 
			
		||||
			.viewType = VK_IMAGE_VIEW_TYPE_2D,
 | 
			
		||||
			.format = surface_format.format,
 | 
			
		||||
            .components = VkComponentMapping {
 | 
			
		||||
                .r = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
                .g = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
                .b = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
                .a = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
            },
 | 
			
		||||
            .subresourceRange = VkImageSubresourceRange {
 | 
			
		||||
                .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
 | 
			
		||||
                .baseMipLevel = 0u,
 | 
			
		||||
                .levelCount = 1u,
 | 
			
		||||
                .baseArrayLayer = 0u,
 | 
			
		||||
                .layerCount = 1u,
 | 
			
		||||
            }
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		m_device->name(image, "swapchain image {}", idx++);
 | 
			
		||||
		m_device->name(view, "swapchain image view {}", idx++);
 | 
			
		||||
	}
 | 
			
		||||
	// m_images = m_device->get_swapchain_images(m_swapchain);
 | 
			
		||||
	// m_image_views.resize(m_images.size());
 | 
			
		||||
	// for (auto idx = 0u; auto [image, view] : std::views::zip(m_images, m_image_views))
 | 
			
		||||
	// {
 | 
			
		||||
	// 	view = m_device->create_image_view(VkImageViewCreateInfo {
 | 
			
		||||
	// 		.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
 | 
			
		||||
	// 		.image = image,
 | 
			
		||||
	// 		.viewType = VK_IMAGE_VIEW_TYPE_2D,
 | 
			
		||||
	// 		.format = surface_format.format,
 | 
			
		||||
	//            .components = VkComponentMapping {
 | 
			
		||||
	//                .r = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
	//                .g = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
	//                .b = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
	//                .a = VK_COMPONENT_SWIZZLE_IDENTITY,
 | 
			
		||||
	//            },
 | 
			
		||||
	//            .subresourceRange = VkImageSubresourceRange {
 | 
			
		||||
	//                .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
 | 
			
		||||
	//                .baseMipLevel = 0u,
 | 
			
		||||
	//                .levelCount = 1u,
 | 
			
		||||
	//                .baseArrayLayer = 0u,
 | 
			
		||||
	//                .layerCount = 1u,
 | 
			
		||||
	//            }
 | 
			
		||||
	// 	});
 | 
			
		||||
	//
 | 
			
		||||
	// 	m_device->name(image, "swapchain image {}", idx++);
 | 
			
		||||
	// 	m_device->name(view, "swapchain image view {}", idx++);
 | 
			
		||||
	// }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Swapchain::~Swapchain()
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ Swapchain::~Swapchain()
 | 
			
		|||
	try
 | 
			
		||||
	{
 | 
			
		||||
		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);
 | 
			
		||||
	}
 | 
			
		||||
	catch (const std::exception &exp)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue