First attempt at a GPU runner
Currently failing with an error I don't understand: ``` wgpu error: Validation Error Caused by: In Device::create_shader_module, label = '...\image_binary.spv' Shader '...\image_binary.spv' parsing error: InvalidTypeWidth(1) ```
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
use cargo_gpu_install::install::Install;
|
||||
use cargo_gpu_install::spirv_builder::{Capability, ShaderPanicStrategy, SpirvMetadata};
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn main() -> anyhow::Result<()> {
|
||||
let manifest_dir = env!("CARGO_MANIFEST_DIR");
|
||||
let crate_path = [manifest_dir, "..", "image-binary"]
|
||||
.iter()
|
||||
.copied()
|
||||
.collect::<PathBuf>();
|
||||
|
||||
let install = Install::from_shader_crate(crate_path.clone())
|
||||
.within_build_script()
|
||||
.run()?;
|
||||
let mut builder = install.to_spirv_builder(crate_path, "spirv-unknown-vulkan1.3");
|
||||
builder.build_script.defaults = true;
|
||||
builder.shader_panic_strategy = ShaderPanicStrategy::SilentExit;
|
||||
builder.spirv_metadata = SpirvMetadata::Full;
|
||||
builder.capabilities = vec![Capability::Int8, Capability::Int16, Capability::Int64];
|
||||
|
||||
let compile_result = builder.build()?;
|
||||
let spv_path = compile_result.module.unwrap_single();
|
||||
println!(
|
||||
"cargo::rustc-env=SHADER_SPV_PATH_IMAGE_BINARY={}",
|
||||
spv_path.display()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user