-
Notifications
You must be signed in to change notification settings - Fork 923
155 lines (132 loc) · 4.62 KB
/
lazy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Lazy jobs running on trunk post merges.
name: Lazy
on:
pull_request:
paths:
- '.github/workflows/lazy.yml'
push:
branches: [trunk]
env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
parse-dota2:
name: "Validate Shaders: Dota2"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: mkdir naga/data
- name: Download shaders
run: curl https://user.fm/files/v2-5573e18b9f03f42c6ae53c392083da35/dota2-shaders.zip -o naga/data/all.zip
- name: Unpack shaders
run: |
cd naga/data
unzip all.zip
- name: Build Naga
run: |
cd naga
cargo build --release -p naga-cli
- name: Convert shaders
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:
name: "Validate Shaders: Sascha Willems Vulkan Tutorial"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download shaders
run: cd naga && git clone https://github.com/SaschaWillems/Vulkan.git
- name: Build Naga
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
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))
../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:
name: "Validate Shaders: dneto0 spirv-samples"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download shaders
run: |
cd naga
git clone https://github.com/dneto0/spirv-samples.git
- name: Build Naga
run: |
cargo build --release -p naga-cli
- name: Install spirv-tools
run: |
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: |
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
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))
../../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
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))
../../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