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

Updated to wgpu 0.16.0, wgpu-hal 0.16.0 and naga 0.12.0 #8446

Merged
merged 9 commits into from
Apr 26, 2023
Prev Previous commit
Next Next commit
Replace unwrap_or_default with unwrap in order to meet error in time
  • Loading branch information
airingursb committed Apr 25, 2023
commit 639a09a802d90ee5d935410461d72e8bacedd081
2 changes: 1 addition & 1 deletion crates/bevy_render/src/texture/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ impl TextureFormatPixelInfo for TextureFormat {
fn pixel_size(&self) -> usize {
let info = self;
match info.block_dimensions() {
(1, 1) => info.block_size(None).unwrap_or_default() as usize,
(1, 1) => info.block_size(None).unwrap() as usize,
_ => panic!("Using pixel_size for compressed textures is invalid"),
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_render/src/texture/ktx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn ktx2_buffer_to_image(
texture_format_info.block_dimensions().1,
);
// Texture is not a depth or stencil format, it is possible to pass `None` and unwrap
let block_bytes = texture_format_info.block_size(None).unwrap_or_default();
let block_bytes = texture_format_info.block_size(None).unwrap();

let transcoder = LowLevelUastcTranscoder::new();
for (level, level_data) in levels.iter().enumerate() {
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn ktx2_buffer_to_image(
texture_format_info.block_dimensions().1 as usize,
);
// Texture is not a depth or stencil format, it is possible to pass `None` and unwrap
let block_bytes = texture_format_info.block_size(None).unwrap_or_default() as usize;
let block_bytes = texture_format_info.block_size(None).unwrap() as usize;

let mut wgpu_data = vec![Vec::default(); (layer_count * face_count) as usize];
for (level, level_data) in levels.iter().enumerate() {
Expand Down