From 5fecfb46c20826fe41b1add7c5808aae6aaf2b92 Mon Sep 17 00:00:00 2001 From: Redwarp Date: Sun, 24 Sep 2023 17:25:38 +0200 Subject: [PATCH] Update wgpu to 0.17 --- Cargo.lock | 101 ++++++++++--------- core/Cargo.toml | 2 +- core/shaders/choose_centroid.wgsl | 11 +- core/shaders/converters/lab_to_rgb.wgsl | 2 +- core/shaders/converters/rgb32f_to_rgb8u.wgsl | 2 +- core/shaders/converters/rgb8u_to_rgb32f.wgsl | 2 +- core/shaders/converters/rgb_to_lab.wgsl | 2 +- core/shaders/find_centroid.wgsl | 2 +- core/shaders/kmeans++_calc_diff.wgsl | 2 +- core/shaders/mix_colors.wgsl | 28 ++--- core/shaders/plus_plus_init.wgsl | 12 +-- core/shaders/resize.wgsl | 2 +- core/shaders/swap.wgsl | 2 +- core/src/modules.rs | 4 +- core/src/shader_tests.rs | 4 +- core/src/structures.rs | 10 +- preprocessor/Cargo.toml | 2 +- preprocessor/src/validate.rs | 5 +- 18 files changed, 101 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2aeec82..a55fc2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,11 +331,11 @@ dependencies = [ [[package]] name = "d3d12" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "libloading", "winapi", ] @@ -401,27 +401,30 @@ dependencies = [ [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "foreign-types-macros" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "fxhash" -version = "0.2.1" +name = "foreign-types-shared" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "getrandom" @@ -464,21 +467,21 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", ] [[package]] @@ -525,9 +528,9 @@ dependencies = [ [[package]] name = "hassle-rs" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85" +checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" dependencies = [ "bitflags 1.3.2", "com-rs", @@ -722,16 +725,17 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "metal" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "block", "core-graphics-types", "foreign-types", "log", "objc", + "paste", ] [[package]] @@ -746,12 +750,12 @@ dependencies = [ [[package]] name = "naga" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3d4269bcb7d50121097702fde1afb75f4ea8083aeb7a55688dcf289a853271" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.0", "codespan-reporting", "hexf-parse", "indexmap", @@ -874,6 +878,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pathdiff" version = "0.2.1" @@ -1038,9 +1048,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "renderdoc-sys" -version = "0.7.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "rgb" @@ -1291,9 +1301,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "wgpu" -version = "0.15.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d745a1b6d91d85c33defbb29f0eee0450e1d2614d987e14bf6baf26009d132d7" +checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce" dependencies = [ "arrayvec", "cfg-if", @@ -1315,20 +1325,20 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.15.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff" +checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2" dependencies = [ "arrayvec", "bit-vec", - "bitflags 1.3.2", + "bitflags 2.4.0", "codespan-reporting", - "fxhash", "log", "naga", "parking_lot", "profiling", "raw-window-handle", + "rustc-hash", "smallvec", "thiserror", "web-sys", @@ -1338,20 +1348,18 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.15.4" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcf61a283adc744bb5453dd88ea91f3f86d5ca6b027661c6c73c7734ae0288b" +checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.0", "block", "core-graphics-types", "d3d12", - "foreign-types", - "fxhash", "glow", "gpu-alloc", "gpu-allocator", @@ -1370,6 +1378,7 @@ dependencies = [ "range-alloc", "raw-window-handle", "renderdoc-sys", + "rustc-hash", "smallvec", "thiserror", "wasm-bindgen", @@ -1380,20 +1389,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.15.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "js-sys", "web-sys", ] [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" diff --git a/core/Cargo.toml b/core/Cargo.toml index 728e22c..13d4ed6 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -12,7 +12,7 @@ description = "Calculates the average colors in an image for color quantization # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -wgpu = "0.15" +wgpu = "0.17" bytemuck = { version = "1.14", features = ["derive", "extern_crate_alloc"] } anyhow = "1.0" palette = "0.7" diff --git a/core/shaders/choose_centroid.wgsl b/core/shaders/choose_centroid.wgsl index 398d353..9ff4b44 100644 --- a/core/shaders/choose_centroid.wgsl +++ b/core/shaders/choose_centroid.wgsl @@ -34,19 +34,19 @@ const FLAG_NOT_READY = 0u; const FLAG_AGGREGATE_READY = 1u; const FLAG_PREFIX_READY = 2u; -fn coords(global_x: u32, dimensions: vec2) -> vec2 { - return vec2(vec2(global_x % u32(dimensions.x), global_x / u32(dimensions.x))); +fn coords(global_x: u32, dimensions: vec2) -> vec2 { + return vec2(global_x % dimensions.x, global_x / dimensions.x); } fn last_group_idx() -> u32 { return arrayLength(&flag_buffer) - 1u; } -fn in_bounds(global_x: u32, dimensions: vec2) -> bool { - return global_x < u32(dimensions.x) * u32(dimensions.y); +fn in_bounds(global_x: u32, dimensions: vec2) -> bool { + return global_x < dimensions.x * dimensions.y; } -fn matches_centroid(k: u32, coords: vec2) -> bool { +fn matches_centroid(k: u32, coords: vec2) -> bool { return k == textureLoad(color_indices, coords, 0).r; } @@ -180,7 +180,6 @@ fn main( @compute @workgroup_size(1) fn pick() { - let dimensions = textureDimensions(pixels); let sum = atomicLoadAggregator(last_group_idx() * 8u + 0u); let k = k_index; if(sum.count > 0u) { diff --git a/core/shaders/converters/lab_to_rgb.wgsl b/core/shaders/converters/lab_to_rgb.wgsl index 8becdf4..4b4f493 100644 --- a/core/shaders/converters/lab_to_rgb.wgsl +++ b/core/shaders/converters/lab_to_rgb.wgsl @@ -71,7 +71,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/converters/rgb32f_to_rgb8u.wgsl b/core/shaders/converters/rgb32f_to_rgb8u.wgsl index 12e73c2..91a5cdf 100644 --- a/core/shaders/converters/rgb32f_to_rgb8u.wgsl +++ b/core/shaders/converters/rgb32f_to_rgb8u.wgsl @@ -7,7 +7,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/converters/rgb8u_to_rgb32f.wgsl b/core/shaders/converters/rgb8u_to_rgb32f.wgsl index 3e87a47..aac6c52 100644 --- a/core/shaders/converters/rgb8u_to_rgb32f.wgsl +++ b/core/shaders/converters/rgb8u_to_rgb32f.wgsl @@ -7,7 +7,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/converters/rgb_to_lab.wgsl b/core/shaders/converters/rgb_to_lab.wgsl index 492f632..0dae0fb 100644 --- a/core/shaders/converters/rgb_to_lab.wgsl +++ b/core/shaders/converters/rgb_to_lab.wgsl @@ -69,7 +69,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/find_centroid.wgsl b/core/shaders/find_centroid.wgsl index cf8e6d0..7258dd7 100644 --- a/core/shaders/find_centroid.wgsl +++ b/core/shaders/find_centroid.wgsl @@ -18,7 +18,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(pixels); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/kmeans++_calc_diff.wgsl b/core/shaders/kmeans++_calc_diff.wgsl index 877358b..039081d 100644 --- a/core/shaders/kmeans++_calc_diff.wgsl +++ b/core/shaders/kmeans++_calc_diff.wgsl @@ -17,7 +17,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(pixels); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/shaders/mix_colors.wgsl b/core/shaders/mix_colors.wgsl index 5f85f19..451dcf6 100644 --- a/core/shaders/mix_colors.wgsl +++ b/core/shaders/mix_colors.wgsl @@ -11,17 +11,17 @@ struct Centroids { @group(0) @binding(2) var color_indices: texture_2d; @group(0) @binding(3) var centroids: Centroids; -const index_matrix: array = array(0, 8, 2, 10, - 12, 4, 14, 6, - 3, 11, 1, 9, - 15, 7, 13, 5); +const index_matrix: array = array(0u, 8u, 2u, 10u, + 12u, 4u, 14u, 6u, + 3u, 11u, 1u, 9u, + 15u, 7u, 13u, 5u); // #include functions/delta_e.wgsl -fn index_value(coords: vec2) -> f32 { - let x = coords.x % 4; - let y = coords.y % 4; - let index = x + y * 4; +fn index_value(coords: vec2) -> f32 { + let x = coords.x % 4u; + let y = coords.y % 4u; + let index = x + y * 4u; var mine = index_matrix; return f32(mine[index]) / 16.0; } @@ -47,7 +47,7 @@ fn two_closest_colors(color: vec4) -> array, 2> { return values; } -fn dither(color: vec4, coords: vec2) -> vec4 { +fn dither(color: vec4, coords: vec2) -> vec4 { // Based on https://en.wikipedia.org/wiki/Ordered_dithering // Maybe this threshold should be computed by a different shader first? var color_a: vec3 = centroids.data[0].rgb; @@ -82,7 +82,7 @@ fn dither(color: vec4, coords: vec2) -> vec4 { return vec4(closest, 1.0); } -fn meld(color: vec4, coords: vec2) -> vec4 { +fn meld(color: vec4, coords: vec2) -> vec4 { let closest_colors = two_closest_colors(color); let factor = distance_cie94(color.rgb, closest_colors[1].rgb) / distance_cie94(closest_colors[0].rgb, closest_colors[1].rgb); @@ -95,9 +95,9 @@ fn main_dither( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; - if(coords.x >= dimensions.x || coords.y >= dimensions.y) { + if (coords.x >= dimensions.x || coords.y >= dimensions.y) { return; } @@ -118,9 +118,9 @@ fn main_meld( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; - if(coords.x >= dimensions.x || coords.y >= dimensions.y) { + if (coords.x >= dimensions.x || coords.y >= dimensions.y) { return; } diff --git a/core/shaders/plus_plus_init.wgsl b/core/shaders/plus_plus_init.wgsl index 70eafa0..7daadec 100644 --- a/core/shaders/plus_plus_init.wgsl +++ b/core/shaders/plus_plus_init.wgsl @@ -29,23 +29,23 @@ var scratch: array; var shared_flag: u32; var part_id: u32; -fn coords(pixel_index: u32, dimensions: vec2) -> vec2 { - return vec2(vec2(pixel_index % u32(dimensions.x), pixel_index / u32(dimensions.x))); +fn coords(pixel_index: u32, dimensions: vec2) -> vec2 { + return vec2(pixel_index % dimensions.x, pixel_index / dimensions.x); } fn last_group_idx() -> u32 { return arrayLength(&flag_buffer) - 1u; } -fn in_bounds(pixel_index: u32, dimensions: vec2) -> bool { - return pixel_index < u32(dimensions.x) * u32(dimensions.y); +fn in_bounds(pixel_index: u32, dimensions: vec2) -> bool { + return pixel_index < dimensions.x * dimensions.y; } fn atomicStoreCandidate(index: u32, value: Candidate) { atomicStore(&prefix_buffer[index], value.index); } -fn atomicLoadCandidate(index: u32, dimensions: vec2) -> Candidate { +fn atomicLoadCandidate(index: u32, dimensions: vec2) -> Candidate { var output: Candidate; output.index = atomicLoad(&prefix_buffer[index]); @@ -78,7 +78,7 @@ fn main( let workgroup_x = part_id; let dimensions = textureDimensions(pixels); - let width = u32(dimensions.x); + let width = dimensions.x; let global_x = workgroup_x * workgroup_size + local_id.x; var local = Candidate(0u, 0.0); diff --git a/core/shaders/resize.wgsl b/core/shaders/resize.wgsl index 1c3d6cf..ae62adf 100644 --- a/core/shaders/resize.wgsl +++ b/core/shaders/resize.wgsl @@ -8,7 +8,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - if(i32(global_id.x) >= dimensions.x || i32(global_id.y) >= dimensions.y) { + if(global_id.x >= dimensions.x || global_id.y >= dimensions.y) { return; } diff --git a/core/shaders/swap.wgsl b/core/shaders/swap.wgsl index d3803b6..5426633 100644 --- a/core/shaders/swap.wgsl +++ b/core/shaders/swap.wgsl @@ -13,7 +13,7 @@ fn main( @builtin(global_invocation_id) global_id : vec3, ) { let dimensions = textureDimensions(output_texture); - let coords = vec2(global_id.xy); + let coords = global_id.xy; if(coords.x >= dimensions.x || coords.y >= dimensions.y) { return; diff --git a/core/src/modules.rs b/core/src/modules.rs index 1b9fcb4..63c6b25 100644 --- a/core/src/modules.rs +++ b/core/src/modules.rs @@ -1,5 +1,5 @@ use log::{debug, log_enabled}; -use std::{num::NonZeroU32, sync::mpsc::channel}; +use std::sync::mpsc::channel; use wgpu::{ util::{BufferInitDescriptor, DeviceExt}, BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayoutDescriptor, @@ -97,7 +97,6 @@ impl ColorConverterModule { format: Some(TextureFormat::Rgba8Unorm), aspect: wgpu::TextureAspect::All, base_mip_level: 0, - mip_level_count: NonZeroU32::new(1), dimension: Some(TextureViewDimension::D2), ..Default::default() }, @@ -214,7 +213,6 @@ impl ColorReverterModule { format: Some(TextureFormat::Rgba8Unorm), aspect: wgpu::TextureAspect::All, base_mip_level: 0, - mip_level_count: NonZeroU32::new(1), dimension: Some(TextureViewDimension::D2), ..Default::default() }, diff --git a/core/src/shader_tests.rs b/core/src/shader_tests.rs index f09ade9..d9ecdbe 100644 --- a/core/src/shader_tests.rs +++ b/core/src/shader_tests.rs @@ -138,9 +138,7 @@ fn run_wgpu_test(test_function: impl FnOnce(&TestingContext) -> T) -> T { dx12_shader_compiler: wgpu::Dx12Compiler::default(), }); let adapter = pollster::block_on(util::initialize_adapter_from_env_or_default( - &instance, - backend_bits, - None, + &instance, None, )) .expect("could not find suitable adapter on the system"); diff --git a/core/src/structures.rs b/core/src/structures.rs index bb7b273..1efc6ea 100644 --- a/core/src/structures.rs +++ b/core/src/structures.rs @@ -52,7 +52,7 @@ impl InputTexture { bytemuck::cast_slice(&image.rgba), ImageDataLayout { offset: 0, - bytes_per_row: std::num::NonZeroU32::new(4 * width), + bytes_per_row: Some(4 * width), rows_per_image: None, }, texture_size, @@ -206,8 +206,8 @@ impl InputTexture { buffer: &buffer, layout: wgpu::ImageDataLayout { offset: 0, - bytes_per_row: std::num::NonZeroU32::new(padded_bytes_per_row as u32), - rows_per_image: std::num::NonZeroU32::new(height), + bytes_per_row: Some(padded_bytes_per_row as u32), + rows_per_image: None, }, }, wgpu::Extent3d { @@ -424,8 +424,8 @@ impl OutputTexture { buffer: &buffer, layout: wgpu::ImageDataLayout { offset: 0, - bytes_per_row: std::num::NonZeroU32::new(padded_bytes_per_row as u32), - rows_per_image: std::num::NonZeroU32::new(height), + bytes_per_row: Some(padded_bytes_per_row as u32), + rows_per_image: None, }, }, self.texture_size, diff --git a/preprocessor/Cargo.toml b/preprocessor/Cargo.toml index bfa4a3c..7eb9006 100644 --- a/preprocessor/Cargo.toml +++ b/preprocessor/Cargo.toml @@ -13,7 +13,7 @@ description = "A shader preprocessor, to replace #includes in shaders by appropr regex = "1.7" pathdiff = "0.2" anyhow = "1.0" -naga = { version = "0.11", optional = true, features = ["validate", "wgsl-in"] } +naga = { version = "0.13", optional = true, features = ["validate", "wgsl-in"] } codespan-reporting = { version = "0.11", optional = true } [features] diff --git a/preprocessor/src/validate.rs b/preprocessor/src/validate.rs index 1441cbd..11eeabc 100644 --- a/preprocessor/src/validate.rs +++ b/preprocessor/src/validate.rs @@ -39,7 +39,10 @@ pub fn validate_shaders(shaders: &[PathBuf]) -> anyhow::Result<()> { match naga::valid::Validator::new(validation_flags, validation_caps).validate(&module) { Ok(_) => println!("Shader {filename} is valid"), - Err(e) => emit_annotated_error(&e, filename, &shader), + Err(e) => { + eprintln!("Shader {filename} invalid"); + emit_annotated_error(&e, filename, &shader); + } } } }