example-runner-wgpu: fix "offline" (wasm/Android) compilation.

This commit is contained in:
Eduard-Mihai Burtescu 2023-07-20 10:17:07 +03:00 committed by Eduard-Mihai Burtescu
parent 34e1c90c32
commit 55edc4e6b4

View File

@ -197,11 +197,16 @@ fn maybe_watch(
}
#[cfg(any(target_os = "android", target_arch = "wasm32"))]
{
match shader {
RustGPUShader::Simplest => wgpu::include_spirv_raw!(env!("simplest_shader.spv")),
let module = match options.shader {
RustGPUShader::Simplest => {
wgpu::include_spirv_raw!(env!("simplest_shader.spv"))
}
RustGPUShader::Sky => wgpu::include_spirv_raw!(env!("sky_shader.spv")),
RustGPUShader::Compute => wgpu::include_spirv_raw!(env!("compute_shader.spv")),
RustGPUShader::Mouse => wgpu::include_spirv_raw!(env!("mouse_shader.spv")),
};
CompiledShaderModules {
named_spv_modules: vec![(None, module)],
}
}
}