Skip to content

Commit c70f54c

Browse files
fix(core): validate dst_buffer isn't destroyed when resolving query sets
1 parent 5ca92bf commit c70f54c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
131131
- Lower `QUERY_SET_MAX_QUERIES` (and enforced limits) from 8192 to 4096 to match WebGPU spec. By @ErichDonGubler in [#6525](https://github.com/gfx-rs/wgpu/pull/6525).
132132
- Allow non-filterable float on texture bindings never used with samplers when using a derived bind group layout. By @ErichDonGubler in [#6531](https://github.com/gfx-rs/wgpu/pull/6531/).
133133
- Replace potentially unsound usage of `PreHashedMap` with `FastHashMap`. By @jamienicol in [#6541](https://github.com/gfx-rs/wgpu/pull/6541).
134+
- Reject destroyed buffers in query set resolution. By @ErichDonGubler in #????.
134135

135136
#### Naga
136137

wgpu-core/src/command/query.rs

+3-2
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)