From 157740665549861867136b67bfa25e46bc225b90 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 14 Jan 2025 23:03:02 +0100 Subject: [PATCH] Add static molten vk for macos (v1.2.6). --- .github/workflows/build.yml | 2 ++ Cargo.lock | 36 ++++++++++++++++++- lib/graphics-backend/Cargo.toml | 8 +++-- .../src/backends/vulkan/instance.rs | 3 ++ 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 817cfac..9eedf20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,6 +76,8 @@ jobs: brew install pkg-config autoconf automake || true # for ffmpeg brew install ffmpeg || true + # for building molten vk + brew install python-setuptools || true - name: Prepare msys dependencies if: contains(matrix.os, 'windows') diff --git a/Cargo.lock b/Cargo.lock index 024b6dc..6d32cf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -513,6 +513,17 @@ dependencies = [ "libloading", ] +[[package]] +name = "ash-molten" +version = "0.19.0+1.2.8" +source = "git+https://github.com/Jupeyy/ash-molten?branch=ddnet_moltenvk#b9d0f646002ff5a29e3b153d56985ed86d4b2473" +dependencies = [ + "anyhow", + "ash", + "plist", + "serde", +] + [[package]] name = "ash-window" version = "0.13.0" @@ -4391,6 +4402,7 @@ dependencies = [ "anyhow", "arc-swap", "ash", + "ash-molten", "ash-window", "atomic_enum", "base", @@ -7235,6 +7247,19 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "plist" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" +dependencies = [ + "base64 0.22.1", + "indexmap 2.7.0", + "quick-xml 0.32.0", + "serde", + "time", +] + [[package]] name = "png" version = "0.17.16" @@ -7525,6 +7550,15 @@ dependencies = [ "suffix_array", ] +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + [[package]] name = "quick-xml" version = "0.36.2" @@ -10915,7 +10949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.36.2", "quote", ] diff --git a/lib/graphics-backend/Cargo.toml b/lib/graphics-backend/Cargo.toml index 630b971..84d33dd 100644 --- a/lib/graphics-backend/Cargo.toml +++ b/lib/graphics-backend/Cargo.toml @@ -51,7 +51,11 @@ log = "0.4.22" either = "1.13.0" replace_with = "0.1.7" crossbeam = "0.8.4" +futures = "0.3.31" + +[target.'cfg(target_os = "macos")'.dependencies] +ash-molten = { git = "https://github.com/Jupeyy/ash-molten", branch = "ddnet_moltenvk" } -#[cfg(test)] +[dev-dependencies] base-http = { path = "../base-http" } -futures = "0.3.31" + diff --git a/lib/graphics-backend/src/backends/vulkan/instance.rs b/lib/graphics-backend/src/backends/vulkan/instance.rs index 93115fe..cd33f7d 100644 --- a/lib/graphics-backend/src/backends/vulkan/instance.rs +++ b/lib/graphics-backend/src/backends/vulkan/instance.rs @@ -29,7 +29,10 @@ impl Instance { display_requirements: &BackendDisplayRequirements, dbg_mode: GfxDebugModes, ) -> anyhow::Result> { + #[cfg(not(target_os = "macos"))] let entry = unsafe { ash::Entry::load() }?; + #[cfg(target_os = "macos")] + let entry = ash_molten::load(); let extensions = &display_requirements.extensions;