Skip to content

Commit

Permalink
Further iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald committed Oct 25, 2023
1 parent be3e121 commit f96f272
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 23 deletions.
1 change: 0 additions & 1 deletion .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ allow = [
"ISC",
"MIT",
"MIT-0",
"MPL-2.0",
"Unicode-DFS-2016",
"Zlib",
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ jobs:
run: |
set -e
cargo xtask test --llvm-cov
cargo xtask test --llvm-cov --all-features
- uses: actions/upload-artifact@v3
if: always() # We want artifacts even if the tests fail.
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/lazy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
- name: Build Naga
run: |
cd naga
cargo build --release --bin 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
for file in data/*.spv do echo "Translating" ${file} && ../target/release/naga --validate 27 ${file} ${file}.metal; done
parse-vulkan-tutorial-shaders:
name: Parse Sascha Willems Vulkan tutorial shaders
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Build Naga
run: |
cd naga
cargo build --release --bin naga
cargo build --release -p naga-cli
- name: Convert metal shaders
run: |
Expand All @@ -66,7 +66,7 @@ jobs:
do
echo "Convert: $fname"
FILE_COUNT=$((FILE_COUNT+1))
target/release/naga --validate 27 $(realpath ${fname}) out/$(basename ${fname}).metal
../target/release/naga --validate 27 $(realpath ${fname}) out/$(basename ${fname}).metal
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
Expand All @@ -87,8 +87,7 @@ jobs:
- name: Build Naga
run: |
cd naga
cargo build --release --bin naga
cargo build --release -p naga-cli
- name: Install spirv-tools
run: |
Expand Down Expand Up @@ -125,7 +124,7 @@ jobs:
do
echo "Convert: $fname"
FILE_COUNT=$((FILE_COUNT+1))
../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
../../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
Expand All @@ -147,7 +146,7 @@ jobs:
do
echo "Validate: $fname"
FILE_COUNT=$((FILE_COUNT+1))
../target/release/naga --validate 27 $(realpath ${fname})
../../target/release/naga --validate 27 $(realpath ${fname})
if [[ $? -eq 0 ]]; then
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
fi
Expand Down
1 change: 1 addition & 0 deletions naga/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
license = "MIT OR Apache-2.0"

[package.metadata]
cargo-fuzz = true
Expand Down
1 change: 1 addition & 0 deletions naga/hlsl-snapshots/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "hlsl-snapshots"
version = "0.1.0"
edition = "2021"
publish = false
license = "MIT OR Apache-2.0"

[dependencies]
anyhow = "1"
Expand Down
1 change: 1 addition & 0 deletions naga/src/proc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ impl GlobalCtx<'_> {
}
}

#[allow(dead_code)]
pub(crate) fn eval_expr_to_literal(
&self,
handle: crate::Handle<crate::Expression>,
Expand Down
21 changes: 9 additions & 12 deletions naga/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,8 @@ impl Input {
let mut param_path = self.input_path();
param_path.set_extension("param.ron");
match fs::read_to_string(&param_path) {
Ok(string) => ron::de::from_str(&string).unwrap_or_else(|_| panic!(
"Couldn't parse param file: {}",
param_path.display()
)),
Ok(string) => ron::de::from_str(&string)
.unwrap_or_else(|_| panic!("Couldn't parse param file: {}", param_path.display())),
Err(_) => Parameters::default(),
}
}
Expand Down Expand Up @@ -277,10 +275,7 @@ fn check_targets(

let info = naga::valid::Validator::new(naga::valid::ValidationFlags::all(), capabilities)
.validate(module)
.unwrap_or_else(|_| panic!(
"Naga module validation failed on test '{}'",
name.display()
));
.unwrap_or_else(|_| panic!("Naga module validation failed on test '{}'", name.display()));

#[cfg(feature = "compact")]
let info = {
Expand All @@ -297,10 +292,12 @@ fn check_targets(

naga::valid::Validator::new(naga::valid::ValidationFlags::all(), capabilities)
.validate(module)
.unwrap_or_else(|_| panic!(
"Post-compaction module validation failed on test '{}'",
name.display()
))
.unwrap_or_else(|_| {
panic!(
"Post-compaction module validation failed on test '{}'",
name.display()
)
})
};

#[cfg(feature = "serialize")]
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn run_tests(mut args: Arguments) -> anyhow::Result<()> {

xshell::cmd!(
shell,
"cargo {llvm_cov_nextest_flags...} --no-fail-fast --retries 2"
"cargo {llvm_cov_nextest_flags...} --all-features --no-fail-fast --retries 2"
)
.args(args.finish())
.quiet()
Expand Down

0 comments on commit f96f272

Please sign in to comment.