Skip to content

Commit

Permalink
Handle 0 height in prepare_bloom_textures
Browse files Browse the repository at this point in the history
  • Loading branch information
NiseVoid committed Jul 26, 2024
1 parent 6dbc8b8 commit 4c5cc14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/bevy_core_pipeline/src/bloom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 4c5cc14

Please sign in to comment.