Add support for gaps in bind group layouts & update relevant validation (#9034)

* [wgpu-core] add support for optional BG & BGL entries

* [wgpu] allow gaps in bind group layouts

And allow unbinding in the web backend.

* adapt tests

* add changelog entry

* [wgpu] remove generic from `PipelineLayoutDescriptor`
This commit is contained in:
Teodor Tanasoaia authored and GitHub committed 2026-02-25 19:47:36 +01:00
1 parent aad2a00f4d
commit e114d2f0a7
90 files changed
+567 -397

No files matched your search

+5 -1
View File
@@ -379,7 +379,11 @@ impl GPUDevice {
let bind_group_layouts = descriptor
.bind_group_layouts
.into_iter()
.map(|bind_group_layout| bind_group_layout.id)
.map(|bind_group_layout| {
bind_group_layout
.into_option()
.map(|bind_group_layout| bind_group_layout.id)
})
.collect();
let wgpu_descriptor = wgpu_core::binding_model::PipelineLayoutDescriptor {
+2 -1
View File
@@ -2,6 +2,7 @@
use deno_core::cppgc::Ptr;
use deno_core::op2;
use deno_core::webidl::Nullable;
use deno_core::webidl::WebIdlInterfaceConverter;
use deno_core::GarbageCollected;
use deno_core::WebIDL;
@@ -58,5 +59,5 @@ pub(crate) struct GPUPipelineLayoutDescriptor {
pub label: String,
pub bind_group_layouts:
Vec<Ptr<super::bind_group_layout::GPUBindGroupLayout>>,
Vec<Nullable<Ptr<super::bind_group_layout::GPUBindGroupLayout>>>,
}