Skip to content

Commit 3b85cea

Browse files
committed
merge
2 parents 21e2ead + 1791064 commit 3b85cea

File tree

27 files changed

+1322
-366
lines changed

27 files changed

+1322
-366
lines changed

.deny.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ wildcards = "deny"
4949
allow-wildcard-paths = true
5050

5151
[advisories]
52-
# `paste` crate is no longer maintained https://rustsec.org/advisories/RUSTSEC-2024-0436
53-
# It's a dependency of `metal` (which is to be replaced with `objc2`) and a transitive dependency of `deno`.
54-
ignore = ["RUSTSEC-2024-0436"]
52+
ignore = [
53+
# `paste` crate is no longer maintained https://rustsec.org/advisories/RUSTSEC-2024-0436
54+
# It's a dependency of `metal` (which is to be replaced with `objc2-metal`), and a
55+
# transitive dependency of `deno`. https://github.com/gfx-rs/wgpu/issues/7873
56+
"RUSTSEC-2024-0436",
57+
# `adler` crate is no longer maintained https://rustsec.org/advisories/RUSTSEC-2025-0056
58+
# It's a dependency of `miniz_oxide` 0.7.4, and a transitive dependency of `deno`.
59+
# https://github.com/gfx-rs/wgpu/issues/7961
60+
"RUSTSEC-2025-0056",
61+
]
5562

5663
[licenses]
5764
allow = [

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ jobs:
684684
run: taplo format --check --diff
685685

686686
- name: Check for typos
687-
uses: crate-ci/typos@v1.35.5
687+
uses: crate-ci/typos@v1.36.2
688688

689689
check-cts-runner:
690690
# runtime is normally 2 minutes

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,28 @@ Bottom level categories:
4242

4343
### Major Changes
4444

45+
#### Deferred command buffer actions: `map_buffer_on_submit` and `on_submitted_work_done`
46+
47+
You may schedule buffer mapping and a submission-complete callback to run automatically after you submit, directly from encoders, command buffers, and passes.
48+
49+
```rust
50+
// Record some GPU work so the submission isn't empty and touches `buffer`.
51+
encoder.clear_buffer(&buffer, 0, None);
52+
53+
// Defer mapping until this encoder is submitted.
54+
encoder.map_buffer_on_submit(&buffer, wgpu::MapMode::Read, 0..size, |result| { .. });
55+
56+
// Fires after the command buffer's work is finished.
57+
encoder.on_submitted_work_done(|| { .. });
58+
59+
// Automatically calls `map_async` and `on_submitted_work_done` after this submission finishes.
60+
queue.submit([encoder.finish()]);
61+
```
62+
63+
Available on `CommandEncoder`, `CommandBuffer`, `RenderPass`, and `ComputePass`.
64+
65+
By @cwfitzgerald in [#8125](https://github.com/gfx-rs/wgpu/pull/8125).
66+
4567
#### Builtin Support for DXGI swapchains on top of of DirectComposition Visuals in DX12
4668

4769
By enabling DirectComposition support, the dx12 backend can now support transparent windows.
@@ -75,6 +97,7 @@ We have merged the acceleration structure feature into the `RayQuery` feature. T
7597
By @Vecvec in [#7913](https://github.com/gfx-rs/wgpu/pull/7913).
7698

7799
#### New `EXPERIMENTAL_PRECOMPILED_SHADERS` API
100+
78101
We have added `Features::EXPERIMENTAL_PRECOMPILED_SHADERS`, replacing existing passthrough types with a unified `CreateShaderModuleDescriptorPassthrough` which allows passing multiple shader codes for different backends. By @SupaMaggie70Incorporated in [#7834](https://github.com/gfx-rs/wgpu/pull/7834)
79102

80103
Difference for SPIR-V passthrough:
@@ -94,6 +117,21 @@ Difference for SPIR-V passthrough:
94117
```
95118
This allows using precompiled shaders without manually checking which backend's code to pass, for example if you have shaders precompiled for both DXIL and SPIR-V.
96119

120+
#### Buffer mapping apis no longer have lifetimes
121+
122+
`Buffer::get_mapped_range()`, `Buffer::get_mapped_range_mut()`, and `Queue::write_buffer_with()` now return guard objects without any lifetimes. This
123+
makes it significantly easier to store these types in structs, which is useful for building utilities that build the contents of a buffer over time.
124+
125+
```diff
126+
- let buffer_mapping_ref: wgpu::BufferView<'_> = buffer.get_mapped_range(..);
127+
- let buffer_mapping_mut: wgpu::BufferViewMut<'_> = buffer.get_mapped_range_mut(..);
128+
- let queue_write_with: wgpu::QueueWriteBufferView<'_> = queue.write_buffer_with(..);
129+
+ let buffer_mapping_ref: wgpu::BufferView = buffer.get_mapped_range(..);
130+
+ let buffer_mapping_mut: wgpu::BufferViewMut = buffer.get_mapped_range_mut(..);
131+
+ let queue_write_with: wgpu::QueueWriteBufferView = queue.write_buffer_with(..);
132+
```
133+
134+
By @sagudev in [#8046](https://github.com/gfx-rs/wgpu/pull/8046) and @cwfitzgerald in [#8070](https://github.com/gfx-rs/wgpu/pull/8161).
97135
#### `EXPERIMENTAL_*` features now require unsafe code to enable
98136

99137
We want to be able to expose potentially experimental features to our users before we have ensured that they are fully sound to use.
@@ -139,15 +177,18 @@ By @cwfitzgerald in [#8162](https://github.com/gfx-rs/wgpu/pull/8162).
139177
- Copies within the same texture must not overlap.
140178
- Copies of multisampled or depth/stencil formats must span an entire subresource (layer).
141179
- Copies of depth/stencil formats must be 4B aligned.
180+
- For texture-buffer copies, `bytes_per_row` on the buffer side must be 256B-aligned, even if the transfer is a single row.
142181
- The offset for `set_vertex_buffer` and `set_index_buffer` must be 4B aligned. By @andyleiserson in [#7929](https://github.com/gfx-rs/wgpu/pull/7929).
143182
- The offset and size of bindings are validated as fitting within the underlying buffer in more cases. By @andyleiserson in [#7911](https://github.com/gfx-rs/wgpu/pull/7911).
144183
- The function you pass to `Device::on_uncaptured_error()` must now implement `Sync` in addition to `Send`, and be wrapped in `Arc` instead of `Box`.
145184
In exchange for this, it is no longer possible for calling `wgpu` functions while in that callback to cause a deadlock (not that we encourage you to actually do that).
146185
By @kpreid in [#8011](https://github.com/gfx-rs/wgpu/pull/8011).
147186
- Make a compacted hal acceleration structure inherit a label from the base BLAS. By @Vecvec in [#8103](https://github.com/gfx-rs/wgpu/pull/8103).
148187
- The limits requested for a device must now satisfy `min_subgroup_size <= max_subgroup_size`. By @andyleiserson in [#8085](https://github.com/gfx-rs/wgpu/pull/8085).
188+
- Improve errors when buffer mapping is done incorrectly. Allow aliasing immutable [`BufferViews`]. By @cwfitzgerald in [#8150](https://github.com/gfx-rs/wgpu/pull/8150).
149189
- Require new `F16_IN_F32` downlevel flag for `quantizeToF16`, `pack2x16float`, and `unpack2x16float` in WGSL input. By @aleiserson in [#8130](https://github.com/gfx-rs/wgpu/pull/8130).
150190
- The error message for non-copyable depth/stencil formats no longer mentions the aspect when it is not relevant. By @reima in [#8156](https://github.com/gfx-rs/wgpu/pull/8156).
191+
- Track the initialization status of buffer memory correctly when `copy_texture_to_buffer` skips over padding space between rows or layers, or when the start/end of a texture-buffer transfer is not 4B aligned. By @andyleiserson in [#8099](https://github.com/gfx-rs/wgpu/pull/8099).
151192

152193
#### naga
153194

0 commit comments

Comments
 (0)