Skip to content

Commit 55edc4e

Browse files
committed
example-runner-wgpu: fix "offline" (wasm/Android) compilation.
1 parent 34e1c90 commit 55edc4e

File tree

1 file changed

+7
-2
lines changed
  • examples/runners/wgpu/src

1 file changed

+7
-2
lines changed

examples/runners/wgpu/src/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,16 @@ fn maybe_watch(
197197
}
198198
#[cfg(any(target_os = "android", target_arch = "wasm32"))]
199199
{
200-
match shader {
201-
RustGPUShader::Simplest => wgpu::include_spirv_raw!(env!("simplest_shader.spv")),
200+
let module = match options.shader {
201+
RustGPUShader::Simplest => {
202+
wgpu::include_spirv_raw!(env!("simplest_shader.spv"))
203+
}
202204
RustGPUShader::Sky => wgpu::include_spirv_raw!(env!("sky_shader.spv")),
203205
RustGPUShader::Compute => wgpu::include_spirv_raw!(env!("compute_shader.spv")),
204206
RustGPUShader::Mouse => wgpu::include_spirv_raw!(env!("mouse_shader.spv")),
207+
};
208+
CompiledShaderModules {
209+
named_spv_modules: vec![(None, module)],
205210
}
206211
}
207212
}

0 commit comments

Comments
 (0)