mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 09:34:09 +01:00
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:
1 parent
aad2a00f4d
commit
e114d2f0a7
90 files changed
+567
-397
No files matched your search
@@ -933,7 +933,7 @@ fn dispatch_indirect(
|
||||
state.pass.base.raw_encoder.set_bind_group(
|
||||
params.pipeline_layout,
|
||||
0,
|
||||
Some(params.dst_bind_group),
|
||||
params.dst_bind_group,
|
||||
&[],
|
||||
);
|
||||
}
|
||||
@@ -941,14 +941,12 @@ fn dispatch_indirect(
|
||||
state.pass.base.raw_encoder.set_bind_group(
|
||||
params.pipeline_layout,
|
||||
1,
|
||||
Some(
|
||||
buffer
|
||||
.indirect_validation_bind_groups
|
||||
.get(state.pass.base.snatch_guard)
|
||||
.unwrap()
|
||||
.dispatch
|
||||
.as_ref(),
|
||||
),
|
||||
buffer
|
||||
.indirect_validation_bind_groups
|
||||
.get(state.pass.base.snatch_guard)
|
||||
.unwrap()
|
||||
.dispatch
|
||||
.as_ref(),
|
||||
&[params.aligned_offset as u32],
|
||||
);
|
||||
}
|
||||
@@ -1007,15 +1005,14 @@ fn dispatch_indirect(
|
||||
}
|
||||
}
|
||||
|
||||
for (i, e) in state.pass.binder.list_valid() {
|
||||
let group = e.group.as_ref().unwrap();
|
||||
for (i, group, dynamic_offsets) in state.pass.binder.list_valid() {
|
||||
let raw_bg = group.try_raw(state.pass.base.snatch_guard)?;
|
||||
unsafe {
|
||||
state.pass.base.raw_encoder.set_bind_group(
|
||||
pipeline.layout.raw(),
|
||||
i as u32,
|
||||
Some(raw_bg),
|
||||
&e.dynamic_offsets,
|
||||
raw_bg,
|
||||
dynamic_offsets,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user