mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Merge #833
833: Switch pipeline flag to mutation of depth/stencil r=startoaster a=kvark **Connections** Reported on the matrix **Description** If the pass mutates depth/stencil, but the pipeline doesn't, it's not a bug! **Testing** on it... Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
commit
0591c48fd2
@ -1083,10 +1083,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
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());
|
||||
}
|
||||
|
@ -2403,8 +2403,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user