Skip to content

Commit

Permalink
Fix 1x1 pixel textures
Browse files Browse the repository at this point in the history
  • Loading branch information
asny committed Aug 20, 2024
1 parent a69b708 commit 39eac7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,12 @@ fn calculate_number_of_mip_maps<T: TextureDataType>(

if mip_map_filter.is_some() {
let max_size = width.max(height).max(depth.unwrap_or(0));
let power_of_two = max_size.next_power_of_two();
(power_of_two as f64).log2() as u32
if max_size < 2 {
1
} else {
let power_of_two = max_size.next_power_of_two();
(power_of_two as f64).log2() as u32
}
} else {
1
}
Expand Down

0 comments on commit 39eac7f

Please sign in to comment.