From c5aac6615a395b752ae702da807a1a078bb00aae Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Mon, 2 Oct 2023 13:17:01 +1100 Subject: [PATCH] make ash version more flexible --- librashader-capi/Cargo.toml | 29 ++++++++++++++----- librashader-common/Cargo.toml | 2 +- librashader-runtime-vk/Cargo.toml | 15 ++++++---- librashader/Cargo.toml | 48 ++++++++++++++++++++++++------- 4 files changed, 70 insertions(+), 24 deletions(-) diff --git a/librashader-capi/Cargo.toml b/librashader-capi/Cargo.toml index a28b660..15e85bb 100644 --- a/librashader-capi/Cargo.toml +++ b/librashader-capi/Cargo.toml @@ -12,23 +12,38 @@ keywords = ["shader", "retroarch", "SPIR-V"] description = "RetroArch shaders for all." [lib] -crate-type = [ "cdylib", "staticlib" ] +crate-type = ["cdylib", "staticlib"] [features] -default = ["runtime-all" ] -runtime-all = ["runtime-opengl", "runtime-d3d11", "runtime-d3d12", "runtime-vulkan"] +default = ["runtime-all"] +runtime-all = [ + "runtime-opengl", + "runtime-d3d11", + "runtime-d3d12", + "runtime-vulkan", +] runtime-opengl = ["gl", "librashader/runtime-gl"] -runtime-d3d11 = ["windows", "librashader/runtime-d3d11", "windows/Win32_Graphics_Direct3D11"] -runtime-d3d12 = ["windows", "librashader/runtime-d3d12", "windows/Win32_Graphics_Direct3D12"] +runtime-d3d11 = [ + "windows", + "librashader/runtime-d3d11", + "windows/Win32_Graphics_Direct3D11", +] +runtime-d3d12 = [ + "windows", + "librashader/runtime-d3d12", + "windows/Win32_Graphics_Direct3D12", +] runtime-vulkan = ["ash", "librashader/runtime-vk"] [dependencies] -librashader = { path = "../librashader", version = "0.1.4", features = ["internal"] } +librashader = { path = "../librashader", version = "0.1.4", features = [ + "internal", +] } thiserror = "1.0.37" paste = "1.0.9" gl = { version = "0.14.0", optional = true } rustc-hash = "1.1.0" -ash = { version = "0.37.2+1.3.238", optional = true } +ash = { version = "0.37", optional = true } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } [target.'cfg(windows)'.dependencies.windows] diff --git a/librashader-common/Cargo.toml b/librashader-common/Cargo.toml index 6f6edfa..3ffdbdc 100644 --- a/librashader-common/Cargo.toml +++ b/librashader-common/Cargo.toml @@ -21,7 +21,7 @@ vulkan = ["ash"] [dependencies] gl = { version = "0.14.0", optional = true } -ash = { version = "0.37.1+1.3.235", optional = true } +ash = { version = "0.37", optional = true } num-traits = "0.2.15" diff --git a/librashader-runtime-vk/Cargo.toml b/librashader-runtime-vk/Cargo.toml index 468b693..65dcf0d 100644 --- a/librashader-runtime-vk/Cargo.toml +++ b/librashader-runtime-vk/Cargo.toml @@ -14,19 +14,24 @@ description = "RetroArch shaders for all." # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -librashader-common = { path = "../librashader-common", features = ["vulkan"], version = "0.1.4" } +librashader-common = { path = "../librashader-common", features = [ + "vulkan", +], version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } -librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = [] } -librashader-runtime = { path = "../librashader-runtime" , version = "0.1.4" } +librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = [ +] } +librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } librashader-cache = { path = "../librashader-cache", version = "0.1.4" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } rustc-hash = "1.1.0" bytemuck = "1.12.3" thiserror = "1.0.37" -ash = { version = "0.37.1+1.3.235", features = ["linked", "debug"] } -gpu-allocator = { version = "0.22.0", default-features = false, features = ["vulkan"] } +ash = { version = "0.37", features = ["linked", "debug"] } +gpu-allocator = { version = "0.22.0", default-features = false, features = [ + "vulkan", +] } parking_lot = "0.12.1" rayon = "1.6.1" diff --git a/librashader/Cargo.toml b/librashader/Cargo.toml index a7a5bbe..4e9b6c9 100644 --- a/librashader/Cargo.toml +++ b/librashader/Cargo.toml @@ -16,16 +16,18 @@ description = "RetroArch shaders for all." librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } -librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["standalone"] } -librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } -librashader-runtime-d3d11 = { path = "../librashader-runtime-d3d11", version = "0.1.4", optional = true } -librashader-runtime-d3d12 = { path = "../librashader-runtime-d3d12", version = "0.1.4", optional = true } +librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = [ + "standalone", +] } +librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } +librashader-runtime-d3d11 = { path = "../librashader-runtime-d3d11", version = "0.1.4", optional = true } +librashader-runtime-d3d12 = { path = "../librashader-runtime-d3d12", version = "0.1.4", optional = true } librashader-runtime-gl = { path = "../librashader-runtime-gl", version = "0.1.4", optional = true } librashader-runtime-vk = { path = "../librashader-runtime-vk", version = "0.1.4", optional = true } librashader-cache = { path = "../librashader-cache", version = "0.1.4" } -ash = { version = "0.37.1+1.3.235", optional = true } +ash = { version = "0.37", optional = true } [target.'cfg(windows)'.dependencies.windows] version = "0.48.0" @@ -39,10 +41,34 @@ preprocess = [] presets = [] # runtimes -runtime-gl = [ "runtime", "reflect-cross", "librashader-common/opengl", "librashader-runtime-gl" ] -runtime-d3d11 = [ "runtime", "reflect-cross","librashader-common/d3d11", "librashader-runtime-d3d11", "windows/Win32_Graphics_Direct3D11" ] -runtime-d3d12 = [ "runtime", "reflect-cross", "reflect-dxil", "librashader-common/d3d12", "librashader-runtime-d3d12", "windows/Win32_Graphics_Direct3D12" ] -runtime-vk = ["runtime", "reflect-cross", "librashader-common/vulkan", "librashader-runtime-vk", "ash" ] +runtime-gl = [ + "runtime", + "reflect-cross", + "librashader-common/opengl", + "librashader-runtime-gl", +] +runtime-d3d11 = [ + "runtime", + "reflect-cross", + "librashader-common/d3d11", + "librashader-runtime-d3d11", + "windows/Win32_Graphics_Direct3D11", +] +runtime-d3d12 = [ + "runtime", + "reflect-cross", + "reflect-dxil", + "librashader-common/d3d12", + "librashader-runtime-d3d12", + "windows/Win32_Graphics_Direct3D12", +] +runtime-vk = [ + "runtime", + "reflect-cross", + "librashader-common/vulkan", + "librashader-runtime-vk", + "ash", +] # reflection reflect-cross = ["reflect", "librashader-reflect/cross"] @@ -52,7 +78,7 @@ runtime-all = ["runtime-gl", "runtime-d3d11", "runtime-d3d12", "runtime-vk"] reflect-all = ["reflect-cross", "reflect-dxil"] # enable all features by default -default = [ "full" ] +default = ["full"] internal = [] full = ["runtime-all", "reflect-all", "preprocess", "presets"] @@ -62,4 +88,4 @@ docsrs = ["librashader-cache/docsrs"] [package.metadata.docs.rs] targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] -features = [ "librashader-cache/docsrs" ] +features = ["librashader-cache/docsrs"]