From b796750ffac549eb4428932532eac4db0d3fce97 Mon Sep 17 00:00:00 2001 From: Dmitry Zolotukhin Date: Tue, 23 Jan 2024 20:49:17 +0100 Subject: [PATCH] Compile GLSL shaders into SPIR-V. --- .github/workflows/cargo-build.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml index fb81b02..4bcdddc 100644 --- a/.github/workflows/cargo-build.yml +++ b/.github/workflows/cargo-build.yml @@ -26,19 +26,24 @@ jobs: ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db - ~/.cargo/bin/naga ${{ github.workspace }}/target key: lint-${{ runner.os }}-${{ steps.get-rust-version.outputs.VERSION }}-${{ hashFiles('Cargo.lock') }} - - name: Install naga - if: steps.cache-rust.outputs.cache-hit != 'true' - run: cargo install naga-cli + - name: Install glslang + run: sudo apt install glslang-tools + + - name: Build SPIR-V shaders with glslang + run: glslang -V -g0 src/correlation.comp.glsl -o src/correlation.spv - - name: Validate shaders with naga - run: naga src/correlation.wgsl - name: Validate Rust code with clippy run: cargo clippy + - name: Upload SPIR-V shaders + uses: actions/upload-artifact@v3 + with: + name: shaders-spv + path: src/correlation.spv + build-linux: # Older Ubuntu versions will link with an older GLIBC and provide better compatibility runs-on: ubuntu-20.04 @@ -84,10 +89,10 @@ jobs: - name: Build run: cargo build --target=${{ matrix.arch }}-unknown-linux-gnu --release - + - name: Package application run: tar -cvjf cybervision-${{ matrix.os }}-${{ matrix.arch }}.tar.bz2 -C target/${{ matrix.arch }}-unknown-linux-gnu/release cybervision - + - name: Upload application uses: actions/upload-artifact@v3 with: