mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 15:00:57 +01:00
Check GPUDepthStencilState.format even when neither is enabled (#8766)
Fixes #8736
This commit is contained in:
1 parent
592736efa0
commit
df4ae64df6
4 files changed
+17
No files matched your search
@@ -4141,6 +4141,14 @@ impl Device {
|
||||
if let Some(ds) = depth_stencil_state {
|
||||
target_specified = true;
|
||||
let error = 'error: {
|
||||
if !ds.format.is_depth_stencil_format() {
|
||||
// This error case is not redundant with the aspect check below when
|
||||
// neither depth nor stencil is enabled at all.
|
||||
break 'error Some(pipeline::DepthStencilStateError::FormatNotDepthOrStencil(
|
||||
ds.format,
|
||||
));
|
||||
}
|
||||
|
||||
let format_features = self.describe_format_features(ds.format)?;
|
||||
if !format_features
|
||||
.allowed_usages
|
||||
|
||||
@@ -617,6 +617,8 @@ pub enum ColorStateError {
|
||||
pub enum DepthStencilStateError {
|
||||
#[error("Format {0:?} is not renderable")]
|
||||
FormatNotRenderable(wgt::TextureFormat),
|
||||
#[error("Format {0:?} is not a depth/stencil format")]
|
||||
FormatNotDepthOrStencil(wgt::TextureFormat),
|
||||
#[error("Format {0:?} does not have a depth aspect, but depth test/write is enabled")]
|
||||
FormatNotDepth(wgt::TextureFormat),
|
||||
#[error("Format {0:?} does not have a stencil aspect, but stencil test/write is enabled")]
|
||||
|
||||
Reference in new issue
Block a user