test(camera-raw): validate the Dehaze, Clarity and Texture shader without a GPU

The adapter-free shader test now validates camera_raw_filters.wgsl as
the pass compiles it, appended to camera_raw_tone.wgsl, so a runner
without a GPU still catches a filters shader that wouldn't compile.
Appending an undefined identifier to camera_raw_filters.wgsl fails it.

Part of #6916.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014nuVUg57HqXLARdhymFiTc
This commit is contained in:
fjamespriceandClaude Opus 5.5 committed 2026-11-09 02:42:52 -05:00
1 parent b02d952e76
commit fa5ca22757
1 file changed
+4 -2
+4 -2
View File
@@ -57,10 +57,12 @@ fn gpu() -> Option<Gpu> {
}
/// The Camera Raw shaders parse and validate (naga, as wgpu does before any driver sees them),
/// with no adapter: the GPU tests below skip on runners without one.
/// with no adapter: the GPU tests below skip on runners without one. The filters are compiled
/// appended to the tone shader, as the pass builds them.
#[test]
fn the_shaders_validate_without_a_gpu() {
for src in [photocraft_gpu::CAMERA_RAW_SHADER, photocraft_gpu::CAMERA_RAW_TONE_SHADER] {
let tone = format!("{}\n{}", photocraft_gpu::CAMERA_RAW_TONE_SHADER, photocraft_gpu::CAMERA_RAW_FILTERS_SHADER);
for src in [photocraft_gpu::CAMERA_RAW_SHADER, tone.as_str()] {
let module = wgpu::naga::front::wgsl::parse_str(src).unwrap_or_else(|e| panic!("{}", e.emit_to_string(src)));
wgpu::naga::valid::Validator::new(wgpu::naga::valid::ValidationFlags::all(), wgpu::naga::valid::Capabilities::empty())
.validate(&module)