Validate DownlevelFlags::READ_ONLY_DEPTH_STENCIL (#4031)

This commit is contained in:
Teodor Tanasoaia authored and GitHub committed 2023-08-11 16:34:35 -04:00
1 parent 0d233b44c5
commit c7da76a4c6
3 files changed
+10 -3

No files matched your search

+1
View File
@@ -67,6 +67,7 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)
### Changes
- Omit texture store bound checks since they are no-ops if out of bounds on all APIs. By @teoxoy in [#3975](https://github.com/gfx-rs/wgpu/pull/3975)
- Validate `DownlevelFlags::READ_ONLY_DEPTH_STENCIL`. By @teoxoy in [#4031](https://github.com/gfx-rs/wgpu/pull/4031)
### Bug Fixes
+7 -1
View File
@@ -960,7 +960,13 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
(is_depth_read_only, is_stencil_read_only) = at.depth_stencil_read_only(ds_aspects)?;
let usage = if is_depth_read_only && is_stencil_read_only {
let usage = if is_depth_read_only
&& is_stencil_read_only
&& device
.downlevel
.flags
.contains(wgt::DownlevelFlags::READ_ONLY_DEPTH_STENCIL)
{
hal::TextureUses::DEPTH_STENCIL_READ | hal::TextureUses::RESOURCE
} else {
hal::TextureUses::DEPTH_STENCIL_WRITE
+2 -2
View File
@@ -1269,8 +1269,8 @@ bitflags::bitflags! {
const INDIRECT_EXECUTION = 1 << 2;
/// Supports non-zero `base_vertex` parameter to indexed draw calls.
const BASE_VERTEX = 1 << 3;
/// Supports reading from a depth/stencil buffer while using as a read-only depth/stencil
/// attachment.
/// Supports reading from a depth/stencil texture while using it as a read-only
/// depth/stencil attachment.
///
/// The WebGL2 and GLES backends do not support RODS.
const READ_ONLY_DEPTH_STENCIL = 1 << 4;