Skip to content

Commit

Permalink
Update wgpu-core/src/device/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
  • Loading branch information
jinleili and cwfitzgerald committed Jan 11, 2023
1 parent af94a68 commit 2f76114
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,14 +1093,13 @@ impl<A: HalApi> Device<A> {
}
let format = desc.format.unwrap_or(texture.desc.format);
if format != texture.desc.format {
if texture.desc.view_formats.contains(&format) {
self.require_downlevel_flags(wgt::DownlevelFlags::VIEW_FORMATS)?;
} else {
if !texture.desc.view_formats.contains(&format) {
return Err(resource::CreateTextureViewError::FormatReinterpretation {
texture: texture.desc.format,
view: format,
});
}
self.require_downlevel_flags(wgt::DownlevelFlags::VIEW_FORMATS)?;
}

// filter the usages based on the other criteria
Expand Down

0 comments on commit 2f76114

Please sign in to comment.