Check for attachment overlap using textures, not views (#8402)

This commit is contained in:
Andy Leiserson 2025-10-22 08:37:38 -07:00 committed by GitHub
parent d575c0234b
commit 7f644452f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 7 deletions

View File

@ -94,6 +94,7 @@ SamplerDescriptor {
- Reject binding indices that exceed `wgpu_types::Limits::max_bindings_per_bind_group` when deriving a bind group layout for a pipeline. By @jimblandy in [#8325](https://github.com/gfx-rs/wgpu/pull/8325).
- Removed three features from `wgpu-hal` which did nothing useful: `"cargo-clippy"`, `"gpu-allocator"`, and `"rustc-hash"`. By @kpreid in [#8357](https://github.com/gfx-rs/wgpu/pull/8357).
- `wgpu_types::PollError` now always implements the `Error` trait. By @kpreid in [#8384](https://github.com/gfx-rs/wgpu/pull/8384).
- The texture subresources used by the color attachments of a render pass are no longer allowed to overlap when accessed via different texture views. By @andyleiserson in [#8402](https://github.com/gfx-rs/wgpu/pull/8402).
#### DX12

View File

@ -125,6 +125,7 @@ webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,depth
// FAIL: webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,depthSlice,overlaps,diff_miplevel:*
webgpu:api,validation,render_pass,render_pass_descriptor:resolveTarget,*
webgpu:api,validation,render_pass,resolve:resolve_attachment:*
webgpu:api,validation,resource_usages,texture,in_pass_encoder:subresources_and_binding_types_combination_for_color:compute=false;type0="render-target";type1="render-target"
webgpu:api,validation,texture,rg11b10ufloat_renderable:*
webgpu:api,operation,render_pipeline,overrides:*
webgpu:api,operation,rendering,basic:clear:*

View File

@ -1241,8 +1241,11 @@ impl RenderPassInfo {
) -> Result<(), ColorAttachmentError> {
let mut insert = |slice| {
let mip_level = view.desc.range.base_mip_level;
if attachment_set.insert((view.tracking_data.tracker_index(), mip_level, slice))
{
if attachment_set.insert((
view.parent.tracking_data.tracker_index(),
mip_level,
slice,
)) {
Ok(())
} else {
Err(ColorAttachmentError::SubresourceOverlap {

View File

@ -1806,7 +1806,6 @@ impl Device {
samples: texture.desc.sample_count,
selector,
label: desc.label.to_string(),
tracking_data: TrackingData::new(self.tracker_indices.texture_views.clone()),
};
let view = Arc::new(view);

View File

@ -1654,7 +1654,6 @@ pub struct TextureView {
pub(crate) selector: TextureSelector,
/// The `label` from the descriptor used to create the resource.
pub(crate) label: String,
pub(crate) tracking_data: TrackingData,
}
impl Drop for TextureView {
@ -1821,7 +1820,6 @@ crate::impl_resource_type!(TextureView);
crate::impl_labeled!(TextureView);
crate::impl_parent_device!(TextureView);
crate::impl_storage_item!(TextureView);
crate::impl_trackable!(TextureView);
pub type ExternalTextureDescriptor<'a> = wgt::ExternalTextureDescriptor<Label<'a>>;

View File

@ -224,7 +224,6 @@ impl SharedTrackerIndexAllocator {
pub(crate) struct TrackerIndexAllocators {
pub buffers: Arc<SharedTrackerIndexAllocator>,
pub textures: Arc<SharedTrackerIndexAllocator>,
pub texture_views: Arc<SharedTrackerIndexAllocator>,
pub external_textures: Arc<SharedTrackerIndexAllocator>,
pub samplers: Arc<SharedTrackerIndexAllocator>,
pub bind_groups: Arc<SharedTrackerIndexAllocator>,
@ -241,7 +240,6 @@ impl TrackerIndexAllocators {
TrackerIndexAllocators {
buffers: Arc::new(SharedTrackerIndexAllocator::new()),
textures: Arc::new(SharedTrackerIndexAllocator::new()),
texture_views: Arc::new(SharedTrackerIndexAllocator::new()),
external_textures: Arc::new(SharedTrackerIndexAllocator::new()),
samplers: Arc::new(SharedTrackerIndexAllocator::new()),
bind_groups: Arc::new(SharedTrackerIndexAllocator::new()),