Skip to content

Commit 95f248a

Browse files
committed
Add actual shader compile to smoke tests
1 parent 708fefc commit 95f248a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ test_output
1717
cmy_triangle_renderer.svg
1818
.aider*
1919
flamegraph.svg
20+
21+
# Compiled shader assets from running tests
22+
crates/shader-crate-template/shaders

crates/cargo-gpu/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,17 @@ mod test {
207207
&format!("{}", output_dir.display()),
208208
];
209209
if let Cli {
210-
command: Command::Build(build),
210+
command: Command::Build(mut build),
211211
} = Cli::parse_from(args)
212212
{
213213
assert_eq!(shader_crate, build.shader_crate);
214214
assert_eq!(output_dir, build.output_dir);
215+
216+
// TODO:
217+
// What's the best way to reset caches for this? For example we could add a
218+
// `--force-spirv-cli-rebuild`, but that would slow down each test. But without
219+
// something like that we might not be getting actual idempotent tests.
220+
build.run();
215221
} else {
216222
panic!("was not a build command");
217223
}

crates/shader-crate-template/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Shader entry points.
22
//!
3-
//! Contains an example vertex shader, fragment shader and one example compute
4-
//! shader.
3+
//! Contains an example vertex shader, fragment shader.
54
#![no_std]
65
use glam::{Vec2, Vec4};
76
use spirv_std::spirv;

0 commit comments

Comments
 (0)