Skip to content

Commit 97ee533

Browse files
committed
Always build with vulkan 1.1
1 parent 4147973 commit 97ee533

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

examples/runners/wgpu/builder/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use spirv_builder::SpirvBuilder;
22
use std::error::Error;
33

44
fn build_shader(path_to_create: &str) -> Result<(), Box<dyn Error>> {
5-
SpirvBuilder::new(path_to_create, "spirv-unknown-vulkan1.0").build()?;
5+
SpirvBuilder::new(path_to_create, "spirv-unknown-vulkan1.1").build()?;
66
Ok(())
77
}
88

examples/runners/wgpu/src/lib.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn shader_module(shader: RustGPUShader) -> wgpu::ShaderModuleDescriptor<'static>
6161
{
6262
use spirv_builder::SpirvBuilder;
6363
use std::borrow::Cow;
64-
use std::path::{Path, PathBuf};
64+
use std::path::PathBuf;
6565
// Hack: spirv_builder builds into a custom directory if running under cargo, to not
6666
// deadlock, and the default target directory if not. However, packages like `proc-macro2`
6767
// have different configurations when being built here vs. when building
@@ -76,26 +76,12 @@ fn shader_module(shader: RustGPUShader) -> wgpu::ShaderModuleDescriptor<'static>
7676
RustGPUShader::Compute => "compute-shader",
7777
RustGPUShader::Mouse => "mouse-shader",
7878
};
79-
let target = match shader {
80-
RustGPUShader::Simplest | RustGPUShader::Mouse | RustGPUShader::Sky => {
81-
"spirv-unknown-vulkan1.0"
82-
}
83-
// The compute example uses a StorageBuffer, so needs Vulkan 1.1 which supports
84-
// that natively
85-
RustGPUShader::Compute => "spirv-unknown-vulkan1.1",
86-
};
8779
let manifest_dir = env!("CARGO_MANIFEST_DIR");
88-
let crate_path = [
89-
Path::new(manifest_dir),
90-
Path::new(".."),
91-
Path::new(".."),
92-
Path::new("shaders"),
93-
Path::new(crate_name),
94-
]
95-
.iter()
96-
.copied()
97-
.collect::<PathBuf>();
98-
let result = SpirvBuilder::new(crate_path, target)
80+
let crate_path = [manifest_dir, "..", "..", "shaders", crate_name]
81+
.iter()
82+
.copied()
83+
.collect::<PathBuf>();
84+
let result = SpirvBuilder::new(crate_path, "spirv-unknown-vulkan1.1")
9985
.print_metadata(false)
10086
.build()
10187
.unwrap();

0 commit comments

Comments
 (0)