Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
- Added support for binding arrays of storage textures on Metal. By @msvbg in [#8464](https://github.com/gfx-rs/wgpu/pull/8464)
- Added support for multisampled texture arrays on Vulkan through adapter feature `MULTISAMPLE_ARRAY`. By @LaylBongers in [#8571](https://github.com/gfx-rs/wgpu/pull/8571).
- Added `get_configuration` to `wgpu::Surface`, that returns the current configuration of `wgpu::Surface`. By @sagudev in [#8664](https://github.com/gfx-rs/wgpu/pull/8664).
- Add `wgpu_core::Global::create_bind_group_layout_error`. By @ErichDonGubler in [#8650](https://github.com/gfx-rs/wgpu/pull/8650).

### Changes

Expand Down
17 changes: 17 additions & 0 deletions wgpu-core/src/device/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@ impl Global {
fid.assign(Fallible::Invalid(Arc::new(desc.label.to_string())));
}

/// Assign `id_in` an error with the given `label`.
///
/// In JavaScript environments, it is possible to call `GPUDevice.createBindGroupLayout` with
/// entries that are invalid. Because our Rust's types for bind group layouts prevent even
/// calling [`Self::device_create_bind_group`], we let standards-compliant environments
/// register an invalid bind group layout so this crate's API can still be consistently used.
///
/// See [`Self::create_buffer_error`] for additional context and explanation.
pub fn create_bind_group_layout_error(
&self,
id_in: Option<id::BindGroupLayoutId>,
label: Option<Cow<'_, str>>,
) {
let fid = self.hub.bind_group_layouts.prepare(id_in);
fid.assign(Fallible::Invalid(Arc::new(label.to_string())));
}

pub fn buffer_destroy(&self, buffer_id: id::BufferId) {
profiling::scope!("Buffer::destroy");
api_log!("Buffer::destroy {buffer_id:?}");
Expand Down