Skip to content

Commit

Permalink
example-runner-wgpu: fix "offline" (wasm/Android) compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jul 20, 2023
1 parent 34e1c90 commit 55edc4e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/runners/wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
}
}
}
Expand Down

0 comments on commit 55edc4e

Please sign in to comment.