dxil on windows only

This commit is contained in:
Alex Janka 2023-04-26 17:41:09 +10:00
parent ab8072c4f7
commit dcc8a3b758
2 changed files with 6 additions and 3 deletions

View file

@ -12,7 +12,7 @@ description = "RetroArch shaders for all."
[dependencies]
serde = { version = "1.0" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["serialize", "dxil"] }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["serialize"] }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" }
platform-dirs = "0.3.0"
blake3 = { version = "1.3.3" }
@ -32,7 +32,7 @@ features = [
optional = true
[features]
d3d = ["windows"]
d3d = ["windows", "librashader-reflect/dxil"]
# hack to get building on docsrs
docsrs = ["blake3/pure", "rusqlite/in_gecko"]

View file

@ -1,6 +1,8 @@
//! Cache helpers for `ShaderCompilation` objects to cache compiled SPIRV.
use librashader_preprocess::ShaderSource;
use librashader_reflect::back::targets::{DXIL, GLSL, HLSL, SPIRV};
#[cfg(feature = "windows")]
use librashader_reflect::back::targets::DXIL;
use librashader_reflect::back::targets::{GLSL, HLSL, SPIRV};
use librashader_reflect::back::{CompilerBackend, FromCompilation};
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
use librashader_reflect::front::{GlslangCompilation, ShaderCompilation};
@ -56,6 +58,7 @@ impl<T: ShaderCompilation + for<'de> serde::Deserialize<'de> + serde::Serialize
}
}
#[cfg(feature = "windows")]
impl FromCompilation<CachedCompilation<GlslangCompilation>> for DXIL {
type Target = <DXIL as FromCompilation<GlslangCompilation>>::Target;
type Options = <DXIL as FromCompilation<GlslangCompilation>>::Options;