From ed8af50c8b8bbd01a73be576c9081520afaee3f9 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 3 May 2024 22:37:48 +0700 Subject: [PATCH 1/2] Disable zeroing workgroup memory for compute shaders. This is a performance improvement for shader compilation. See https://github.com/gfx-rs/wgpu/pull/5508 --- src/wgpu_engine.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wgpu_engine.rs b/src/wgpu_engine.rs index e102e9a55..2be72d376 100644 --- a/src/wgpu_engine.rs +++ b/src/wgpu_engine.rs @@ -644,7 +644,10 @@ impl WgpuEngine { layout: Some(&compute_pipeline_layout), module: &shader_module, entry_point: "main", - compilation_options: PipelineCompilationOptions::default(), + compilation_options: PipelineCompilationOptions { + zero_initialize_workgroup_memory: false, + ..PipelineCompilationOptions::default() + }, }); WgpuShader { pipeline, From 96c1f591c0c56f39c14a891b69bd3bd8f8a28428 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 13 May 2024 21:56:23 +0700 Subject: [PATCH 2/2] Update src/wgpu_engine.rs Co-authored-by: Lixou <82600264+DasLixou@users.noreply.github.com> --- src/wgpu_engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wgpu_engine.rs b/src/wgpu_engine.rs index 2be72d376..f743d12c3 100644 --- a/src/wgpu_engine.rs +++ b/src/wgpu_engine.rs @@ -646,7 +646,7 @@ impl WgpuEngine { entry_point: "main", compilation_options: PipelineCompilationOptions { zero_initialize_workgroup_memory: false, - ..PipelineCompilationOptions::default() + ..Default::default() }, }); WgpuShader {