Skip to content

Commit

Permalink
Handle MissingFeatures in create_texture_view
Browse files Browse the repository at this point in the history
Signed-off-by: sagudev <[email protected]>
  • Loading branch information
sagudev committed Dec 18, 2024
1 parent 990ca76 commit 9a9508b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,8 @@ impl Device {
}
};

let allowed_format_usages = resolved_format
.guaranteed_format_features(self.features)
let allowed_format_usages = self
.describe_format_features(resolved_format)?
.allowed_usages;
if resolved_usage.contains(wgt::TextureUsages::RENDER_ATTACHMENT)
&& !allowed_format_usages.contains(wgt::TextureUsages::RENDER_ATTACHMENT)
Expand Down
2 changes: 2 additions & 0 deletions wgpu-core/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,8 @@ pub enum CreateTextureViewError {
},
#[error(transparent)]
InvalidResource(#[from] InvalidResourceError),
#[error(transparent)]
MissingFeatures(#[from] MissingFeatures),
}

#[derive(Clone, Debug, Error)]
Expand Down

0 comments on commit 9a9508b

Please sign in to comment.