d3d12: no need to build hlsl if not needed

This commit is contained in:
chyyran 2023-02-12 22:49:23 -05:00
parent abadfb3ee1
commit d6bbdb43fd
2 changed files with 19 additions and 19 deletions

32
Cargo.lock generated
View file

@ -993,15 +993,6 @@ dependencies = [
"windows", "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]] [[package]]
name = "librashader-common" name = "librashader-common"
version = "0.1.0-rc.2" version = "0.1.0-rc.2"
@ -1012,6 +1003,15 @@ dependencies = [
"windows", "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]] [[package]]
name = "librashader-preprocess" name = "librashader-preprocess"
version = "0.1.0-rc.2" version = "0.1.0-rc.2"
@ -1019,7 +1019,7 @@ dependencies = [
"encoding_rs", "encoding_rs",
"glob", "glob",
"librashader-common 0.1.0-rc.2", "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", "nom",
"rayon", "rayon",
"rustc-hash", "rustc-hash",
@ -1028,11 +1028,10 @@ dependencies = [
[[package]] [[package]]
name = "librashader-presets" name = "librashader-presets"
version = "0.1.0-beta.19" version = "0.1.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d645454864fb8e92f77cea3f7f85a978b810f9215e1299ccd8f3fcc25798f4fe"
dependencies = [ dependencies = [
"librashader-common 0.1.0-beta.20", "glob",
"librashader-common 0.1.0-rc.2",
"nom", "nom",
"nom_locate", "nom_locate",
"num-traits", "num-traits",
@ -1042,9 +1041,10 @@ dependencies = [
[[package]] [[package]]
name = "librashader-presets" name = "librashader-presets"
version = "0.1.0-rc.2" version = "0.1.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de7bfd6903b4c52db1d220cb67d9e618ba87922300893586b2cf360b7591bde6"
dependencies = [ dependencies = [
"glob", "librashader-common 0.1.0-rc.2 (registry+https://github.com/rust-lang/crates.io-index)",
"librashader-common 0.1.0-rc.2",
"nom", "nom",
"nom_locate", "nom_locate",
"num-traits", "num-traits",

View file

@ -405,9 +405,6 @@ impl FilterChainD3D12 {
librashader_reflect::back::dxil::ShaderModel::ShaderModel6_0, 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() { let render_format = if let Some(format) = config.get_format_override() {
format format
} else if source.format != ImageFormat::Unknown { } else if source.format != ImageFormat::Unknown {
@ -429,6 +426,9 @@ impl FilterChainD3D12 {
) { ) {
(dxil_reflection, graphics_pipeline) (dxil_reflection, graphics_pipeline)
} else { } else {
let hlsl_reflection = hlsl.reflect(index, semantics)?;
let hlsl = hlsl.compile(Some(ShaderModel::V6_0))?;
let graphics_pipeline = D3D12GraphicsPipeline::new_from_hlsl( let graphics_pipeline = D3D12GraphicsPipeline::new_from_hlsl(
device, device,
library, library,