mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 09:34:09 +01:00
feat(core): add Global::create_bind_group_layout_error (#8650)
This commit is contained in:
1 parent
a15ffbd551
commit
a35e5a28c1
2 files changed
+18
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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:?}");
|
||||
|
||||
Reference in new issue
Block a user