Skip to content

Commit 4902e47

Browse files
Pipeline cache API and implementation for Vulkan (#5319)
Co-authored-by: Connor Fitzgerald <[email protected]>
1 parent eeb1a9d commit 4902e47

File tree

76 files changed

+1578
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1578
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410)
7272

7373
### New features
7474

75+
#### Vulkan
76+
77+
- Added a `PipelineCache` resource to allow using Vulkan pipeline caches. By @DJMcNab in [#5319](https://github.com/gfx-rs/wgpu/pull/5319)
78+
7579
#### General
7680

7781
#### Naga

benches/benches/renderpass.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl RenderpassState {
207207
compilation_options: wgpu::PipelineCompilationOptions::default(),
208208
}),
209209
multiview: None,
210+
cache: None,
210211
});
211212

212213
let render_target = device_state
@@ -304,6 +305,7 @@ impl RenderpassState {
304305
compilation_options: wgpu::PipelineCompilationOptions::default(),
305306
}),
306307
multiview: None,
308+
cache: None,
307309
},
308310
));
309311
}

deno_webgpu/pipeline.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub fn op_webgpu_create_compute_pipeline(
115115
constants: Cow::Owned(compute.constants.unwrap_or_default()),
116116
zero_initialize_workgroup_memory: true,
117117
},
118+
cache: None,
118119
};
119120
let implicit_pipelines = match layout {
120121
GPUPipelineLayoutOrGPUAutoLayoutMode::Layout(_) => None,
@@ -395,6 +396,7 @@ pub fn op_webgpu_create_render_pipeline(
395396
multisample: args.multisample,
396397
fragment,
397398
multiview: None,
399+
cache: None,
398400
};
399401

400402
let implicit_pipelines = match args.layout {

examples/src/boids/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ impl crate::framework::Example for Example {
156156
depth_stencil: None,
157157
multisample: wgpu::MultisampleState::default(),
158158
multiview: None,
159+
cache: None,
159160
});
160161

161162
// create compute pipeline
@@ -166,6 +167,7 @@ impl crate::framework::Example for Example {
166167
module: &compute_shader,
167168
entry_point: "main",
168169
compilation_options: Default::default(),
170+
cache: None,
169171
});
170172

171173
// buffer for the three 2d triangle vertices of each instance

examples/src/bunnymark/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ impl crate::framework::Example for Example {
224224
depth_stencil: None,
225225
multisample: wgpu::MultisampleState::default(),
226226
multiview: None,
227+
cache: None,
227228
});
228229

229230
let texture = {

examples/src/conservative_raster/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl crate::framework::Example for Example {
113113
depth_stencil: None,
114114
multisample: wgpu::MultisampleState::default(),
115115
multiview: None,
116+
cache: None,
116117
});
117118

118119
let pipeline_triangle_regular =
@@ -135,6 +136,7 @@ impl crate::framework::Example for Example {
135136
depth_stencil: None,
136137
multisample: wgpu::MultisampleState::default(),
137138
multiview: None,
139+
cache: None,
138140
});
139141

140142
let pipeline_lines = if device
@@ -165,6 +167,7 @@ impl crate::framework::Example for Example {
165167
depth_stencil: None,
166168
multisample: wgpu::MultisampleState::default(),
167169
multiview: None,
170+
cache: None,
168171
}),
169172
)
170173
} else {
@@ -224,6 +227,7 @@ impl crate::framework::Example for Example {
224227
depth_stencil: None,
225228
multisample: wgpu::MultisampleState::default(),
226229
multiview: None,
230+
cache: None,
227231
}),
228232
bind_group_layout,
229233
)

examples/src/cube/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ impl crate::framework::Example for Example {
260260
depth_stencil: None,
261261
multisample: wgpu::MultisampleState::default(),
262262
multiview: None,
263+
cache: None,
263264
});
264265

265266
let pipeline_wire = if device
@@ -301,6 +302,7 @@ impl crate::framework::Example for Example {
301302
depth_stencil: None,
302303
multisample: wgpu::MultisampleState::default(),
303304
multiview: None,
305+
cache: None,
304306
});
305307
Some(pipeline_wire)
306308
} else {

examples/src/hello_compute/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ async fn execute_gpu_inner(
110110
module: &cs_module,
111111
entry_point: "main",
112112
compilation_options: Default::default(),
113+
cache: None,
113114
});
114115

115116
// Instantiates the bind group, once again specifying the binding of buffers.

examples/src/hello_synchronization/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ async fn execute(
104104
module: &shaders_module,
105105
entry_point: "patient_main",
106106
compilation_options: Default::default(),
107+
cache: None,
107108
});
108109
let hasty_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
109110
label: None,
110111
layout: Some(&pipeline_layout),
111112
module: &shaders_module,
112113
entry_point: "hasty_main",
113114
compilation_options: Default::default(),
115+
cache: None,
114116
});
115117

116118
//----------------------------------------------------------

examples/src/hello_triangle/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
7272
depth_stencil: None,
7373
multisample: wgpu::MultisampleState::default(),
7474
multiview: None,
75+
cache: None,
7576
});
7677

7778
let mut config = surface

0 commit comments

Comments
 (0)