From d6bbdb43fd292de27e9dffe076c6e616b02408d8 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sun, 12 Feb 2023 22:49:23 -0500 Subject: [PATCH] d3d12: no need to build hlsl if not needed --- Cargo.lock | 32 +++++++++---------- librashader-runtime-d3d12/src/filter_chain.rs | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c40494..a86e621 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -993,15 +993,6 @@ dependencies = [ "windows", ] -[[package]] -name = "librashader-common" -version = "0.1.0-beta.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732fd45c30ab527ebe72123dc3c9fd207fa78084e0dc4af65cd10373ac241c7e" -dependencies = [ - "num-traits", -] - [[package]] name = "librashader-common" version = "0.1.0-rc.2" @@ -1012,6 +1003,15 @@ dependencies = [ "windows", ] +[[package]] +name = "librashader-common" +version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff30c28bf8007f8061a3e429378a5d3682e61d15fe81825c9e5076a3091e349" +dependencies = [ + "num-traits", +] + [[package]] name = "librashader-preprocess" version = "0.1.0-rc.2" @@ -1019,7 +1019,7 @@ dependencies = [ "encoding_rs", "glob", "librashader-common 0.1.0-rc.2", - "librashader-presets 0.1.0-beta.19", + "librashader-presets 0.1.0-rc.2 (registry+https://github.com/rust-lang/crates.io-index)", "nom", "rayon", "rustc-hash", @@ -1028,11 +1028,10 @@ dependencies = [ [[package]] name = "librashader-presets" -version = "0.1.0-beta.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d645454864fb8e92f77cea3f7f85a978b810f9215e1299ccd8f3fcc25798f4fe" +version = "0.1.0-rc.2" dependencies = [ - "librashader-common 0.1.0-beta.20", + "glob", + "librashader-common 0.1.0-rc.2", "nom", "nom_locate", "num-traits", @@ -1042,9 +1041,10 @@ dependencies = [ [[package]] name = "librashader-presets" version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de7bfd6903b4c52db1d220cb67d9e618ba87922300893586b2cf360b7591bde6" dependencies = [ - "glob", - "librashader-common 0.1.0-rc.2", + "librashader-common 0.1.0-rc.2 (registry+https://github.com/rust-lang/crates.io-index)", "nom", "nom_locate", "num-traits", diff --git a/librashader-runtime-d3d12/src/filter_chain.rs b/librashader-runtime-d3d12/src/filter_chain.rs index f2b129c..11e11bb 100644 --- a/librashader-runtime-d3d12/src/filter_chain.rs +++ b/librashader-runtime-d3d12/src/filter_chain.rs @@ -405,9 +405,6 @@ impl FilterChainD3D12 { librashader_reflect::back::dxil::ShaderModel::ShaderModel6_0, ))?; - let hlsl_reflection = hlsl.reflect(index, semantics)?; - let hlsl = hlsl.compile(Some(ShaderModel::V6_0))?; - let render_format = if let Some(format) = config.get_format_override() { format } else if source.format != ImageFormat::Unknown { @@ -429,6 +426,9 @@ impl FilterChainD3D12 { ) { (dxil_reflection, graphics_pipeline) } else { + let hlsl_reflection = hlsl.reflect(index, semantics)?; + let hlsl = hlsl.compile(Some(ShaderModel::V6_0))?; + let graphics_pipeline = D3D12GraphicsPipeline::new_from_hlsl( device, library,