From dcc8a3b7584fb2376ea8a6536bee66c1d18d77a0 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Wed, 26 Apr 2023 17:41:09 +1000 Subject: [PATCH] dxil on windows only --- librashader-cache/Cargo.toml | 4 ++-- librashader-cache/src/compilation.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/librashader-cache/Cargo.toml b/librashader-cache/Cargo.toml index 1266a72..7f150c7 100644 --- a/librashader-cache/Cargo.toml +++ b/librashader-cache/Cargo.toml @@ -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"] diff --git a/librashader-cache/src/compilation.rs b/librashader-cache/src/compilation.rs index ef1ad16..8c7dc0f 100644 --- a/librashader-cache/src/compilation.rs +++ b/librashader-cache/src/compilation.rs @@ -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 serde::Deserialize<'de> + serde::Serialize } } +#[cfg(feature = "windows")] impl FromCompilation> for DXIL { type Target = >::Target; type Options = >::Options;