Skip to content

Commit 6365e2d

Browse files
fix(core): validate dst_buffer isn't destroyed when resolving query sets
1 parent f1ec934 commit 6365e2d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
135135
- Check the status of the `TIMESTAMP_QUERY` feature before other validation.
136136
- Check that indices are in-bounds for the query set.
137137
- Check that begin and end indices are not equal.
138+
- Reject destroyed buffers in query set resolution. By @ErichDonGubler in [#6579](https://github.com/gfx-rs/wgpu/pull/6579).
138139

139140
#### Naga
140141

wgpu-core/src/command/query.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,14 @@ impl Global {
387387

388388
dst_buffer.same_device_as(cmd_buf.as_ref())?;
389389

390+
let snatch_guard = dst_buffer.device.snatchable_lock.read();
391+
dst_buffer.check_destroyed(&snatch_guard)?;
392+
390393
let dst_pending = cmd_buf_data
391394
.trackers
392395
.buffers
393396
.set_single(&dst_buffer, hal::BufferUses::COPY_DST);
394397

395-
let snatch_guard = dst_buffer.device.snatchable_lock.read();
396-
397398
let dst_barrier = dst_pending.map(|pending| pending.into_hal(&dst_buffer, &snatch_guard));
398399

399400
dst_buffer

0 commit comments

Comments
 (0)