Add size checks to image and framebuffer

This commit is contained in:
hodasemi 2023-05-09 17:02:10 +02:00
parent 01e01b333f
commit f36203152e
2 changed files with 6 additions and 0 deletions

View file

@ -75,6 +75,9 @@ impl<'a> FramebufferBuilder<'a> {
self.layers,
);
debug_assert_ne!(self.width, 0);
debug_assert_ne!(self.height, 0);
let framebuffer = device.create_framebuffer(&framebuffer_ci)?;
Ok(Arc::new(Framebuffer {

View file

@ -440,6 +440,9 @@ impl ImageBuilder {
}
fn create_image(device: &Arc<Device>, image_ci: &VkImageCreateInfo) -> Result<VkImage> {
debug_assert_ne!(image_ci.extent.width, 0);
debug_assert_ne!(image_ci.extent.height, 0);
device.create_image(image_ci)
}