From 4c5cc14e535abb6cbb0c90b2962f05801fad352d Mon Sep 17 00:00:00 2001 From: NiseVoid Date: Sun, 21 Jul 2024 22:01:45 +0200 Subject: [PATCH] Handle 0 height in prepare_bloom_textures --- crates/bevy_core_pipeline/src/bloom/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bevy_core_pipeline/src/bloom/mod.rs b/crates/bevy_core_pipeline/src/bloom/mod.rs index 4069fd2cfcd90..064cd47c8e34b 100644 --- a/crates/bevy_core_pipeline/src/bloom/mod.rs +++ b/crates/bevy_core_pipeline/src/bloom/mod.rs @@ -338,7 +338,11 @@ fn prepare_bloom_textures( { // How many times we can halve the resolution minus one so we don't go unnecessarily low let mip_count = MAX_MIP_DIMENSION.ilog2().max(2) - 1; - let mip_height_ratio = MAX_MIP_DIMENSION as f32 / height as f32; + let mip_height_ratio = if height != 0 { + MAX_MIP_DIMENSION as f32 / height as f32 + } else { + 0. + }; let texture_descriptor = TextureDescriptor { label: Some("bloom_texture"),