Add size checks to image and framebuffer
This commit is contained in:
parent
01e01b333f
commit
f36203152e
2 changed files with 6 additions and 0 deletions
|
@ -75,6 +75,9 @@ impl<'a> FramebufferBuilder<'a> {
|
||||||
self.layers,
|
self.layers,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
debug_assert_ne!(self.width, 0);
|
||||||
|
debug_assert_ne!(self.height, 0);
|
||||||
|
|
||||||
let framebuffer = device.create_framebuffer(&framebuffer_ci)?;
|
let framebuffer = device.create_framebuffer(&framebuffer_ci)?;
|
||||||
|
|
||||||
Ok(Arc::new(Framebuffer {
|
Ok(Arc::new(Framebuffer {
|
||||||
|
|
|
@ -440,6 +440,9 @@ impl ImageBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_image(device: &Arc<Device>, image_ci: &VkImageCreateInfo) -> Result<VkImage> {
|
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)
|
device.create_image(image_ci)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue