Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable bind groups in DX12 and Vulkan within wgpu-hal #6842

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]

- Replace `usage: Range<T>`, for `BufferUses`, `TextureUses`, and `AccelerationStructureBarrier` with a new `StateTransition<T>`. By @atlv24 in [#6703](https://github.com/gfx-rs/wgpu/pull/6703)
- Change the `DropCallback` API to use `FnOnce` instead of `FnMut`. By @jerzywilczek in [#6482](https://github.com/gfx-rs/wgpu/pull/6482)
- Mutable bind groups are now supported in DX12 and Vulkan on `wgpu-hal`. When creating a BindGroup using `create_bind_group` in `wgpu-hal`, set the `ALLOW_UPDATES` flag to allow updating the bind group after creation. Update the bind group using `update_bind_group`, similarly to how it's cr
- DX12 now supports partially bound bind groups, allowing you to skip entries. These will then not get written when calling `create_bind_group`.
- Added `array_element_offset` to `BindGroupLayoutEntry`, to allow for more free-form creating and updating of mutable bind groups for bindless resources.

### Bug Fixes

Expand Down
2 changes: 2 additions & 0 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,7 @@ impl Device {
hal_entries.push(hal::BindGroupEntry {
binding,
resource_index: res_index as u32,
array_element_offset: None,
count: count as u32,
});
}
Expand All @@ -2344,6 +2345,7 @@ impl Device {
}
let hal_desc = hal::BindGroupDescriptor {
label: desc.label.to_hal(self.instance_flags),
flags: hal::BindGroupFlags::empty(),
layout: layout.raw(),
entries: &hal_entries,
buffers: &hal_buffers,
Expand Down
4 changes: 4 additions & 0 deletions wgpu-core/src/indirect_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ impl IndirectValidation {

let dst_bind_group_desc = hal::BindGroupDescriptor {
label: None,
flags: hal::BindGroupFlags::empty(),
layout: dst_bind_group_layout.as_ref(),
entries: &[hal::BindGroupEntry {
binding: 0,
resource_index: 0,
array_element_offset: None,
count: 1,
}],
buffers: &[hal::BufferBinding {
Expand Down Expand Up @@ -280,10 +282,12 @@ impl IndirectValidation {
};
let hal_desc = hal::BindGroupDescriptor {
label: None,
flags: hal::BindGroupFlags::empty(),
layout: self.src_bind_group_layout.as_ref(),
entries: &[hal::BindGroupEntry {
binding: 0,
resource_index: 0,
array_element_offset: None,
count: 1,
}],
buffers: &[hal::BufferBinding {
Expand Down
Loading
Loading