From 03f9167e951757b6518e830c4313547d31a346fa Mon Sep 17 00:00:00 2001 From: Johann Woelper Date: Sun, 19 May 2024 08:28:38 +0200 Subject: [PATCH 1/2] fix: Ensure spirv is not used when only using shaderc --- .github/workflows/build_checks.yml | 4 +-- .github/workflows/check_arm7.yml | 2 +- .github/workflows/check_netbsd_minimal.yml | 2 +- .github/workflows/check_osx.yml | 2 +- .../check_ubuntu_no_default_features.yml | 2 +- .github/workflows/check_windows.yml | 2 +- .github/workflows/release.yml | 6 ++-- Cargo.lock | 35 ++----------------- Cargo.toml | 4 +-- README.md | 11 ++++-- 10 files changed, 22 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build_checks.yml b/.github/workflows/build_checks.yml index 2d0c44d..e5ffb88 100644 --- a/.github/workflows/build_checks.yml +++ b/.github/workflows/build_checks.yml @@ -21,7 +21,7 @@ jobs: if: matrix.os == 'ubuntu-18.04' - name: Cross-compile arm - run: cross build --target armv7-unknown-linux-musleabihf --no-default-features + run: cross build --target armv7-unknown-linux-musleabihf --no-default-features --features notan/glsl-to-spirv if: matrix.os == 'ubuntu-18.04' # - name: Set up pagefile @@ -49,5 +49,5 @@ jobs: run: cargo build - name: cargo check without default features - run: cargo check --no-default-features + run: cargo check --no-default-features --features notan/glsl-to-spirv diff --git a/.github/workflows/check_arm7.yml b/.github/workflows/check_arm7.yml index ace3b1d..8ada522 100644 --- a/.github/workflows/check_arm7.yml +++ b/.github/workflows/check_arm7.yml @@ -18,7 +18,7 @@ jobs: run: cargo install cross - name: Cross-compile arm - run: cross check --target armv7-unknown-linux-gnueabihf --no-default-features --features spirv + run: cross check --target armv7-unknown-linux-gnueabihf --no-default-features --features --features notan/glsl-to-spirv - name: Check output run: ls target/ diff --git a/.github/workflows/check_netbsd_minimal.yml b/.github/workflows/check_netbsd_minimal.yml index 78668a4..7c859d8 100644 --- a/.github/workflows/check_netbsd_minimal.yml +++ b/.github/workflows/check_netbsd_minimal.yml @@ -20,4 +20,4 @@ jobs: run: | PATH=$HOME/.cargo/bin:$PATH export PATH - cargo check --no-default-features --features spirv + cargo check --no-default-features --features notan/glsl-to-spirv diff --git a/.github/workflows/check_osx.yml b/.github/workflows/check_osx.yml index c92dc03..187fcf0 100644 --- a/.github/workflows/check_osx.yml +++ b/.github/workflows/check_osx.yml @@ -13,7 +13,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Check without default features - run: cargo check --no-default-features --features spirv + run: cargo check --no-default-features --features notan/glsl-to-spirv # - name: Check with build features # run: cargo check --features heif diff --git a/.github/workflows/check_ubuntu_no_default_features.yml b/.github/workflows/check_ubuntu_no_default_features.yml index 8a28ef9..d6a84a1 100644 --- a/.github/workflows/check_ubuntu_no_default_features.yml +++ b/.github/workflows/check_ubuntu_no_default_features.yml @@ -33,7 +33,7 @@ jobs: # run: cargo build - name: cargo check without default features - run: cargo check --no-default-features --features spirv + run: cargo check --no-default-features --features notan/glsl-to-spirv - name: cargo check with heif run: PKG_CONFIG_PATH=libheif/build cargo check --features heif diff --git a/.github/workflows/check_windows.yml b/.github/workflows/check_windows.yml index 93de652..92ed593 100644 --- a/.github/workflows/check_windows.yml +++ b/.github/workflows/check_windows.yml @@ -30,7 +30,7 @@ jobs: run: vcpkg install libheif:x64-windows-static - name: cargo check without default features - run: cargo check --no-default-features --features shaderc + run: cargo check --no-default-features --features notan/glsl-to-spirv - name: clean run: cargo clean diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed13f47..a9bd3ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,13 +54,13 @@ jobs: - name: Cross-compile armv7 run: | - cross build --release --target armv7-unknown-linux-gnueabihf --no-default-features + cross build --release --target armv7-unknown-linux-gnueabihf --no-default-features --features notan/glsl-to-spirv zip -r oculante_armv7_minimal.zip target/armv7-unknown-linux-gnueabihf/release/oculante if: matrix.os == 'ubuntu-latest' - name: Cross-compile arm64 run: | - cross build --release --target aarch64-unknown-linux-gnu --no-default-features + cross build --release --target aarch64-unknown-linux-gnu --no-default-features --features notan/glsl-to-spirv zip -r oculante_aarch64_minimal.zip target/aarch64-unknown-linux-gnu/release/oculante if: matrix.os == 'ubuntu-latest' @@ -107,7 +107,7 @@ jobs: - name: Build Linux classic Application run: | - cargo build --release --no-default-features + cargo build --release --no-default-features --features notan/glsl-to-spirv zip -r oculante_linux_minimal.zip target/release/oculante cargo build --release zip -r oculante_linux.zip target/release/oculante diff --git a/Cargo.lock b/Cargo.lock index 2164f70..c69202a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,9 +180,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a4bd113ab6da4cd0f521068a6e2ee1065eab54107266a11835d02c8ec86a37" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "aom-decode" @@ -4012,7 +4012,6 @@ dependencies = [ "num", "proc-macro2", "quote", - "shaderc", "spirv_cross", "syn 2.0.64", ] @@ -5408,15 +5407,6 @@ dependencies = [ "svgtypes", ] -[[package]] -name = "roxmltree" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921904a62e410e37e215c40381b7117f830d9d89ba60ab5236170541dd25646b" -dependencies = [ - "xmlparser", -] - [[package]] name = "roxmltree" version = "0.18.1" @@ -5763,27 +5753,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "shaderc" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e07913ada18607bb60d12431cbe3358d3bbebbe95948e1618851dc01e63b7b" -dependencies = [ - "libc", - "shaderc-sys", -] - -[[package]] -name = "shaderc-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73120d240fe22196300f39ca8547ca2d014960f27b19b47b21288b396272f7f7" -dependencies = [ - "cmake", - "libc", - "roxmltree 0.14.1", -] - [[package]] name = "sharded-slab" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index f3800fb..eaadb02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,15 +88,13 @@ zerocopy = "0.7.34" icns = "0.3.1" [features] -default = ["turbo", "avif_native", "file_open", "update", "spirv"] +default = ["turbo", "avif_native", "file_open", "update", "notan/glsl-to-spirv"] heif = ["libheif-rs"] avif_native = ["avif-decode"] dav1d = ["libavif-image"] file_open = ["rfd"] turbo = ["turbojpeg"] update = ["self_update"] -shaderc = ["notan/shaderc"] -spirv = ["notan/glsl-to-spirv"] diff --git a/README.md b/README.md index 9247316..4c7dd43 100644 --- a/README.md +++ b/README.md @@ -170,8 +170,15 @@ Mac `brew install nasm` ### Cargo Features -If you disable `turbo` (on by default), the turbojpeg library will not be used to open jpeg images. You won't need Nasm to be installed. -The feature `file_open` will enable/disable a file open dialog. This pulls in additional dependencies and is enabled by default. +- `turbo` (on by default), the turbojpeg library will not be used to open jpeg images. You won't need Nasm to be installed. + +- `file_open` will enable/disable a OS-native file open dialog. This pulls in additional dependencies and is enabled by default. Disabling it will enable a custom file dialog. This will probably the default in the future. + +- `notan/glsl-to-spirv` (default) uses the spirv shader compiler + +- `notan/shaderc` uses shaderc as a shader compiler. Longer build time. + +- `update` (default) enable app updating. ### Shortcuts: `mouse wheel` = zoom From ff534bd5dfd1f01173ea10504de2512a6de19521 Mon Sep 17 00:00:00 2001 From: Johann Woelper Date: Sun, 19 May 2024 08:30:42 +0200 Subject: [PATCH 2/2] fix feature flags --- .github/workflows/check_arm7.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_arm7.yml b/.github/workflows/check_arm7.yml index 8ada522..50b66d3 100644 --- a/.github/workflows/check_arm7.yml +++ b/.github/workflows/check_arm7.yml @@ -18,7 +18,7 @@ jobs: run: cargo install cross - name: Cross-compile arm - run: cross check --target armv7-unknown-linux-gnueabihf --no-default-features --features --features notan/glsl-to-spirv + run: cross check --target armv7-unknown-linux-gnueabihf --no-default-features --features notan/glsl-to-spirv - name: Check output run: ls target/