Skip to content

Commit 7f64445

Browse files
Check for attachment overlap using textures, not views (#8402)
1 parent d575c02 commit 7f64445

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ SamplerDescriptor {
9494
- 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).
9595
- 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).
9696
- `wgpu_types::PollError` now always implements the `Error` trait. By @kpreid in [#8384](https://github.com/gfx-rs/wgpu/pull/8384).
97+
- 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).
9798

9899
#### DX12
99100

cts_runner/test.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,depth
125125
// FAIL: webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,depthSlice,overlaps,diff_miplevel:*
126126
webgpu:api,validation,render_pass,render_pass_descriptor:resolveTarget,*
127127
webgpu:api,validation,render_pass,resolve:resolve_attachment:*
128+
webgpu:api,validation,resource_usages,texture,in_pass_encoder:subresources_and_binding_types_combination_for_color:compute=false;type0="render-target";type1="render-target"
128129
webgpu:api,validation,texture,rg11b10ufloat_renderable:*
129130
webgpu:api,operation,render_pipeline,overrides:*
130131
webgpu:api,operation,rendering,basic:clear:*

wgpu-core/src/command/render.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,11 @@ impl RenderPassInfo {
12411241
) -> Result<(), ColorAttachmentError> {
12421242
let mut insert = |slice| {
12431243
let mip_level = view.desc.range.base_mip_level;
1244-
if attachment_set.insert((view.tracking_data.tracker_index(), mip_level, slice))
1245-
{
1244+
if attachment_set.insert((
1245+
view.parent.tracking_data.tracker_index(),
1246+
mip_level,
1247+
slice,
1248+
)) {
12461249
Ok(())
12471250
} else {
12481251
Err(ColorAttachmentError::SubresourceOverlap {

wgpu-core/src/device/resource.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,6 @@ impl Device {
18061806
samples: texture.desc.sample_count,
18071807
selector,
18081808
label: desc.label.to_string(),
1809-
tracking_data: TrackingData::new(self.tracker_indices.texture_views.clone()),
18101809
};
18111810

18121811
let view = Arc::new(view);

wgpu-core/src/resource.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,6 @@ pub struct TextureView {
16541654
pub(crate) selector: TextureSelector,
16551655
/// The `label` from the descriptor used to create the resource.
16561656
pub(crate) label: String,
1657-
pub(crate) tracking_data: TrackingData,
16581657
}
16591658

16601659
impl Drop for TextureView {
@@ -1821,7 +1820,6 @@ crate::impl_resource_type!(TextureView);
18211820
crate::impl_labeled!(TextureView);
18221821
crate::impl_parent_device!(TextureView);
18231822
crate::impl_storage_item!(TextureView);
1824-
crate::impl_trackable!(TextureView);
18251823

18261824
pub type ExternalTextureDescriptor<'a> = wgt::ExternalTextureDescriptor<Label<'a>>;
18271825

wgpu-core/src/track/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ impl SharedTrackerIndexAllocator {
224224
pub(crate) struct TrackerIndexAllocators {
225225
pub buffers: Arc<SharedTrackerIndexAllocator>,
226226
pub textures: Arc<SharedTrackerIndexAllocator>,
227-
pub texture_views: Arc<SharedTrackerIndexAllocator>,
228227
pub external_textures: Arc<SharedTrackerIndexAllocator>,
229228
pub samplers: Arc<SharedTrackerIndexAllocator>,
230229
pub bind_groups: Arc<SharedTrackerIndexAllocator>,
@@ -241,7 +240,6 @@ impl TrackerIndexAllocators {
241240
TrackerIndexAllocators {
242241
buffers: Arc::new(SharedTrackerIndexAllocator::new()),
243242
textures: Arc::new(SharedTrackerIndexAllocator::new()),
244-
texture_views: Arc::new(SharedTrackerIndexAllocator::new()),
245243
external_textures: Arc::new(SharedTrackerIndexAllocator::new()),
246244
samplers: Arc::new(SharedTrackerIndexAllocator::new()),
247245
bind_groups: Arc::new(SharedTrackerIndexAllocator::new()),

0 commit comments

Comments
 (0)