Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mipmap levels can be 0 and they should be interpreted as 1 #11767

Merged
merged 10 commits into from
Feb 11, 2024
7 changes: 6 additions & 1 deletion crates/bevy_render/src/texture/dds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ pub fn dds_buffer_to_image(
depth_or_array_layers,
}
.physical_size(texture_format);
image.texture_descriptor.mip_level_count = dds.get_num_mipmap_levels();
let mut mip_map_level = dds.get_num_mipmap_levels();
if mip_map_level == 0 {
warn!("Mipmap levels for texture are 0, bumping them to 1");
anarelion marked this conversation as resolved.
Show resolved Hide resolved
mip_map_level = 1;
}
image.texture_descriptor.mip_level_count = mip_map_level;
anarelion marked this conversation as resolved.
Show resolved Hide resolved
superdump marked this conversation as resolved.
Show resolved Hide resolved
image.texture_descriptor.format = texture_format;
image.texture_descriptor.dimension = if dds.get_depth() > 1 {
TextureDimension::D3
Expand Down
Loading