reinitialise image slice on resize

This commit is contained in:
Alex Janka 2023-10-19 14:24:01 +11:00
parent 81bf301666
commit ecaac2afc1

View file

@ -479,6 +479,22 @@ impl VulkanWindowInner {
SwapchainData::new(resolutions, manager, &self.surface, &self.vulkan_data);
self.framebuffers =
FramebufferData::new(&self.swapchain, &self.vulkan_data, self.renderpass);
let image_ptr = self
.vulkan_data
.device
.map_memory(
self.swapchain.shader_input_image_buffer_memory,
0,
self.swapchain.shader_input_image_buffer_memory_req.size,
vk::MemoryMapFlags::empty(),
)
.unwrap();
self.image_slice = Align::new(
image_ptr,
std::mem::align_of::<u8>() as u64,
self.swapchain.shader_input_image_buffer_memory_req.size,
);
}
unsafe fn new_frame(&mut self, buffer: &[[u8; 4]]) {