mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +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
@@ -126,7 +126,7 @@ fn setup_pipeline(
|
||||
) -> wgpu::ComputePipeline {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("Compute Pipeline Layout"),
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ impl crate::framework::Example for Example {
|
||||
let compute_pipeline_layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("compute"),
|
||||
bind_group_layouts: &[&compute_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&compute_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -200,7 +200,10 @@ impl crate::framework::Example for Example {
|
||||
});
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&global_bind_group_layout, &local_bind_group_layout],
|
||||
bind_group_layouts: &[
|
||||
Some(&global_bind_group_layout),
|
||||
Some(&local_bind_group_layout),
|
||||
],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ impl crate::framework::Example for Example {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let shader = device.create_shader_module(wgpu::include_wgsl!("upscale.wgsl"));
|
||||
|
||||
@@ -364,7 +364,7 @@ async fn execute(
|
||||
// Create compute pipeline
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("Cooperative Matrix Pipeline Layout"),
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ impl crate::framework::Example for Example {
|
||||
});
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ async fn execute(
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let patient_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
|
||||
@@ -99,7 +99,7 @@ async fn run() {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
|
||||
@@ -111,7 +111,7 @@ impl MultiTargetRenderer {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&texture_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&texture_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
@@ -231,7 +231,7 @@ impl TargetRenderer {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&texture_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&texture_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ impl crate::framework::Example for Example {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 16,
|
||||
});
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ impl crate::framework::Example for Example {
|
||||
let compute_pipeline_layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("pipeline layout for shader.wgsl"),
|
||||
bind_group_layouts: &[&bgl],
|
||||
bind_group_layouts: &[Some(&bgl)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
@@ -283,7 +283,7 @@ impl crate::framework::Example for Example {
|
||||
|
||||
let blit_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("pipeline layout for blit.wgsl"),
|
||||
bind_group_layouts: &[&blit_bgl],
|
||||
bind_group_layouts: &[Some(&blit_bgl)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ impl WgpuContext {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
|
||||
@@ -465,7 +465,7 @@ impl crate::framework::Example for Example {
|
||||
});
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("shadow"),
|
||||
bind_group_layouts: &[&bind_group_layout, &local_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout), Some(&local_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
@@ -581,7 +581,7 @@ impl crate::framework::Example for Example {
|
||||
});
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("main"),
|
||||
bind_group_layouts: &[&bind_group_layout, &local_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout), Some(&local_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ impl crate::framework::Example for Example {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ impl<const SRGB: bool> crate::framework::Example for Example<SRGB> {
|
||||
});
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ async fn run(_path: Option<String>) {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
|
||||
@@ -327,7 +327,7 @@ impl crate::framework::Example for Example {
|
||||
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("main"),
|
||||
bind_group_layouts: &[&bind_group_layout, &uniform_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout), Some(&uniform_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ impl WgpuContext {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
// (4)
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -427,14 +427,14 @@ impl crate::framework::Example for Example {
|
||||
let water_pipeline_layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("water"),
|
||||
bind_group_layouts: &[&water_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&water_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let terrain_pipeline_layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("terrain"),
|
||||
bind_group_layouts: &[&terrain_bind_group_layout],
|
||||
bind_group_layouts: &[Some(&terrain_bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ fn main() {
|
||||
// The pipeline layout describes the bind groups that a pipeline expects
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
bind_group_layouts: &[Some(&bind_group_layout)],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user