Skip to content

Commit

Permalink
Compile GLSL shaders into SPIR-V.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlogic committed Jan 23, 2024
1 parent e47ea54 commit b796750
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/cargo-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b796750

Please sign in to comment.