Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SPIRV parsing test case with Embark Rust shaders #341

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added test-data/spv/embark.spv
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/parse_embark.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Test that tries to parse a set of Rust GPU generated SPIRV shaders from Embark Studios
#[cfg(feature = "spv-in")]
#[test]
fn parse_embark_spv() {
let path = std::path::PathBuf::from("test-data")
.join("spv")
.join("embark.spv");
let spv_bytes = std::fs::read(path).expect("Couldn't read embark.spv");

let module =
naga::front::spv::parse_u8_slice(&spv_bytes, &naga::front::spv::Options::default())
.expect("Module parsing failed");
naga::proc::Validator::new()
.validate(&module)
.expect("Module validation failed");
}