wgpu/.github/workflows/lazy.yml

156 lines
4.6 KiB
YAML
Raw Normal View History

2023-10-25 20:51:36 +00:00
# Lazy jobs running on trunk post merges.
name: Lazy
2021-05-06 16:24:57 +00:00
on:
pull_request:
paths:
- '.github/workflows/lazy.yml'
2023-10-25 20:51:36 +00:00
push:
branches: [trunk]
2021-05-06 16:24:57 +00:00
env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
2021-05-20 03:24:09 +00:00
parse-dota2:
2023-10-25 20:51:36 +00:00
name: "Validate Shaders: Dota2"
2021-05-20 03:24:09 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2023-10-25 20:51:36 +00:00
- run: mkdir naga/data
2021-05-20 03:24:09 +00:00
- name: Download shaders
2023-10-25 20:51:36 +00:00
run: curl https://user.fm/files/v2-5573e18b9f03f42c6ae53c392083da35/dota2-shaders.zip -o naga/data/all.zip
2021-05-20 03:24:09 +00:00
- name: Unpack shaders
2023-10-25 20:51:36 +00:00
run: |
cd naga/data
unzip all.zip
2021-05-20 03:24:09 +00:00
- name: Build Naga
2023-10-25 20:51:36 +00:00
run: |
cd naga
cargo build --release -p naga-cli
2021-05-20 03:24:09 +00:00
- name: Convert shaders
2023-10-25 20:51:36 +00:00
run: |
cd naga
for file in data/*.spv ; do echo "Translating" ${file} && ../target/release/naga --validate 27 ${file} ${file}.metal; done
parse-vulkan-tutorial-shaders:
2023-10-25 20:51:36 +00:00
name: "Validate Shaders: Sascha Willems Vulkan Tutorial"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download shaders
2023-10-25 20:51:36 +00:00
run: cd naga && git clone https://github.com/SaschaWillems/Vulkan.git
- name: Build Naga
2023-10-25 20:51:36 +00:00
run: |
cd naga
cargo build --release -p naga-cli
- name: Convert metal shaders
run: |
# No needed to stop workflow if we can't validate one file
set +e
2023-10-25 20:51:36 +00:00
cd naga
touch counter
SUCCESS_RESULT_COUNT=0
FILE_COUNT=0
mkdir -p out
find "Vulkan/data/shaders/glsl/" -name '*.spv' | while read fname;
do
echo "Convert: $fname"
FILE_COUNT=$((FILE_COUNT+1))
2023-10-25 20:51:36 +00:00
../target/release/naga --validate 27 $(realpath ${fname}) out/$(basename ${fname}).metal
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
done
cat counter
dneto0_spirv-samples:
2023-10-25 20:51:36 +00:00
name: "Validate Shaders: dneto0 spirv-samples"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download shaders
2023-10-25 20:51:36 +00:00
run: |
cd naga
git clone https://github.com/dneto0/spirv-samples.git
- name: Build Naga
2023-10-25 20:51:36 +00:00
run: |
cargo build --release -p naga-cli
- name: Install spirv-tools
run: |
2023-10-25 20:51:36 +00:00
cd naga
wget -q https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1489/20210629-121459/install.tgz
tar zxf install.tgz
./install/bin/spirv-as --version
- name: Compile spv from spvasm
run: |
2023-10-25 20:51:36 +00:00
cd naga/spirv-samples
mkdir -p spv
find "./spvasm" -name '*.spvasm' | while read fname;
do
echo "Convert to spv with spirv-as: $fname"
../install/bin/spirv-as --target-env spv1.3 $(realpath ${fname}) -o ./spv/$(basename ${fname}).spv
done;
- name: Validate spv and generate wgsl
run: |
set +e
2023-10-25 20:51:36 +00:00
cd naga/spirv-samples
SUCCESS_RESULT_COUNT=0
FILE_COUNT=0
mkdir -p spv
mkdir -p wgsl
echo "==== Validate spv and generate wgsl ===="
rm -f counter
touch counter
find "./spv" -name '*.spv' | while read fname;
do
echo "Convert: $fname"
FILE_COUNT=$((FILE_COUNT+1))
2023-10-25 20:51:36 +00:00
../../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
done
cat counter
- name: Validate output wgsl
run: |
set +e
2023-10-25 20:51:36 +00:00
cd naga/spirv-samples
SUCCESS_RESULT_COUNT=0
FILE_COUNT=0
rm -f counter
touch counter
find "./wgsl" -name '*.wgsl' | while read fname;
do
echo "Validate: $fname"
FILE_COUNT=$((FILE_COUNT+1))
2023-10-25 20:51:36 +00:00
../../target/release/naga --validate 27 $(realpath ${fname})
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
done
cat counter