diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index f6a23fb18..b63b6002f 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1083,10 +1083,8 @@ impl Global { if !context.compatible(&pipeline.pass_context) { return Err(RenderCommandError::IncompatiblePipeline.into()); } - if pipeline - .flags - .contains(PipelineFlags::DEPTH_STENCIL_READ_ONLY) - && !is_ds_read_only + if pipeline.flags.contains(PipelineFlags::WRITES_DEPTH_STENCIL) + && is_ds_read_only { return Err(RenderCommandError::IncompatibleReadOnlyDepthStencil.into()); } diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index fe5660995..864fd83f6 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -2403,8 +2403,8 @@ impl Global { if ds.needs_stencil_reference() { flags |= pipeline::PipelineFlags::STENCIL_REFERENCE; } - if ds.is_read_only() { - flags |= pipeline::PipelineFlags::DEPTH_STENCIL_READ_ONLY; + if !ds.is_read_only() { + flags |= pipeline::PipelineFlags::WRITES_DEPTH_STENCIL; } } diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 42578b260..d06f2adfc 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -75,7 +75,7 @@ bitflags::bitflags! { pub struct PipelineFlags: u32 { const BLEND_COLOR = 1; const STENCIL_REFERENCE = 2; - const DEPTH_STENCIL_READ_ONLY = 4; + const WRITES_DEPTH_STENCIL = 4; } }