Skip to content

Commit

Permalink
fix(core): validate dst_buffer isn't destroyed when resolving query…
Browse files Browse the repository at this point in the history
… sets
  • Loading branch information
ErichDonGubler committed Nov 22, 2024
1 parent f1ec934 commit 6365e2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
- Check the status of the `TIMESTAMP_QUERY` feature before other validation.
- Check that indices are in-bounds for the query set.
- Check that begin and end indices are not equal.
- Reject destroyed buffers in query set resolution. By @ErichDonGubler in [#6579](https://github.com/gfx-rs/wgpu/pull/6579).

#### Naga

Expand Down
5 changes: 3 additions & 2 deletions wgpu-core/src/command/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,14 @@ impl Global {

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

let snatch_guard = dst_buffer.device.snatchable_lock.read();
dst_buffer.check_destroyed(&snatch_guard)?;

let dst_pending = cmd_buf_data
.trackers
.buffers
.set_single(&dst_buffer, hal::BufferUses::COPY_DST);

let snatch_guard = dst_buffer.device.snatchable_lock.read();

let dst_barrier = dst_pending.map(|pending| pending.into_hal(&dst_buffer, &snatch_guard));

dst_buffer
Expand Down

0 comments on commit 6365e2d

Please sign in to comment.