Fix shaderc changes

This commit is contained in:
hodasemi 2025-03-10 19:27:09 +01:00
parent 28c8422b7b
commit 3835354503
3 changed files with 6 additions and 11 deletions

View file

@ -27,12 +27,10 @@ itertools = "0.14.0"
serde = { version = "1.0.203", features = ["derive"] }
ron = "0.8.1"
paste = "1.0.15"
rayon = "1.10.0"
chrono = { version = "0.4.35", features = ["serde"] }
anyhow = { version = "1.0.86", features = ["backtrace"] }
indexmap = { version = "2.2.6", features = ["rayon"] }
shaderc = { version = "0.9.0", features = ["build-from-source"] }
rusqlite = { version = "0.33.0", features = ["bundled"] }
cgmath = "0.18.0"
http = "1.1.0"
iterchunks = "0.5.0"

View file

@ -9,7 +9,6 @@ edition = "2024"
serde = { workspace = true }
ron = { workspace = true }
paste = { workspace = true }
rayon = { workspace = true }
# chrono = { workspace = true }
anyhow = { workspace = true }
indexmap = { workspace = true }

View file

@ -4,7 +4,7 @@ pub(crate) use shaderc::{
CompileOptions, Compiler, IncludeType, ResolvedInclude, ShaderKind, SpirvVersion,
};
use anyhow::Result;
use anyhow::{Result, anyhow};
use std::sync::Arc;
pub const SHADER_OPTION_COUNT: usize = 9;
@ -134,10 +134,8 @@ impl<'a> ShaderCompiler<'a> {
fn create_compiler() -> Result<Compiler> {
match Compiler::new() {
Some(compiler) => Ok(compiler),
None => Err(anyhow::Error::msg(
"Shaderc Error: failed creating compiler",
)),
Ok(compiler) => Ok(compiler),
Err(err) => Err(anyhow!("Shaderc Error: failed creating compiler: {err:?}",)),
}
}
}
@ -149,9 +147,9 @@ pub trait ShaderTypeConverter<T: ShaderType> {
fn create_compile_options<'b>() -> Result<CompileOptions<'b>> {
match CompileOptions::new() {
Some(compile_options) => Ok(compile_options),
None => Err(anyhow::Error::msg(
"Shaderc Error: failed creating compile-options",
Ok(compile_options) => Ok(compile_options),
Err(err) => Err(anyhow!(
"Shaderc Error: failed creating compile-options {err:?}",
)),
}
}