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:
bors[bot] 2020-07-24 02:26:50 +00:00 committed by GitHub
commit 0591c48fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -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());
}

View File

@ -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;
}
}

View File

@ -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;
}
}