diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in index 4afa6ecfab32..b2c79cceb4f2 100644 --- a/.cargo/config.toml.in +++ b/.cargo/config.toml.in @@ -25,9 +25,9 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=3fda684eb9e69c78b16312a3e927e3ea82e853d1"] +[source."git+https://github.com/gfx-rs/wgpu?rev=ee0d1703e5f4a267ce9b87d50b824190b45b5a79"] git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" replace-with = "vendored-sources" [source."git+https://github.com/hsivonen/any_all_workaround?rev=7fb1b7034c9f172aade21ee1c8554e8d8a48af80"] diff --git a/Cargo.lock b/Cargo.lock index 1cc4a883de15..444f05834ec2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4216,7 +4216,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "22.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3fda684eb9e69c78b16312a3e927e3ea82e853d1#3fda684eb9e69c78b16312a3e927e3ea82e853d1" +source = "git+https://github.com/gfx-rs/wgpu?rev=ee0d1703e5f4a267ce9b87d50b824190b45b5a79#ee0d1703e5f4a267ce9b87d50b824190b45b5a79" dependencies = [ "arrayvec", "bit-set", @@ -6078,18 +6078,18 @@ checksum = "aac81b6fd6beb5884b0cf3321b8117e6e5d47ecb6fc89f414cfdcca8b2fe2dd8" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -6410,9 +6410,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "uniffi" @@ -7013,7 +7013,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "22.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3fda684eb9e69c78b16312a3e927e3ea82e853d1#3fda684eb9e69c78b16312a3e927e3ea82e853d1" +source = "git+https://github.com/gfx-rs/wgpu?rev=ee0d1703e5f4a267ce9b87d50b824190b45b5a79#ee0d1703e5f4a267ce9b87d50b824190b45b5a79" dependencies = [ "arrayvec", "bit-vec", @@ -7038,7 +7038,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "22.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3fda684eb9e69c78b16312a3e927e3ea82e853d1#3fda684eb9e69c78b16312a3e927e3ea82e853d1" +source = "git+https://github.com/gfx-rs/wgpu?rev=ee0d1703e5f4a267ce9b87d50b824190b45b5a79#ee0d1703e5f4a267ce9b87d50b824190b45b5a79" dependencies = [ "android_system_properties", "arrayvec", @@ -7077,7 +7077,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "22.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3fda684eb9e69c78b16312a3e927e3ea82e853d1#3fda684eb9e69c78b16312a3e927e3ea82e853d1" +source = "git+https://github.com/gfx-rs/wgpu?rev=ee0d1703e5f4a267ce9b87d50b824190b45b5a79#ee0d1703e5f4a267ce9b87d50b824190b45b5a79" dependencies = [ "bitflags 2.6.0", "js-sys", diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml index 2f151392fa4f..8f0c084fd9dc 100644 --- a/gfx/wgpu_bindings/Cargo.toml +++ b/gfx/wgpu_bindings/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" # TODO: remove the replay feature on the next update containing https://github.com/gfx-rs/wgpu/pull/5182 features = ["serde", "replay", "trace", "strict_asserts", "wgsl", "api_log_info"] @@ -26,32 +26,32 @@ features = ["serde", "replay", "trace", "strict_asserts", "wgsl", "api_log_info" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" features = ["metal"] # We want the wgpu-core Direct3D backends on Windows. [target.'cfg(windows)'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" features = ["dx12"] # We want the wgpu-core Vulkan backend on Linux and Windows. [target.'cfg(any(windows, all(unix, not(any(target_os = "macos", target_os = "ios")))))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "3fda684eb9e69c78b16312a3e927e3ea82e853d1" +rev = "ee0d1703e5f4a267ce9b87d50b824190b45b5a79" features = ["oom_panic", "device_lost_panic", "internal_error_panic"] [target.'cfg(windows)'.dependencies] diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml index 187c4248a173..374e2bd544b8 100644 --- a/gfx/wgpu_bindings/moz.yaml +++ b/gfx/wgpu_bindings/moz.yaml @@ -20,11 +20,11 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: 3fda684eb9e69c78b16312a3e927e3ea82e853d1 (2024-09-18T15:01:51Z). + release: ee0d1703e5f4a267ce9b87d50b824190b45b5a79 (Fri Oct 4 13:21:59 2024 -0400). # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: 3fda684eb9e69c78b16312a3e927e3ea82e853d1 + revision: ee0d1703e5f4a267ce9b87d50b824190b45b5a79 license: ['MIT', 'Apache-2.0'] diff --git a/gfx/wgpu_bindings/src/client.rs b/gfx/wgpu_bindings/src/client.rs index 438996e09e45..1e50afbd324e 100644 --- a/gfx/wgpu_bindings/src/client.rs +++ b/gfx/wgpu_bindings/src/client.rs @@ -10,8 +10,8 @@ use crate::{ use crate::SwapChainId; -use wgc::{id, identity::IdentityManager}; -use wgt::TextureFormat; +use wgc::{command::RenderBundleEncoder, id, identity::IdentityManager}; +use wgt::{BufferAddress, BufferSize, DynamicOffset, IndexFormat, TextureFormat}; use wgc::id::markers; @@ -1287,3 +1287,146 @@ pub extern "C" fn wgpu_client_use_external_texture_in_swapChain( supported } + +#[no_mangle] +pub unsafe extern "C" fn wgpu_render_bundle_set_bind_group( + bundle: &mut RenderBundleEncoder, + index: u32, + bind_group_id: Option, + offsets: *const DynamicOffset, + offset_length: usize, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_set_bind_group( + bundle, + index, + bind_group_id, + offsets, + offset_length, + ) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_set_pipeline( + bundle: &mut RenderBundleEncoder, + pipeline_id: id::RenderPipelineId, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_set_pipeline(bundle, pipeline_id) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_set_vertex_buffer( + bundle: &mut RenderBundleEncoder, + slot: u32, + buffer_id: id::BufferId, + offset: BufferAddress, + size: Option, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_set_vertex_buffer( + bundle, slot, buffer_id, offset, size, + ) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_set_index_buffer( + encoder: &mut RenderBundleEncoder, + buffer: id::BufferId, + index_format: IndexFormat, + offset: BufferAddress, + size: Option, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_set_index_buffer( + encoder, + buffer, + index_format, + offset, + size, + ) +} + +#[no_mangle] +pub unsafe extern "C" fn wgpu_render_bundle_set_push_constants( + pass: &mut RenderBundleEncoder, + stages: wgt::ShaderStages, + offset: u32, + size_bytes: u32, + data: *const u8, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_set_push_constants( + pass, stages, offset, size_bytes, data, + ) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_draw( + bundle: &mut RenderBundleEncoder, + vertex_count: u32, + instance_count: u32, + first_vertex: u32, + first_instance: u32, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_draw( + bundle, + vertex_count, + instance_count, + first_vertex, + first_instance, + ) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_draw_indexed( + bundle: &mut RenderBundleEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + base_vertex: i32, + first_instance: u32, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_draw_indexed( + bundle, + index_count, + instance_count, + first_index, + base_vertex, + first_instance, + ) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_draw_indirect( + bundle: &mut RenderBundleEncoder, + buffer_id: id::BufferId, + offset: BufferAddress, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_draw_indirect(bundle, buffer_id, offset) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_draw_indexed_indirect( + bundle: &mut RenderBundleEncoder, + buffer_id: id::BufferId, + offset: BufferAddress, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_draw_indexed_indirect(bundle, buffer_id, offset) +} + +#[no_mangle] +pub unsafe extern "C" fn wgpu_render_bundle_push_debug_group( + _bundle: &mut RenderBundleEncoder, + _label: RawString, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_push_debug_group(_bundle, _label) +} + +#[no_mangle] +pub extern "C" fn wgpu_render_bundle_pop_debug_group(_bundle: &mut RenderBundleEncoder) { + wgc::command::bundle_ffi::wgpu_render_bundle_pop_debug_group(_bundle) +} + +#[no_mangle] +pub unsafe extern "C" fn wgpu_render_bundle_insert_debug_marker( + _bundle: &mut RenderBundleEncoder, + _label: RawString, +) { + wgc::command::bundle_ffi::wgpu_render_bundle_insert_debug_marker(_bundle, _label) +} diff --git a/gfx/wgpu_bindings/src/server.rs b/gfx/wgpu_bindings/src/server.rs index c266b0b2a70e..fe211ec553b4 100644 --- a/gfx/wgpu_bindings/src/server.rs +++ b/gfx/wgpu_bindings/src/server.rs @@ -1302,7 +1302,7 @@ pub unsafe extern "C" fn wgpu_server_queue_submit( let result = global.queue_submit(self_id, command_buffers); match result { - Err(err) => { + Err((_index, err)) => { error_buf.init(err); return 0; } diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 6756dcdb8843..e1e4dff506db 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3237,12 +3237,12 @@ delta = "0.20.0 -> 22.0.0" [[audits.naga]] who = [ - "Jim Blandy ", "Teodor Tanasoaia ", "Erich Gubler ", + "Jim Blandy ", ] criteria = "safe-to-deploy" -delta = "22.0.0 -> 22.0.0@git:3fda684eb9e69c78b16312a3e927e3ea82e853d1" +delta = "22.0.0 -> 22.0.0@git:ee0d1703e5f4a267ce9b87d50b824190b45b5a79" importable = false [[audits.net2]] @@ -4848,6 +4848,11 @@ who = "Teodor Tanasoaia " criteria = "safe-to-deploy" delta = "0.2.4 -> 0.2.5" +[[audits.unicode-xid]] +who = "Jim Blandy " +criteria = "safe-to-deploy" +delta = "0.2.5 -> 0.2.6" + [[audits.uniffi]] who = "Travis Long " criteria = "safe-to-deploy" @@ -5275,12 +5280,12 @@ delta = "0.20.0 -> 22.0.0" [[audits.wgpu-core]] who = [ - "Jim Blandy ", "Teodor Tanasoaia ", "Erich Gubler ", + "Jim Blandy ", ] criteria = "safe-to-deploy" -delta = "22.0.0 -> 22.0.0@git:3fda684eb9e69c78b16312a3e927e3ea82e853d1" +delta = "22.0.0 -> 22.0.0@git:ee0d1703e5f4a267ce9b87d50b824190b45b5a79" importable = false [[audits.wgpu-hal]] @@ -5348,12 +5353,12 @@ delta = "0.20.0 -> 22.0.0" [[audits.wgpu-hal]] who = [ - "Jim Blandy ", "Teodor Tanasoaia ", "Erich Gubler ", + "Jim Blandy ", ] criteria = "safe-to-deploy" -delta = "22.0.0 -> 22.0.0@git:3fda684eb9e69c78b16312a3e927e3ea82e853d1" +delta = "22.0.0 -> 22.0.0@git:ee0d1703e5f4a267ce9b87d50b824190b45b5a79" importable = false [[audits.wgpu-types]] @@ -5421,12 +5426,12 @@ delta = "0.20.0 -> 22.0.0" [[audits.wgpu-types]] who = [ - "Jim Blandy ", "Teodor Tanasoaia ", "Erich Gubler ", + "Jim Blandy ", ] criteria = "safe-to-deploy" -delta = "22.0.0 -> 22.0.0@git:3fda684eb9e69c78b16312a3e927e3ea82e853d1" +delta = "22.0.0 -> 22.0.0@git:ee0d1703e5f4a267ce9b87d50b824190b45b5a79" importable = false [[audits.whatsys]] diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 4d8c422a627c..c4721004c59f 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -687,15 +687,15 @@ user-login = "BurntSushi" user-name = "Andrew Gallant" [[publisher.thiserror]] -version = "1.0.63" -when = "2024-07-17" +version = "1.0.64" +when = "2024-09-22" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.thiserror-impl]] -version = "1.0.63" -when = "2024-07-17" +version = "1.0.64" +when = "2024-09-22" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/compat/api/validation/render_pipeline/unsupported_wgsl/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/compat/api/validation/render_pipeline/unsupported_wgsl/cts.https.html.ini index 924664ac6a64..3141d8bfce00 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/compat/api/validation/render_pipeline/unsupported_wgsl/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/compat/api/validation/render_pipeline/unsupported_wgsl/cts.https.html.ini @@ -183,24 +183,30 @@ [cts.https.html?q=webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:unsupportedStorageTextureFormats,computePipeline:*] [:format="rg32float";entryPoint="csWithStorageUsage";async=false] + expected: FAIL [:format="rg32float";entryPoint="csWithStorageUsage";async=true] + expected: FAIL [:format="rg32float";entryPoint="csWithoutStorageUsage";async=false] [:format="rg32float";entryPoint="csWithoutStorageUsage";async=true] [:format="rg32sint";entryPoint="csWithStorageUsage";async=false] + expected: FAIL [:format="rg32sint";entryPoint="csWithStorageUsage";async=true] + expected: FAIL [:format="rg32sint";entryPoint="csWithoutStorageUsage";async=false] [:format="rg32sint";entryPoint="csWithoutStorageUsage";async=true] [:format="rg32uint";entryPoint="csWithStorageUsage";async=false] + expected: FAIL [:format="rg32uint";entryPoint="csWithStorageUsage";async=true] + expected: FAIL [:format="rg32uint";entryPoint="csWithoutStorageUsage";async=false] diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json index e7b827a0c2f1..280d2c6eddc0 100644 --- a/third_party/rust/naga/.cargo-checksum.json +++ b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"fcace5fd54cbe1d42881e5d0148725a456c607d88534ee35bf07279a86d49c04","Cargo.toml":"2d3875e32bc7f5ed91ff206c6cb2f37e60cd0fefa3ae313af82af34db732c8a4","README.md":"00a6070ebadb15a9488f117b286f50e4838a7dd0a28d41c9fcff4781c6b49171","build.rs":"824e90067aa04ad8726a49476b1af51f5c5c16f9a0b372f00398b3748d723662","src/arena/handle.rs":"1bf2edcca03d7cb466e1f8bd4bf1c966b805505ea2ee3641c39aa04811413478","src/arena/handle_set.rs":"f84ca7edafc907e282abea094c0c9b1da1cf4500e0c6389bb3ce2ef655f4c4ea","src/arena/handlevec.rs":"dfc9249478eb6980c13587c740d91234214bc7e0eef90e6f40b3d99decf70a58","src/arena/mod.rs":"14db142163133eb9ca582bc3665450f49cc4b1cfbda043b8b1518590cdda73be","src/arena/range.rs":"88683c36b137499ab537cf906505c2bd0871e0b9177e3a4e55da9db4e86df6a2","src/arena/unique_arena.rs":"22761770dbcbb6ac497ebdcf07173b3f07fc3c74bc0a70990d5fad882f4f471f","src/back/continue_forward.rs":"f95b810164db51fde368362624ce2569826b47dc3460df316b879abba48e5388","src/back/dot/mod.rs":"b9f57441a9491e4a53b6d9dcb253484f9e935419d179513c2d24db08be591fae","src/back/glsl/features.rs":"df0edf6cec20778846c8e2a914e18854a4efb9ae6b755fa281a975aac0fc12c6","src/back/glsl/keywords.rs":"b8883e5ee8a3d400fa44fef2baffe2853e72ff91e832499c128454d325ceccd9","src/back/glsl/mod.rs":"26e9859fc729929ae6cbf3224a2156a7f336d72d70a80db0d6a9bb940795a687","src/back/hlsl/conv.rs":"ce2f2ce5d2a3df43a5d9b2961f29cc011dc3e737c841f45b465e1e9812437620","src/back/hlsl/help.rs":"de631bd11ee65fbbeeae80733103789abfa6ff54b7b39b11e7c22cd02b486a1c","src/back/hlsl/keywords.rs":"a7164690a4da866e6bfb18ced20e32cc8c42dd7387e0e84addf0c2674f529cf5","src/back/hlsl/mod.rs":"8a88e0925ad62296349851f3f2f60959a63ae466422d1932bde53dd94eab586a","src/back/hlsl/storage.rs":"2c2a0071cafe487a398e396dddc85bdb319b1a5d74c097d529078e247a904359","src/back/hlsl/writer.rs":"0e452c9b40ff38536bb2c8265d5347d52abcda4b6b34f51319007f0e81ebf429","src/back/mod.rs":"59a3fd1215829497dc6d576fd01618c730987517c36244338ff7bb2a60eb663b","src/back/msl/keywords.rs":"e6a4ef77363f995de1f8079c0b8591497cbf9520c5d3b2d41c7e1f483e8abd24","src/back/msl/mod.rs":"6bfb164b854102dfbdf5e43528ff8050ff092eb805a7c3ccb8a2eea40a7509e5","src/back/msl/sampler.rs":"9b01d68669e12ff7123243284b85e1a9d2c4d49140bd74ca32dedc007cbf15af","src/back/msl/writer.rs":"c6095ee1c27a61f8b7b25b72dfd158392edbd1f4beecc08030dea82e236c1246","src/back/pipeline_constants.rs":"0d3353f30d86c89a54504b984997e841d9efe849d7fec7489df8357c9d88ff45","src/back/spv/block.rs":"056e2a11d27c41a1f042f3687b237f01d4a84df4756d62e5b7cc3cf4840f0db5","src/back/spv/helpers.rs":"bd666bf519a5d5561c2fab6ff78229739853ae6877d132911e71b57cfd656e42","src/back/spv/image.rs":"32b8f1ccdd54d80519ccf585451dcc6721d2a6a109d295a704e6c61857832556","src/back/spv/index.rs":"14f704d2d9409bbc9345d601725355048aa74471aaeb6aa781fc45a99ceaec38","src/back/spv/instructions.rs":"253b1fcb2883302734255fbc2d5fcebe3309ccdbb4784f33cf33c7fa66317967","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"27a3afebbf1865d6d538126cb0a558b5f107bb43c88d8b6fa8966c987b199437","src/back/spv/ray.rs":"a34bf6b26d873f7270caa45841d9ef291aca8d9732ecd086b14d8856038e1e41","src/back/spv/recyclable.rs":"8061e39ea5357c8d55081a81fb836e762fd9793c1c6b04ae5d714af32677e616","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/subgroup.rs":"cb68fb9581064ec9ef79e56a0c94c802b2f04cc5e2173a953ae9a7b2776042d5","src/back/spv/writer.rs":"2083ca8946564bd8ac96271febf33491c44bdba6ddb32693b5b30ce3e04a6220","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"f80c2ef520ce506a46bf222010b30d4648a2de71346b61f202fc6e2cc0edac89","src/block.rs":"e447f7e041fd67052b23d1139cf0574eea93220a818af71691d960bdf026d45f","src/compact/expressions.rs":"a04f5dbc936693280fddc328df623af0b8d1fc0d11bd01987df9104e9c27bea1","src/compact/functions.rs":"27c084ca6b475999a3367f8ea429dbf7326a54c83ef86898b7ba67366f9bb828","src/compact/handle_set_map.rs":"748de9563f0ff897c113ba665f3e59ab3a023050e2206eb7d566a31f61fc32e5","src/compact/mod.rs":"7ec6bea36d11438c391c37d9a193b323d7fb365de6b9dfd45e78a3240dbab7ba","src/compact/statements.rs":"360e2bb6c2b7fdf4f9de368048ae574b2efd171adf34be44f84fbe21a15f5def","src/compact/types.rs":"9e73ac7dfdaf4b10eda1c938b881857392abc1315adcc035fc3980d63236cf37","src/error.rs":"70f7adbb59ea38ee7ebc44e8ad020d6db4f2dd4976913fb194e779d115241861","src/front/atomic_upgrade.rs":"98d2e2ea4192faa4d5f4887fef7ae71234de1df32df2f5f4e0761a847dc468c9","src/front/glsl/ast.rs":"663e815ea3e511f0445ef910340c380ff1bcf63805329ab7ca8cf35de7f902ed","src/front/glsl/builtins.rs":"8665ccc33938ae2d43257f25dd3cb75b604d30ccaf98888889b130ca7651695f","src/front/glsl/context.rs":"00c489ca8cb0e200595122ab1c857e2354625a680ff44ac3d7b33eadc4b991cd","src/front/glsl/error.rs":"2ef5061decd42dfc3054fd0f1a86dc7168e2064572571147117d798e39675722","src/front/glsl/functions.rs":"52802412788f95e1a55b92a72980e04792c876fbedff6e6d71f8fe0d23cbae80","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"bf97bf1710d5d1f8facb77913cb82868697920914a96ed309adf0f19154a2ab4","src/front/glsl/offset.rs":"9358602ca4f9ef21d5066d674dae757bf88fdf5c289c4360534354d13bd41dc0","src/front/glsl/parser.rs":"a752f2abac17e6d35c0eb406f2f1c24d2b622a55b1bececbdd13614edb686622","src/front/glsl/parser/declarations.rs":"796514c1d571b324817bf1236d4c1227a91a512c0660ce5bb1264cd900027158","src/front/glsl/parser/expressions.rs":"7fd1ccb9261eaf1f9966798c2fed62c54c2c1d9d140d3e9d41d81775acbe35de","src/front/glsl/parser/functions.rs":"dd5980bd731bcd8044bbfa16f760cdc77c02422ec116d7ebbbe64fcbe1fb7a04","src/front/glsl/parser/types.rs":"0aad1c665058d3babe3c8ddc0ccf9be21c4cf18c807167fd125fb86a6b5f8873","src/front/glsl/parser_tests.rs":"c44ed3252096c83a0ce1ea9be8d2b867784cdc1c11aa4501aee1a85d86c62511","src/front/glsl/token.rs":"c25c489b152ee2d445ace3c2046473abe64d558b8d27fa08709110e58718b6ac","src/front/glsl/types.rs":"91c3a4e4d11b397ea647ff287e17a48baedf2f2c310e81b04618675daeb83f69","src/front/glsl/variables.rs":"6cb3db649a99452bc91f2bbebe425c0447920f7e9a87c38fa84d54c84f48861e","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"ba984fc9b933a844fa8dadf05dea70f308911054ad3f10448d652706e158b4bd","src/front/spv/convert.rs":"8e509c2c277bb93fb2e77309d8880e0026c0f1e2b861f5f9de1e7dd8caa0c013","src/front/spv/error.rs":"103e8ef2fdfc9401f3670028fce43c330a34d95f2e05e24822a1a5eaf4b84afe","src/front/spv/function.rs":"e584dbeaa5f7e1ff107f3e7e5211b0bfb8f7b9878a74dbe29dc7941cb33b2e0f","src/front/spv/image.rs":"a5ac477c01894a9c9ce5ec9d6751f991622d610f5581a759fc2e72034677d9e4","src/front/spv/mod.rs":"39b3da93815aff2b6afc926937879c1644673b12c419181434cd56ee2c1cf4d1","src/front/spv/null.rs":"a8ff44e97ffe42a4773d89b88fdb3a8ef8fba58bf6645c73b7a66470234ccf10","src/front/type_gen.rs":"49d8aae89143a0cba182c5271a2aa60972251c1603144bd21567565ff64b2274","src/front/wgsl/error.rs":"ebe67771da52bce13238fd9f1839243b22e27fbff1064b005638f4d1ebdcf3fe","src/front/wgsl/index.rs":"caf16ac352824d580a5073253ec13a284cb66d6dbe7b9ac08262fc722e31292a","src/front/wgsl/lower/construction.rs":"68ccb994d4e23e6067a47d355609798278fef65e17cc9256264b3ed007c81b03","src/front/wgsl/lower/conversion.rs":"492293f4f3fc7786a3a480ca0f43a10ae5ac8557cf1903cdd616ca624093b951","src/front/wgsl/lower/mod.rs":"d9159a152ae0479a5c78c60d9fa120348709062bcc535a3eb7c8534cf976096d","src/front/wgsl/mod.rs":"cebe3f61843cca32d6764b93b07cb369ae22d1240d81eabe25f5c42dc603fca1","src/front/wgsl/parse/ast.rs":"dc32291b31f1e60dfbb65ead29fcc5c7229ef0ede0eb35c5433788ff8a2d368a","src/front/wgsl/parse/conv.rs":"190dd3c1c0f14f0cd26fca6efc328c893c96eb0300fb332f1aedbfb40b8a8000","src/front/wgsl/parse/lexer.rs":"17db87d0017f8f9a80fa151b8545f04e1b40c4e5feef6197f4a117efa03488bf","src/front/wgsl/parse/mod.rs":"abd5135fd2f2d7f512c3ca2983f3ec4c815a04dd99f3966a068ef2bf145cfc8f","src/front/wgsl/parse/number.rs":"dafd3d8651cfa1389cb359d76d39bd689e54f8d5025aa23e06c6edd871369efd","src/front/wgsl/tests.rs":"7a0a083a5b66af8e7d4b1a02401b27f077eb72d07181b610693f35b11f107c6c","src/front/wgsl/to_wgsl.rs":"84be4fdb54f7d7d6dfcaedd1b48b6e6ee958685d950ec2007567b909cdc79289","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"c648ac44241ad55c8c8bad3d8f1bab973d11ddb9c380dcca369b735ed3975309","src/lib.rs":"70d7a857bd3c254caa5c7b135461d26e6e620a2d948a6fe5cfe337d3ce74ae6e","src/non_max_u32.rs":"3f4aafc8e2775982187507d49e7aa58befffdaba71c9287be42afdfde28bcb66","src/proc/constant_evaluator.rs":"b9d755878765fd7dbe31573ed378b026ac7dfaf4ee5780974f1e44305646c769","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"7c10d3d89ad8c50d063f39ed5b24492e41b6f2d78a7b92138b1ee214a1ea06a2","src/proc/layouter.rs":"e95fd9defa08e0c610d22d7cd795a6af787610d1ff0d4ed27798b4ffd2098cf1","src/proc/mod.rs":"a150a2a251e09b54ce7e6104bd88eaa17e8e06221301a142c7e3770af92f1e07","src/proc/namer.rs":"7328fac41e40890c64c7ee2fa985a4395424f18b08d30f30ca2583fdabd2fd35","src/proc/terminator.rs":"fef2160473fcddd670c6b5806a8ea0ecbdcc0fdf6ed793dce131ecd08cce3944","src/proc/typifier.rs":"0ee6be729fe141399a279a6bc8a6f1f5cb82ee397f4352902ad3b662e2e9a618","src/span.rs":"fd3b338256f9301fc5289c37af9ccec704d2e5db92923b0dec45da371e84ce6a","src/valid/analyzer.rs":"64f0c49988a14e4bf4c9718be69e43d152994756095bb438a3467641c4f4cc1c","src/valid/compose.rs":"83e4c09c39f853cf085b83b87e48b3db571da619132960d3ec954ebdfb0a74f2","src/valid/expression.rs":"50f2fa21d80fd121bc4372dce616e1eeb7507cef29d93273c8c3f86df919b510","src/valid/function.rs":"a624138dc5c4a8d49f68e48fb66e64d14c2da1cd6e8dadfc74bab7a9f63a2f9f","src/valid/handles.rs":"fd9e52370d76b9ff57357c651a951112246ca6c4794b59c021601e9c6b11a0bd","src/valid/interface.rs":"29e5d07743689c3872c0254bbee585a0cc4bd95ea930e66a868de9164ece4709","src/valid/mod.rs":"4130656e5d14c54de38d4f7e7e8cb15ffe60c19ddf93aa976b2fc3e990ddbf45","src/valid/type.rs":"52528d261599f5eb8c61197200b1ffba5dcea6357838edc09f2c51f406af527c"},"package":null} \ No newline at end of file +{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"fcace5fd54cbe1d42881e5d0148725a456c607d88534ee35bf07279a86d49c04","Cargo.toml":"d8b3a8493997b3c754c40ee0a429ce8eefa8f881e7cb6988e479537dfb79d750","README.md":"00a6070ebadb15a9488f117b286f50e4838a7dd0a28d41c9fcff4781c6b49171","build.rs":"824e90067aa04ad8726a49476b1af51f5c5c16f9a0b372f00398b3748d723662","src/arena/handle.rs":"1bf2edcca03d7cb466e1f8bd4bf1c966b805505ea2ee3641c39aa04811413478","src/arena/handle_set.rs":"f84ca7edafc907e282abea094c0c9b1da1cf4500e0c6389bb3ce2ef655f4c4ea","src/arena/handlevec.rs":"dfc9249478eb6980c13587c740d91234214bc7e0eef90e6f40b3d99decf70a58","src/arena/mod.rs":"14db142163133eb9ca582bc3665450f49cc4b1cfbda043b8b1518590cdda73be","src/arena/range.rs":"88683c36b137499ab537cf906505c2bd0871e0b9177e3a4e55da9db4e86df6a2","src/arena/unique_arena.rs":"22761770dbcbb6ac497ebdcf07173b3f07fc3c74bc0a70990d5fad882f4f471f","src/back/continue_forward.rs":"f95b810164db51fde368362624ce2569826b47dc3460df316b879abba48e5388","src/back/dot/mod.rs":"617c3ba398ee2435be2eda459db202e9073423b4c30b34a143356c515cb0f139","src/back/glsl/features.rs":"df0edf6cec20778846c8e2a914e18854a4efb9ae6b755fa281a975aac0fc12c6","src/back/glsl/keywords.rs":"b8883e5ee8a3d400fa44fef2baffe2853e72ff91e832499c128454d325ceccd9","src/back/glsl/mod.rs":"8d398ba4a979567de64cced5414fa182401280014b1ba42cb13acec2ffe544c2","src/back/hlsl/conv.rs":"ce2f2ce5d2a3df43a5d9b2961f29cc011dc3e737c841f45b465e1e9812437620","src/back/hlsl/help.rs":"7dbc4ac84251d4932e6f5e500dfb3c67cc4439e5020fab073a92ba6c9cea6c79","src/back/hlsl/keywords.rs":"a7164690a4da866e6bfb18ced20e32cc8c42dd7387e0e84addf0c2674f529cf5","src/back/hlsl/mod.rs":"8a88e0925ad62296349851f3f2f60959a63ae466422d1932bde53dd94eab586a","src/back/hlsl/storage.rs":"53b35fe30d170c0bcb7ec522ab8a304b52d4539cd2be2f766342d55ed5ec5cf1","src/back/hlsl/writer.rs":"d56b5d59c289dab9b57d16c6b396fee9ce669ea22c00600d7c79a19c22579130","src/back/mod.rs":"59a3fd1215829497dc6d576fd01618c730987517c36244338ff7bb2a60eb663b","src/back/msl/keywords.rs":"e6a4ef77363f995de1f8079c0b8591497cbf9520c5d3b2d41c7e1f483e8abd24","src/back/msl/mod.rs":"998fd44cb4a9baa3cd0d2d548da628501ea459ed981430a09fc3257ab15c42eb","src/back/msl/sampler.rs":"9b01d68669e12ff7123243284b85e1a9d2c4d49140bd74ca32dedc007cbf15af","src/back/msl/writer.rs":"f0bd96bfb7e084566908a2b3fd118518fd6b1abebdd2b108134b0919fa1807d2","src/back/pipeline_constants.rs":"76a5944c5cd548c26daa065f980cf8dd2e72ba3a5b97c267ac4f2c44c6b7e8d1","src/back/spv/block.rs":"9ddb57e052c53cdcb0e59d8c979a7013325ee17f3899b23b8a1743c46b167ac0","src/back/spv/helpers.rs":"0ba90760dd2dbc6ad461454d33d6b4a75a603326e8ba7e3c2538c6360da9b445","src/back/spv/image.rs":"32b8f1ccdd54d80519ccf585451dcc6721d2a6a109d295a704e6c61857832556","src/back/spv/index.rs":"7f32940e8ea618436a57a816096319d0528c68d0c72c282fc6df1f9096a74108","src/back/spv/instructions.rs":"253b1fcb2883302734255fbc2d5fcebe3309ccdbb4784f33cf33c7fa66317967","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"07ff5e3a47c7d5af8eb5cdefd7ea0995679ffaba5e9c5b0d97ca114c84979e2f","src/back/spv/ray.rs":"a34bf6b26d873f7270caa45841d9ef291aca8d9732ecd086b14d8856038e1e41","src/back/spv/recyclable.rs":"8061e39ea5357c8d55081a81fb836e762fd9793c1c6b04ae5d714af32677e616","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/subgroup.rs":"cb68fb9581064ec9ef79e56a0c94c802b2f04cc5e2173a953ae9a7b2776042d5","src/back/spv/writer.rs":"38618a3f5118a17c6fa5a74a910a509702f7adff825b8d3d58368d816abad881","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"5cd60e5d4514543b5c2c2ea8e9f0e971ab7444478b7d01e6ca3c122af6f2b6f2","src/block.rs":"e447f7e041fd67052b23d1139cf0574eea93220a818af71691d960bdf026d45f","src/compact/expressions.rs":"a04f5dbc936693280fddc328df623af0b8d1fc0d11bd01987df9104e9c27bea1","src/compact/functions.rs":"27c084ca6b475999a3367f8ea429dbf7326a54c83ef86898b7ba67366f9bb828","src/compact/handle_set_map.rs":"748de9563f0ff897c113ba665f3e59ab3a023050e2206eb7d566a31f61fc32e5","src/compact/mod.rs":"7ec6bea36d11438c391c37d9a193b323d7fb365de6b9dfd45e78a3240dbab7ba","src/compact/statements.rs":"360e2bb6c2b7fdf4f9de368048ae574b2efd171adf34be44f84fbe21a15f5def","src/compact/types.rs":"9e73ac7dfdaf4b10eda1c938b881857392abc1315adcc035fc3980d63236cf37","src/error.rs":"70f7adbb59ea38ee7ebc44e8ad020d6db4f2dd4976913fb194e779d115241861","src/front/atomic_upgrade.rs":"98d2e2ea4192faa4d5f4887fef7ae71234de1df32df2f5f4e0761a847dc468c9","src/front/glsl/ast.rs":"663e815ea3e511f0445ef910340c380ff1bcf63805329ab7ca8cf35de7f902ed","src/front/glsl/builtins.rs":"8665ccc33938ae2d43257f25dd3cb75b604d30ccaf98888889b130ca7651695f","src/front/glsl/context.rs":"52c1926bc3d913ce2ac9ec0068f684fc85972628e221189dc0fc1bbb38d62f31","src/front/glsl/error.rs":"2ef5061decd42dfc3054fd0f1a86dc7168e2064572571147117d798e39675722","src/front/glsl/functions.rs":"2e7f8619765c723f671836060d215a4a0da6336a5a32979db2f5d023d70bc6e5","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"bf97bf1710d5d1f8facb77913cb82868697920914a96ed309adf0f19154a2ab4","src/front/glsl/offset.rs":"9358602ca4f9ef21d5066d674dae757bf88fdf5c289c4360534354d13bd41dc0","src/front/glsl/parser.rs":"a752f2abac17e6d35c0eb406f2f1c24d2b622a55b1bececbdd13614edb686622","src/front/glsl/parser/declarations.rs":"796514c1d571b324817bf1236d4c1227a91a512c0660ce5bb1264cd900027158","src/front/glsl/parser/expressions.rs":"af9c21b4aacc964d080285d670f6707d60b12d11de2920836f71814d9148aa46","src/front/glsl/parser/functions.rs":"dd5980bd731bcd8044bbfa16f760cdc77c02422ec116d7ebbbe64fcbe1fb7a04","src/front/glsl/parser/types.rs":"0aad1c665058d3babe3c8ddc0ccf9be21c4cf18c807167fd125fb86a6b5f8873","src/front/glsl/parser_tests.rs":"c44ed3252096c83a0ce1ea9be8d2b867784cdc1c11aa4501aee1a85d86c62511","src/front/glsl/token.rs":"c25c489b152ee2d445ace3c2046473abe64d558b8d27fa08709110e58718b6ac","src/front/glsl/types.rs":"91c3a4e4d11b397ea647ff287e17a48baedf2f2c310e81b04618675daeb83f69","src/front/glsl/variables.rs":"43b0390bf53543ce4f7e545cd2c7b00dc5438e3e60ac3f6f31126efd53e00c06","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"ba984fc9b933a844fa8dadf05dea70f308911054ad3f10448d652706e158b4bd","src/front/spv/convert.rs":"8e509c2c277bb93fb2e77309d8880e0026c0f1e2b861f5f9de1e7dd8caa0c013","src/front/spv/error.rs":"6835a4fd90f675a90b39eb2af52c689d0339668d89f2fe5ba9a0afa5b7f0a561","src/front/spv/function.rs":"e584dbeaa5f7e1ff107f3e7e5211b0bfb8f7b9878a74dbe29dc7941cb33b2e0f","src/front/spv/image.rs":"a5ac477c01894a9c9ce5ec9d6751f991622d610f5581a759fc2e72034677d9e4","src/front/spv/mod.rs":"39b3da93815aff2b6afc926937879c1644673b12c419181434cd56ee2c1cf4d1","src/front/spv/null.rs":"a8ff44e97ffe42a4773d89b88fdb3a8ef8fba58bf6645c73b7a66470234ccf10","src/front/type_gen.rs":"49d8aae89143a0cba182c5271a2aa60972251c1603144bd21567565ff64b2274","src/front/wgsl/error.rs":"c4997a30d1ec6649d03b7fb03c8e2481b217f68a31b7b3509be8c82a1ca66e46","src/front/wgsl/index.rs":"caf16ac352824d580a5073253ec13a284cb66d6dbe7b9ac08262fc722e31292a","src/front/wgsl/lower/construction.rs":"68ccb994d4e23e6067a47d355609798278fef65e17cc9256264b3ed007c81b03","src/front/wgsl/lower/conversion.rs":"492293f4f3fc7786a3a480ca0f43a10ae5ac8557cf1903cdd616ca624093b951","src/front/wgsl/lower/mod.rs":"d765164689b63e24e086f472d886f07df86d5d271c2b1476633a27ce2b315b50","src/front/wgsl/mod.rs":"cebe3f61843cca32d6764b93b07cb369ae22d1240d81eabe25f5c42dc603fca1","src/front/wgsl/parse/ast.rs":"adb463f68bc853f9d4d00f2c90fdecb4c5cce4bf6ae7db5a22f95617148296d0","src/front/wgsl/parse/conv.rs":"190dd3c1c0f14f0cd26fca6efc328c893c96eb0300fb332f1aedbfb40b8a8000","src/front/wgsl/parse/lexer.rs":"17db87d0017f8f9a80fa151b8545f04e1b40c4e5feef6197f4a117efa03488bf","src/front/wgsl/parse/mod.rs":"8104dae5d6ed91ebdd375d16d5fbb314aa9eeeec211c8261c4b187bf0ac4996f","src/front/wgsl/parse/number.rs":"dafd3d8651cfa1389cb359d76d39bd689e54f8d5025aa23e06c6edd871369efd","src/front/wgsl/tests.rs":"7a0a083a5b66af8e7d4b1a02401b27f077eb72d07181b610693f35b11f107c6c","src/front/wgsl/to_wgsl.rs":"84be4fdb54f7d7d6dfcaedd1b48b6e6ee958685d950ec2007567b909cdc79289","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"c648ac44241ad55c8c8bad3d8f1bab973d11ddb9c380dcca369b735ed3975309","src/lib.rs":"40c7373fca3f4f3037d5970b2864ba47b901c45cceede7d1fcef984c8566d92a","src/non_max_u32.rs":"3f4aafc8e2775982187507d49e7aa58befffdaba71c9287be42afdfde28bcb66","src/proc/constant_evaluator.rs":"b9d755878765fd7dbe31573ed378b026ac7dfaf4ee5780974f1e44305646c769","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"7c10d3d89ad8c50d063f39ed5b24492e41b6f2d78a7b92138b1ee214a1ea06a2","src/proc/layouter.rs":"e95fd9defa08e0c610d22d7cd795a6af787610d1ff0d4ed27798b4ffd2098cf1","src/proc/mod.rs":"20f10c0d0b47edb73665366e1b7baa2faa954c84feca90c94e6e59e4a0a52fb5","src/proc/namer.rs":"7328fac41e40890c64c7ee2fa985a4395424f18b08d30f30ca2583fdabd2fd35","src/proc/terminator.rs":"fef2160473fcddd670c6b5806a8ea0ecbdcc0fdf6ed793dce131ecd08cce3944","src/proc/typifier.rs":"179acf7c573d52a54582d8b63efd0b7469e5f9c5319af096613f87e2ca4d3fbf","src/span.rs":"183de81c0ae33b79e018b7cbf7056ffb0376b480d83ff7673e81331fa663827c","src/valid/analyzer.rs":"c34cf5bb885a35bad28b6a3e5f732cb4498f7dfd4cb7b10548fc3dd15376de53","src/valid/compose.rs":"83e4c09c39f853cf085b83b87e48b3db571da619132960d3ec954ebdfb0a74f2","src/valid/expression.rs":"17cb620c4c5a94bfa64c7106da4fa4d2dd7d15a966760b4682a1c557a6f5ce3e","src/valid/function.rs":"a624138dc5c4a8d49f68e48fb66e64d14c2da1cd6e8dadfc74bab7a9f63a2f9f","src/valid/handles.rs":"fd9e52370d76b9ff57357c651a951112246ca6c4794b59c021601e9c6b11a0bd","src/valid/interface.rs":"29e5d07743689c3872c0254bbee585a0cc4bd95ea930e66a868de9164ece4709","src/valid/mod.rs":"4130656e5d14c54de38d4f7e7e8cb15ffe60c19ddf93aa976b2fc3e990ddbf45","src/valid/type.rs":"1a7725af90a952e5472cbb0d4b93ad01cee1c20e86985c7c691e5a9665c906bb"},"package":null} \ No newline at end of file diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml index 7bf955150b85..ddddd97169b2 100644 --- a/third_party/rust/naga/Cargo.toml +++ b/third_party/rust/naga/Cargo.toml @@ -96,10 +96,10 @@ optional = true version = "1.4.1" [dependencies.thiserror] -version = "1.0.63" +version = "1.0.64" [dependencies.unicode-xid] -version = "0.2.5" +version = "0.2.6" optional = true [dev-dependencies] diff --git a/third_party/rust/naga/src/back/dot/mod.rs b/third_party/rust/naga/src/back/dot/mod.rs index 4f29ab77655d..278087965794 100644 --- a/third_party/rust/naga/src/back/dot/mod.rs +++ b/third_party/rust/naga/src/back/dot/mod.rs @@ -698,7 +698,7 @@ fn write_function_expressions( E::RayQueryGetIntersection { query, committed } => { edges.insert("", query); let ty = if committed { "Committed" } else { "Candidate" }; - (format!("rayQueryGet{}Intersection", ty).into(), 4) + (format!("rayQueryGet{ty}Intersection").into(), 4) } E::SubgroupBallotResult => ("SubgroupBallotResult".into(), 4), E::SubgroupOperationResult { .. } => ("SubgroupOperationResult".into(), 4), diff --git a/third_party/rust/naga/src/back/glsl/mod.rs b/third_party/rust/naga/src/back/glsl/mod.rs index 159d9cdcf201..2ce9f22f2700 100644 --- a/third_party/rust/naga/src/back/glsl/mod.rs +++ b/third_party/rust/naga/src/back/glsl/mod.rs @@ -2645,15 +2645,15 @@ impl<'a, W: Write> Writer<'a, W> { match literal { // Floats are written using `Debug` instead of `Display` because it always appends the // decimal part even it's zero which is needed for a valid glsl float constant - crate::Literal::F64(value) => write!(self.out, "{:?}LF", value)?, - crate::Literal::F32(value) => write!(self.out, "{:?}", value)?, + crate::Literal::F64(value) => write!(self.out, "{value:?}LF")?, + crate::Literal::F32(value) => write!(self.out, "{value:?}")?, // Unsigned integers need a `u` at the end // // While `core` doesn't necessarily need it, it's allowed and since `es` needs it we // always write it as the extra branch wouldn't have any benefit in readability - crate::Literal::U32(value) => write!(self.out, "{}u", value)?, - crate::Literal::I32(value) => write!(self.out, "{}", value)?, - crate::Literal::Bool(value) => write!(self.out, "{}", value)?, + crate::Literal::U32(value) => write!(self.out, "{value}u")?, + crate::Literal::I32(value) => write!(self.out, "{value}")?, + crate::Literal::Bool(value) => write!(self.out, "{value}")?, crate::Literal::I64(_) => { return Err(Error::Custom("GLSL has no 64-bit integer type".into())); } @@ -4614,7 +4614,7 @@ impl<'a, W: Write> Writer<'a, W> { for i in 0..count.get() { // Add the array accessor and recurse. - segments.push(format!("[{}]", i)); + segments.push(format!("[{i}]")); self.collect_push_constant_items(base, segments, layouter, offset, items); segments.pop(); } diff --git a/third_party/rust/naga/src/back/hlsl/help.rs b/third_party/rust/naga/src/back/hlsl/help.rs index 80f385d01679..9032d22c82a1 100644 --- a/third_party/rust/naga/src/back/hlsl/help.rs +++ b/third_party/rust/naga/src/back/hlsl/help.rs @@ -1046,8 +1046,7 @@ impl<'a, W: Write> super::Writer<'a, W> { } ref other => { return Err(super::Error::Unimplemented(format!( - "Array length of base {:?}", - other + "Array length of base {other:?}" ))) } }; diff --git a/third_party/rust/naga/src/back/hlsl/storage.rs b/third_party/rust/naga/src/back/hlsl/storage.rs index 4d3a6af56d88..9fbdf6769a00 100644 --- a/third_party/rust/naga/src/back/hlsl/storage.rs +++ b/third_party/rust/naga/src/back/hlsl/storage.rs @@ -350,7 +350,7 @@ impl super::Writer<'_, W> { self.write_store_value(module, &value, func_ctx)?; writeln!(self.out, "));")?; } else { - write!(self.out, "{}{}.Store(", level, var_name)?; + write!(self.out, "{level}{var_name}.Store(")?; self.write_storage_address(module, &chain, func_ctx)?; write!(self.out, ", ")?; self.write_store_value(module, &value, func_ctx)?; diff --git a/third_party/rust/naga/src/back/hlsl/writer.rs b/third_party/rust/naga/src/back/hlsl/writer.rs index e33fc79f2082..0eb18f0e160f 100644 --- a/third_party/rust/naga/src/back/hlsl/writer.rs +++ b/third_party/rust/naga/src/back/hlsl/writer.rs @@ -965,7 +965,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { let constant = &module.constants[handle]; self.write_type(module, constant.ty)?; let name = &self.names[&NameKey::Constant(handle)]; - write!(self.out, " {}", name)?; + write!(self.out, " {name}")?; // Write size for array type if let TypeInner::Array { base, size, .. } = module.types[constant.ty].inner { self.write_array_size(module, base, size)?; @@ -2383,11 +2383,11 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { // decimal part even it's zero crate::Literal::F64(value) => write!(self.out, "{value:?}L")?, crate::Literal::F32(value) => write!(self.out, "{value:?}")?, - crate::Literal::U32(value) => write!(self.out, "{}u", value)?, - crate::Literal::I32(value) => write!(self.out, "{}", value)?, - crate::Literal::U64(value) => write!(self.out, "{}uL", value)?, - crate::Literal::I64(value) => write!(self.out, "{}L", value)?, - crate::Literal::Bool(value) => write!(self.out, "{}", value)?, + crate::Literal::U32(value) => write!(self.out, "{value}u")?, + crate::Literal::I32(value) => write!(self.out, "{value}")?, + crate::Literal::U64(value) => write!(self.out, "{value}uL")?, + crate::Literal::I64(value) => write!(self.out, "{value}L")?, + crate::Literal::Bool(value) => write!(self.out, "{value}")?, crate::Literal::AbstractInt(_) | crate::Literal::AbstractFloat(_) => { return Err(Error::Custom( "Abstract types should not appear in IR presented to backends".into(), diff --git a/third_party/rust/naga/src/back/msl/mod.rs b/third_party/rust/naga/src/back/msl/mod.rs index 96dd142a50a7..4bc06469e8f7 100644 --- a/third_party/rust/naga/src/back/msl/mod.rs +++ b/third_party/rust/naga/src/back/msl/mod.rs @@ -437,8 +437,7 @@ impl Options { }) } LocationMode::Uniform => Err(Error::GenericValidation(format!( - "Unexpected Binding::Location({}) for the Uniform mode", - location + "Unexpected Binding::Location({location}) for the Uniform mode" ))), }, } diff --git a/third_party/rust/naga/src/back/msl/writer.rs b/third_party/rust/naga/src/back/msl/writer.rs index a7374915c98d..7ab97f491cda 100644 --- a/third_party/rust/naga/src/back/msl/writer.rs +++ b/third_party/rust/naga/src/back/msl/writer.rs @@ -782,6 +782,9 @@ impl Writer { /// /// To make our output a bit more legible, we pull the condition out into a /// preprocessor macro defined at the top of the module. + /// + /// This approach is also used by Chromium WebGPU's Dawn shader compiler, as of + /// . fn emit_loop_reachable_macro(&mut self) -> BackendResult { if !self.loop_reachable_macro_name.is_empty() { return Ok(()); @@ -3817,12 +3820,11 @@ impl Writer { writeln!(self.out)?; writeln!( self.out, - "{} {defined_func_name}({arg_type_name} arg) {{ + "{struct_name} {defined_func_name}({arg_type_name} arg) {{ {other_type_name} other; {arg_type_name} fract = {NAMESPACE}::{called_func_name}(arg, other); - return {}{{ fract, other }}; -}}", - struct_name, struct_name + return {struct_name}{{ fract, other }}; +}}" )?; } &crate::PredeclaredType::AtomicCompareExchangeWeakResult { .. } => {} diff --git a/third_party/rust/naga/src/back/pipeline_constants.rs b/third_party/rust/naga/src/back/pipeline_constants.rs index 5f82862f72ae..0005cbcb0e27 100644 --- a/third_party/rust/naga/src/back/pipeline_constants.rs +++ b/third_party/rust/naga/src/back/pipeline_constants.rs @@ -14,7 +14,10 @@ use thiserror::Error; pub enum PipelineConstantError { #[error("Missing value for pipeline-overridable constant with identifier string: '{0}'")] MissingValue(String), - #[error("Source f64 value needs to be finite (NaNs and Inifinites are not allowed) for number destinations")] + #[error( + "Source f64 value needs to be finite ({}) for number destinations", + "NaNs and Inifinites are not allowed" + )] SrcNeedsToBeFinite, #[error("Source f64 value doesn't fit in destination")] DstRangeTooSmall, diff --git a/third_party/rust/naga/src/back/spv/block.rs b/third_party/rust/naga/src/back/spv/block.rs index 9fb948586004..c6adba85b127 100644 --- a/third_party/rust/naga/src/back/spv/block.rs +++ b/third_party/rust/naga/src/back/spv/block.rs @@ -4,8 +4,7 @@ Implementations for `BlockContext` methods. use super::{ helpers, index::BoundsCheckResult, make_local, selection::Selection, Block, BlockContext, - Dimension, Error, Instruction, LocalType, LookupType, LoopContext, ResultMember, Writer, - WriterFlags, + Dimension, Error, Instruction, LocalType, LookupType, ResultMember, Writer, WriterFlags, }; use crate::{arena::Handle, proc::TypeResolution, Statement}; use spirv::Word; @@ -39,7 +38,7 @@ enum ExpressionPointer { } /// The termination statement to be added to the end of the block -pub enum BlockExit { +enum BlockExit { /// Generates an OpReturn (void return) Return, /// Generates an OpBranch to the specified block @@ -60,6 +59,36 @@ pub enum BlockExit { }, } +/// What code generation did with a provided [`BlockExit`] value. +/// +/// A function that accepts a [`BlockExit`] argument should return a value of +/// this type, to indicate whether the code it generated ended up using the +/// provided exit, or ignored it and did a non-local exit of some other kind +/// (say, [`Break`] or [`Continue`]). Some callers must use this information to +/// decide whether to generate the target block at all. +/// +/// [`Break`]: Statement::Break +/// [`Continue`]: Statement::Continue +#[must_use] +enum BlockExitDisposition { + /// The generated code used the provided `BlockExit` value. If it included a + /// block label, the caller should be sure to actually emit the block it + /// refers to. + Used, + + /// The generated code did not use the provided `BlockExit` value. If it + /// included a block label, the caller should not bother to actually emit + /// the block it refers to, unless it knows the block is needed for + /// something else. + Discarded, +} + +#[derive(Clone, Copy, Default)] +struct LoopContext { + continuing_id: Option, + break_id: Option, +} + #[derive(Debug)] pub(crate) struct DebugInfoInner<'a> { pub source_code: &'a str, @@ -200,10 +229,7 @@ impl<'w> BlockContext<'w> { fn is_intermediate(&self, expr_handle: Handle) -> bool { match self.ir_function.expressions[expr_handle] { crate::Expression::GlobalVariable(handle) => { - match self.ir_module.global_variables[handle].space { - crate::AddressSpace::Handle => false, - _ => true, - } + self.ir_module.global_variables[handle].space != crate::AddressSpace::Handle } crate::Expression::LocalVariable(_) => true, crate::Expression::FunctionArgument(index) => { @@ -346,6 +372,32 @@ impl<'w> BlockContext<'w> { load_id } + crate::TypeInner::Array { + base: ty_element, .. + } => { + let index_id = self.cached[index]; + let base_id = self.cached[base]; + let base_ty = match self.fun_info[base].ty { + TypeResolution::Handle(handle) => handle, + TypeResolution::Value(_) => { + return Err(Error::Validation( + "Array types should always be in the arena", + )) + } + }; + let (id, variable) = self.writer.promote_access_expression_to_variable( + &self.ir_module.types, + result_type_id, + base_id, + base_ty, + index_id, + ty_element, + block, + )?; + self.function.internal_variables.push(variable); + id + } + // wgpu#4337: Support `crate::TypeInner::Matrix` ref other => { log::error!( "Unable to access base {:?} of type {:?}", @@ -353,7 +405,7 @@ impl<'w> BlockContext<'w> { other ); return Err(Error::Validation( - "only vectors may be dynamically indexed by value", + "only vectors and arrays may be dynamically indexed by value", )); } } @@ -2037,14 +2089,30 @@ impl<'w> BlockContext<'w> { } } - pub(super) fn write_block( + /// Generate one or more SPIR-V blocks for `naga_block`. + /// + /// Use `label_id` as the label for the SPIR-V entry point block. + /// + /// If control reaches the end of the SPIR-V block, terminate it according + /// to `exit`. This function's return value indicates whether it acted on + /// this parameter or not; see [`BlockExitDisposition`]. + /// + /// If the block contains [`Break`] or [`Continue`] statements, + /// `loop_context` supplies the labels of the SPIR-V blocks to jump to. If + /// either of these labels are `None`, then it should have been a Naga + /// validation error for the corresponding statement to occur in this + /// context. + /// + /// [`Break`]: Statement::Break + /// [`Continue`]: Statement::Continue + fn write_block( &mut self, label_id: Word, naga_block: &crate::Block, exit: BlockExit, loop_context: LoopContext, debug_info: Option<&DebugInfoInner>, - ) -> Result<(), Error> { + ) -> Result { let mut block = Block::new(label_id); for (statement, span) in naga_block.span_iter() { if let (Some(debug_info), false) = ( @@ -2080,7 +2148,7 @@ impl<'w> BlockContext<'w> { self.function.consume(block, Instruction::branch(scope_id)); let merge_id = self.gen_id(); - self.write_block( + let merge_used = self.write_block( scope_id, block_statements, BlockExit::Branch { target: merge_id }, @@ -2088,7 +2156,14 @@ impl<'w> BlockContext<'w> { debug_info, )?; - block = Block::new(merge_id); + match merge_used { + BlockExitDisposition::Used => { + block = Block::new(merge_id); + } + BlockExitDisposition::Discarded => { + return Ok(BlockExitDisposition::Discarded); + } + } } Statement::If { condition, @@ -2124,7 +2199,11 @@ impl<'w> BlockContext<'w> { ); if let Some(block_id) = accept_id { - self.write_block( + // We can ignore the `BlockExitDisposition` returned here because, + // even if `merge_id` is not actually reachable, it is always + // referred to by the `OpSelectionMerge` instruction we emitted + // earlier. + let _ = self.write_block( block_id, accept, BlockExit::Branch { target: merge_id }, @@ -2133,7 +2212,11 @@ impl<'w> BlockContext<'w> { )?; } if let Some(block_id) = reject_id { - self.write_block( + // We can ignore the `BlockExitDisposition` returned here because, + // even if `merge_id` is not actually reachable, it is always + // referred to by the `OpSelectionMerge` instruction we emitted + // earlier. + let _ = self.write_block( block_id, reject, BlockExit::Branch { target: merge_id }, @@ -2211,7 +2294,15 @@ impl<'w> BlockContext<'w> { } else { merge_id }; - self.write_block( + // We can ignore the `BlockExitDisposition` returned here because + // `case_finish_id` is always referred to by either: + // + // - the `OpSwitch`, if it's the next case's label for a + // fall-through, or + // + // - the `OpSelectionMerge`, if it's the switch's overall merge + // block because there's no fall-through. + let _ = self.write_block( *label_id, &case.body, BlockExit::Branch { @@ -2257,7 +2348,10 @@ impl<'w> BlockContext<'w> { )); self.function.consume(block, Instruction::branch(body_id)); - self.write_block( + // We can ignore the `BlockExitDisposition` returned here because, + // even if `continuing_id` is not actually reachable, it is always + // referred to by the `OpLoopMerge` instruction we emitted earlier. + let _ = self.write_block( body_id, body, BlockExit::Branch { @@ -2280,7 +2374,10 @@ impl<'w> BlockContext<'w> { }, }; - self.write_block( + // We can ignore the `BlockExitDisposition` returned here because, + // even if `merge_id` is not actually reachable, it is always referred + // to by the `OpLoopMerge` instruction we emitted earlier. + let _ = self.write_block( continuing_id, continuing, exit, @@ -2296,14 +2393,14 @@ impl<'w> BlockContext<'w> { Statement::Break => { self.function .consume(block, Instruction::branch(loop_context.break_id.unwrap())); - return Ok(()); + return Ok(BlockExitDisposition::Discarded); } Statement::Continue => { self.function.consume( block, Instruction::branch(loop_context.continuing_id.unwrap()), ); - return Ok(()); + return Ok(BlockExitDisposition::Discarded); } Statement::Return { value: Some(value) } => { let value_id = self.cached[value]; @@ -2322,15 +2419,15 @@ impl<'w> BlockContext<'w> { None => Instruction::return_value(value_id), }; self.function.consume(block, instruction); - return Ok(()); + return Ok(BlockExitDisposition::Discarded); } Statement::Return { value: None } => { self.function.consume(block, Instruction::return_void()); - return Ok(()); + return Ok(BlockExitDisposition::Discarded); } Statement::Kill => { self.function.consume(block, Instruction::kill()); - return Ok(()); + return Ok(BlockExitDisposition::Discarded); } Statement::Barrier(flags) => { self.writer.write_barrier(flags, &mut block); @@ -2696,6 +2793,24 @@ impl<'w> BlockContext<'w> { }; self.function.consume(block, termination); + Ok(BlockExitDisposition::Used) + } + + pub(super) fn write_function_body( + &mut self, + entry_id: Word, + debug_info: Option<&DebugInfoInner>, + ) -> Result<(), Error> { + // We can ignore the `BlockExitDisposition` returned here because + // `BlockExit::Return` doesn't refer to a block. + let _ = self.write_block( + entry_id, + &self.ir_function.body, + super::block::BlockExit::Return, + LoopContext::default(), + debug_info, + )?; + Ok(()) } } diff --git a/third_party/rust/naga/src/back/spv/helpers.rs b/third_party/rust/naga/src/back/spv/helpers.rs index 1fb447e38448..63144abc028a 100644 --- a/third_party/rust/naga/src/back/spv/helpers.rs +++ b/third_party/rust/naga/src/back/spv/helpers.rs @@ -85,20 +85,9 @@ impl crate::AddressSpace { /// Return true if the global requires a type decorated with `Block`. /// -/// Vulkan spec v1.3 §15.6.2, "Descriptor Set Interface", says: +/// See [`back::spv::GlobalVariable`] for details. /// -/// > Variables identified with the `Uniform` storage class are used to -/// > access transparent buffer backed resources. Such variables must -/// > be: -/// > -/// > - typed as `OpTypeStruct`, or an array of this type, -/// > -/// > - identified with a `Block` or `BufferBlock` decoration, and -/// > -/// > - laid out explicitly using the `Offset`, `ArrayStride`, and -/// > `MatrixStride` decorations as specified in §15.6.4, "Offset -/// > and Stride Assignment." -// See `back::spv::GlobalVariable::access_id` for details. +/// [`back::spv::GlobalVariable`]: super::GlobalVariable pub fn global_needs_wrapper(ir_module: &crate::Module, var: &crate::GlobalVariable) -> bool { match var.space { crate::AddressSpace::Uniform diff --git a/third_party/rust/naga/src/back/spv/index.rs b/third_party/rust/naga/src/back/spv/index.rs index 84b81b63d257..1b7cce997804 100644 --- a/third_party/rust/naga/src/back/spv/index.rs +++ b/third_party/rust/naga/src/back/spv/index.rs @@ -11,16 +11,31 @@ use crate::{arena::Handle, proc::BoundsCheckPolicy}; /// The results of performing a bounds check. /// -/// On success, `write_bounds_check` returns a value of this type. +/// On success, [`write_bounds_check`](BlockContext::write_bounds_check) +/// returns a value of this type. The caller can assume that the right +/// policy has been applied, and simply do what the variant says. pub(super) enum BoundsCheckResult { /// The index is statically known and in bounds, with the given value. KnownInBounds(u32), /// The given instruction computes the index to be used. + /// + /// When [`BoundsCheckPolicy::Restrict`] is in force, this is a + /// clamped version of the index the user supplied. + /// + /// When [`BoundsCheckPolicy::Unchecked`] is in force, this is + /// simply the index the user supplied. This variant indicates + /// that we couldn't prove statically that the index was in + /// bounds; otherwise we would have returned [`KnownInBounds`]. + /// + /// [`KnownInBounds`]: BoundsCheckResult::KnownInBounds Computed(Word), /// The given instruction computes a boolean condition which is true /// if the index is in bounds. + /// + /// This is returned when [`BoundsCheckPolicy::ReadZeroSkipWrite`] + /// is in force. Conditional(Word), } @@ -38,98 +53,163 @@ impl<'w> BlockContext<'w> { /// /// Given `array`, an expression referring a runtime-sized array, return the /// instruction id for the array's length. + /// + /// Runtime-sized arrays may only appear in the values of global + /// variables, which must have one of the following Naga types: + /// + /// 1. A runtime-sized array. + /// 2. A struct whose last member is a runtime-sized array. + /// 3. A binding array of 2. + /// + /// Thus, the expression `array` has the form of: + /// + /// - An optional [`AccessIndex`], for case 2, applied to... + /// - An optional [`Access`] or [`AccessIndex`], for case 3, applied to... + /// - A [`GlobalVariable`]. + /// + /// The generated SPIR-V takes into account wrapped globals; see + /// [`back::spv::GlobalVariable`] for details. + /// + /// [`GlobalVariable`]: crate::Expression::GlobalVariable + /// [`AccessIndex`]: crate::Expression::AccessIndex + /// [`Access`]: crate::Expression::Access + /// [`base`]: crate::Expression::Access::base + /// [`back::spv::GlobalVariable`]: super::GlobalVariable pub(super) fn write_runtime_array_length( &mut self, array: Handle, block: &mut Block, ) -> Result { - // Naga IR permits runtime-sized arrays as global variables, or as the - // final member of a struct that is a global variable, or one of these - // inside a buffer that is itself an element in a buffer bindings array. - // SPIR-V requires that runtime-sized arrays are wrapped in structs. - // See `helpers::global_needs_wrapper` and its uses. - let (opt_array_index_id, global_handle, opt_last_member_index) = match self - .ir_function - .expressions[array] - { + // The index into the binding array, if any. + let binding_array_index_id: Option; + + // The handle to the Naga IR global we're referring to. + let global_handle: Handle; + + // At the Naga type level, if the runtime-sized array is the final member of a + // struct, this is that member's index. + // + // This does not cover wrappers: if this backend wrapped the Naga global's + // type in a synthetic SPIR-V struct (see `global_needs_wrapper`), this is + // `None`. + let opt_last_member_index: Option; + + // Inspect `array` and decide whether we have a binding array and/or an + // enclosing struct. + match self.ir_function.expressions[array] { crate::Expression::AccessIndex { base, index } => { match self.ir_function.expressions[base] { - // The global variable is an array of buffer bindings of structs, - // we are accessing one of them with a static index, - // and the last member of it. crate::Expression::AccessIndex { base: base_outer, index: index_outer, } => match self.ir_function.expressions[base_outer] { + // An `AccessIndex` of an `AccessIndex` must be a + // binding array holding structs whose last members are + // runtime-sized arrays. crate::Expression::GlobalVariable(handle) => { let index_id = self.get_index_constant(index_outer); - (Some(index_id), handle, Some(index)) + binding_array_index_id = Some(index_id); + global_handle = handle; + opt_last_member_index = Some(index); + } + _ => { + return Err(Error::Validation( + "array length expression: AccessIndex(AccessIndex(Global))", + )) } - _ => return Err(Error::Validation("array length expression case-1a")), }, - // The global variable is an array of buffer bindings of structs, - // we are accessing one of them with a dynamic index, - // and the last member of it. crate::Expression::Access { base: base_outer, index: index_outer, } => match self.ir_function.expressions[base_outer] { + // Similarly, an `AccessIndex` of an `Access` must be a + // binding array holding structs whose last members are + // runtime-sized arrays. crate::Expression::GlobalVariable(handle) => { let index_id = self.cached[index_outer]; - (Some(index_id), handle, Some(index)) + binding_array_index_id = Some(index_id); + global_handle = handle; + opt_last_member_index = Some(index); + } + _ => { + return Err(Error::Validation( + "array length expression: AccessIndex(Access(Global))", + )) } - _ => return Err(Error::Validation("array length expression case-1b")), }, - // The global variable is a buffer, and we are accessing the last member. crate::Expression::GlobalVariable(handle) => { - let global = &self.ir_module.global_variables[handle]; - match self.ir_module.types[global.ty].inner { - // The global variable is an array of buffer bindings of run-time arrays. - crate::TypeInner::BindingArray { .. } => (Some(index), handle, None), - // The global variable is a struct, and we are accessing the last member - _ => (None, handle, Some(index)), - } + // An outer `AccessIndex` applied directly to a + // `GlobalVariable`. Since binding arrays can only contain + // structs, this must be referring to the last member of a + // struct that is a runtime-sized array. + binding_array_index_id = None; + global_handle = handle; + opt_last_member_index = Some(index); + } + _ => { + return Err(Error::Validation( + "array length expression: AccessIndex()", + )) } - _ => return Err(Error::Validation("array length expression case-1c")), } } - // The global variable is an array of buffer bindings of arrays. - crate::Expression::Access { base, index } => match self.ir_function.expressions[base] { - crate::Expression::GlobalVariable(handle) => { - let index_id = self.cached[index]; - let global = &self.ir_module.global_variables[handle]; - match self.ir_module.types[global.ty].inner { - crate::TypeInner::BindingArray { .. } => (Some(index_id), handle, None), - _ => return Err(Error::Validation("array length expression case-2a")), - } - } - _ => return Err(Error::Validation("array length expression case-2b")), - }, - // The global variable is a run-time array. crate::Expression::GlobalVariable(handle) => { - let global = &self.ir_module.global_variables[handle]; - if !global_needs_wrapper(self.ir_module, global) { - return Err(Error::Validation("array length expression case-3")); - } - (None, handle, None) + // A direct reference to a global variable. This must hold the + // runtime-sized array directly. + binding_array_index_id = None; + global_handle = handle; + opt_last_member_index = None; } _ => return Err(Error::Validation("array length expression case-4")), }; + // The verifier should have checked this, but make sure the inspection above + // agrees with the type about whether a binding array is involved. + // + // Eventually we do want to support `binding_array>`. This check + // ensures that whoever relaxes the validator will get an error message from + // us, not just bogus SPIR-V. + let global = &self.ir_module.global_variables[global_handle]; + match ( + &self.ir_module.types[global.ty].inner, + binding_array_index_id, + ) { + (&crate::TypeInner::BindingArray { .. }, Some(_)) => {} + (_, None) => {} + _ => { + return Err(Error::Validation( + "array length expression: bad binding array inference", + )) + } + } + + // SPIR-V allows runtime-sized arrays to appear only as the last member of a + // struct. Determine this member's index. let gvar = self.writer.global_variables[global_handle].clone(); let global = &self.ir_module.global_variables[global_handle]; - let (last_member_index, gvar_id) = match opt_last_member_index { - Some(index) => (index, gvar.access_id), - None => { - if !global_needs_wrapper(self.ir_module, global) { - return Err(Error::Validation( - "pointer to a global that is not a wrapped array", - )); - } + let needs_wrapper = global_needs_wrapper(self.ir_module, global); + let (last_member_index, gvar_id) = match (opt_last_member_index, needs_wrapper) { + (Some(index), false) => { + // At the Naga type level, the runtime-sized array appears as the + // final member of a struct, whose index is `index`. We didn't need to + // wrap this, since the Naga type meets SPIR-V's requirements already. + (index, gvar.access_id) + } + (None, true) => { + // At the Naga type level, the runtime-sized array does not appear + // within a struct. We wrapped this in an OpTypeStruct with nothing + // else in it, so the index is zero. OpArrayLength wants the pointer + // to the wrapper struct, so use `gvar.var_id`. (0, gvar.var_id) } + _ => { + return Err(Error::Validation( + "array length expression: bad SPIR-V wrapper struct inference", + )); + } }; - let structure_id = match opt_array_index_id { + + let structure_id = match binding_array_index_id { // We are indexing inside a binding array, generate the access op. Some(index_id) => { let element_type_id = match self.ir_module.types[global.ty].inner { @@ -293,6 +373,8 @@ impl<'w> BlockContext<'w> { /// Write an index bounds comparison to `block`, if needed. /// + /// This is used to implement [`BoundsCheckPolicy::ReadZeroSkipWrite`]. + /// /// If we're able to determine statically that `index` is in bounds for /// `sequence`, return `KnownInBounds(value)`, where `value` is the actual /// value of the index. (In principle, one could know that the index is in @@ -413,11 +495,23 @@ impl<'w> BlockContext<'w> { /// Emit code for bounds checks for an array, vector, or matrix access. /// - /// This implements either `index_bounds_check_policy` or - /// `buffer_bounds_check_policy`, depending on the address space of the - /// pointer being accessed. + /// This tries to handle all the critical steps for bounds checks: /// - /// Return a `BoundsCheckResult` indicating how the index should be + /// - First, select the appropriate bounds check policy for `base`, + /// depending on its address space. + /// + /// - Next, analyze `index` to see if its value is known at + /// compile time, in which case we can decide statically whether + /// the index is in bounds. + /// + /// - If the index's value is not known at compile time, emit code to: + /// + /// - restrict its value (for [`BoundsCheckPolicy::Restrict`]), or + /// + /// - check whether it's in bounds (for + /// [`BoundsCheckPolicy::ReadZeroSkipWrite`]). + /// + /// Return a [`BoundsCheckResult`] indicating how the index should be /// consumed. See that type's documentation for details. pub(super) fn write_bounds_check( &mut self, diff --git a/third_party/rust/naga/src/back/spv/mod.rs b/third_party/rust/naga/src/back/spv/mod.rs index 32bd1fcecf49..e6397017c529 100644 --- a/third_party/rust/naga/src/back/spv/mod.rs +++ b/third_party/rust/naga/src/back/spv/mod.rs @@ -144,6 +144,7 @@ struct Function { signature: Option, parameters: Vec, variables: crate::FastHashMap, LocalVariable>, + internal_variables: Vec, blocks: Vec, entry_point_context: Option, } @@ -466,38 +467,75 @@ enum CachedConstant { ZeroValue(Word), } +/// The SPIR-V representation of a [`crate::GlobalVariable`]. +/// +/// In the Vulkan spec 1.3.296, the section [Descriptor Set Interface][dsi] says: +/// +/// > Variables identified with the `Uniform` storage class are used to access +/// > transparent buffer backed resources. Such variables *must* be: +/// > +/// > - typed as `OpTypeStruct`, or an array of this type, +/// > +/// > - identified with a `Block` or `BufferBlock` decoration, and +/// > +/// > - laid out explicitly using the `Offset`, `ArrayStride`, and `MatrixStride` +/// > decorations as specified in "Offset and Stride Assignment". +/// +/// This is followed by identical language for the `StorageBuffer`, +/// except that a `BufferBlock` decoration is not allowed. +/// +/// When we encounter a global variable in the [`Storage`] or [`Uniform`] +/// address spaces whose type is not already [`Struct`], this backend implicitly +/// wraps the global variable in a struct: we generate a SPIR-V global variable +/// holding an `OpTypeStruct` with a single member, whose type is what the Naga +/// global's type would suggest, decorated as required above. +/// +/// The [`helpers::global_needs_wrapper`] function determines whether a given +/// [`crate::GlobalVariable`] needs to be wrapped. +/// +/// [dsi]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-resources-descset +/// [`Storage`]: crate::AddressSpace::Storage +/// [`Uniform`]: crate::AddressSpace::Uniform +/// [`Struct`]: crate::TypeInner::Struct #[derive(Clone)] struct GlobalVariable { - /// ID of the OpVariable that declares the global. + /// The SPIR-V id of the `OpVariable` that declares the global. /// - /// If you need the variable's value, use [`access_id`] instead of this - /// field. If we wrapped the Naga IR `GlobalVariable`'s type in a struct to - /// comply with Vulkan's requirements, then this points to the `OpVariable` - /// with the synthesized struct type, whereas `access_id` points to the - /// field of said struct that holds the variable's actual value. + /// If this global has been implicitly wrapped in an `OpTypeStruct`, this id + /// refers to the wrapper, not the original Naga value it contains. If you + /// need the Naga value, use [`access_id`] instead of this field. + /// + /// If this global is not implicitly wrapped, this is the same as + /// [`access_id`]. /// /// This is used to compute the `access_id` pointer in function prologues, - /// and used for `ArrayLength` expressions, which do need the struct. + /// and used for `ArrayLength` expressions, which need to pass the wrapper + /// struct. /// /// [`access_id`]: GlobalVariable::access_id var_id: Word, - /// For `AddressSpace::Handle` variables, this ID is recorded in the function - /// prelude block (and reset before every function) as `OpLoad` of the variable. - /// It is then used for all the global ops, such as `OpImageSample`. + /// The loaded value of a `AddressSpace::Handle` global variable. + /// + /// If the current function uses this global variable, this is the id of an + /// `OpLoad` instruction in the function's prologue that loads its value. + /// (This value is assigned as we write the prologue code of each function.) + /// It is then used for all operations on the global, such as `OpImageSample`. handle_id: Word, - /// Actual ID used to access this variable. - /// For wrapped buffer variables, this ID is `OpAccessChain` into the - /// wrapper. Otherwise, the same as `var_id`. + /// The SPIR-V id of a pointer to this variable's Naga IR value. /// - /// Vulkan requires that globals in the `StorageBuffer` and `Uniform` storage - /// classes must be structs with the `Block` decoration, but WGSL and Naga IR - /// make no such requirement. So for such variables, we generate a wrapper struct - /// type with a single element of the type given by Naga, generate an - /// `OpAccessChain` for that member in the function prelude, and use that pointer - /// to refer to the global in the function body. This is the id of that access, - /// updated for each function in `write_function`. + /// If the current function uses this global variable, and it has been + /// implicitly wrapped in an `OpTypeStruct`, this is the id of an + /// `OpAccessChain` instruction in the function's prologue that refers to + /// the wrapped value inside the struct. (This value is assigned as we write + /// the prologue code of each function.) If you need the wrapper struct + /// itself, use [`var_id`] instead of this field. + /// + /// If this global is not implicitly wrapped, this is the same as + /// [`var_id`]. + /// + /// [`var_id`]: GlobalVariable::var_id access_id: Word, } @@ -627,12 +665,6 @@ impl BlockContext<'_> { } } -#[derive(Clone, Copy, Default)] -struct LoopContext { - continuing_id: Option, - break_id: Option, -} - pub struct Writer { physical_layout: PhysicalLayout, logical_layout: LogicalLayout, diff --git a/third_party/rust/naga/src/back/spv/writer.rs b/third_party/rust/naga/src/back/spv/writer.rs index 678dcb4246a3..14f1fc0027cd 100644 --- a/third_party/rust/naga/src/back/spv/writer.rs +++ b/third_party/rust/naga/src/back/spv/writer.rs @@ -3,7 +3,7 @@ use super::{ helpers::{contains_builtin, global_needs_wrapper, map_storage_class}, make_local, Block, BlockContext, CachedConstant, CachedExpressions, DebugInfo, EntryPointContext, Error, Function, FunctionArgument, GlobalVariable, IdGenerator, Instruction, - LocalType, LocalVariable, LogicalLayout, LookupFunctionType, LookupType, LoopContext, Options, + LocalType, LocalVariable, LogicalLayout, LookupFunctionType, LookupType, Options, PhysicalLayout, PipelineOptions, ResultMember, Writer, WriterFlags, BITS_PER_BYTE, }; use crate::{ @@ -32,6 +32,9 @@ impl Function { for local_var in self.variables.values() { local_var.instruction.to_words(sink); } + for internal_var in self.internal_variables.iter() { + internal_var.instruction.to_words(sink); + } } for instruction in block.body.iter() { instruction.to_words(sink); @@ -135,6 +138,56 @@ impl Writer { self.capabilities_used.insert(spirv::Capability::Shader); } + #[allow(clippy::too_many_arguments)] + pub(super) fn promote_access_expression_to_variable( + &mut self, + ir_types: &UniqueArena, + result_type_id: Word, + container_id: Word, + container_ty: Handle, + index_id: Word, + element_ty: Handle, + block: &mut Block, + ) -> Result<(Word, LocalVariable), Error> { + let pointer_type_id = + self.get_pointer_id(ir_types, container_ty, spirv::StorageClass::Function)?; + + let variable = { + let id = self.id_gen.next(); + LocalVariable { + id, + instruction: Instruction::variable( + pointer_type_id, + id, + spirv::StorageClass::Function, + None, + ), + } + }; + block + .body + .push(Instruction::store(variable.id, container_id, None)); + + let element_pointer_id = self.id_gen.next(); + let element_pointer_type_id = + self.get_pointer_id(ir_types, element_ty, spirv::StorageClass::Function)?; + block.body.push(Instruction::access_chain( + element_pointer_type_id, + element_pointer_id, + variable.id, + &[index_id], + )); + let id = self.id_gen.next(); + block.body.push(Instruction::load( + result_type_id, + id, + element_pointer_id, + None, + )); + + Ok((id, variable)) + } + /// Indicate that the code requires any one of the listed capabilities. /// /// If nothing in `capabilities` appears in the available capabilities @@ -703,13 +756,7 @@ impl Writer { next_id }; - context.write_block( - main_id, - &ir_function.body, - super::block::BlockExit::Return, - LoopContext::default(), - debug_info.as_ref(), - )?; + context.write_function_body(main_id, debug_info.as_ref())?; // Consume the `BlockContext`, ending its borrows and letting the // `Writer` steal back its cached expression table and temp_list. diff --git a/third_party/rust/naga/src/back/wgsl/writer.rs b/third_party/rust/naga/src/back/wgsl/writer.rs index 0f2635eb0d92..e8b942a62ca1 100644 --- a/third_party/rust/naga/src/back/wgsl/writer.rs +++ b/third_party/rust/naga/src/back/wgsl/writer.rs @@ -1221,31 +1221,31 @@ impl Writer { match expressions[expr] { Expression::Literal(literal) => match literal { - crate::Literal::F32(value) => write!(self.out, "{}f", value)?, - crate::Literal::U32(value) => write!(self.out, "{}u", value)?, + crate::Literal::F32(value) => write!(self.out, "{value}f")?, + crate::Literal::U32(value) => write!(self.out, "{value}u")?, crate::Literal::I32(value) => { // `-2147483648i` is not valid WGSL. The most negative `i32` // value can only be expressed in WGSL using AbstractInt and // a unary negation operator. if value == i32::MIN { - write!(self.out, "i32({})", value)?; + write!(self.out, "i32({value})")?; } else { - write!(self.out, "{}i", value)?; + write!(self.out, "{value}i")?; } } - crate::Literal::Bool(value) => write!(self.out, "{}", value)?, - crate::Literal::F64(value) => write!(self.out, "{:?}lf", value)?, + crate::Literal::Bool(value) => write!(self.out, "{value}")?, + crate::Literal::F64(value) => write!(self.out, "{value:?}lf")?, crate::Literal::I64(value) => { // `-9223372036854775808li` is not valid WGSL. The most negative `i64` // value can only be expressed in WGSL using AbstractInt and // a unary negation operator. if value == i64::MIN { - write!(self.out, "i64({})", value)?; + write!(self.out, "i64({value})")?; } else { - write!(self.out, "{}li", value)?; + write!(self.out, "{value}li")?; } } - crate::Literal::U64(value) => write!(self.out, "{:?}lu", value)?, + crate::Literal::U64(value) => write!(self.out, "{value:?}lu")?, crate::Literal::AbstractInt(_) | crate::Literal::AbstractFloat(_) => { return Err(Error::Custom( "Abstract types should not appear in IR presented to backends".into(), diff --git a/third_party/rust/naga/src/front/glsl/context.rs b/third_party/rust/naga/src/front/glsl/context.rs index ee1fcc04ba18..b4cb1c874e0a 100644 --- a/third_party/rust/naga/src/front/glsl/context.rs +++ b/third_party/rust/naga/src/front/glsl/context.rs @@ -630,7 +630,8 @@ impl<'a> Context<'a> { frontend.errors.push(Error { kind: ErrorKind::SemanticError( format!( - "Cannot apply operation to {left_inner:?} and {right_inner:?}" + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner ) .into(), ), @@ -828,7 +829,8 @@ impl<'a> Context<'a> { frontend.errors.push(Error { kind: ErrorKind::SemanticError( format!( - "Cannot apply operation to {left_inner:?} and {right_inner:?}" + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner ) .into(), ), @@ -908,7 +910,8 @@ impl<'a> Context<'a> { frontend.errors.push(Error { kind: ErrorKind::SemanticError( format!( - "Cannot apply operation to {left_inner:?} and {right_inner:?}" + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner ) .into(), ), diff --git a/third_party/rust/naga/src/front/glsl/functions.rs b/third_party/rust/naga/src/front/glsl/functions.rs index a1a603826392..2a63c7a02866 100644 --- a/third_party/rust/naga/src/front/glsl/functions.rs +++ b/third_party/rust/naga/src/front/glsl/functions.rs @@ -634,7 +634,8 @@ impl Frontend { self.errors.push(Error { kind: ErrorKind::SemanticError( format!( - "'{name}': image needs {overload_access:?} access but only {call_access:?} was provided" + "'{}': image needs {:?} access but only {:?} was provided", + name, overload_access, call_access ) .into(), ), diff --git a/third_party/rust/naga/src/front/glsl/parser/expressions.rs b/third_party/rust/naga/src/front/glsl/parser/expressions.rs index 594ad6a6cdd1..c218e7b115dd 100644 --- a/third_party/rust/naga/src/front/glsl/parser/expressions.rs +++ b/third_party/rust/naga/src/front/glsl/parser/expressions.rs @@ -38,7 +38,13 @@ impl<'source> ParsingContext<'source> { TokenValue::FloatConstant(float) => { if float.width != 32 { frontend.errors.push(Error { - kind: ErrorKind::SemanticError("Unsupported floating-point value (expected single-precision floating-point number)".into()), + kind: ErrorKind::SemanticError( + concat!( + "Unsupported floating-point value ", + "(expected single-precision floating-point number)" + ) + .into(), + ), meta: token.meta, }); } diff --git a/third_party/rust/naga/src/front/glsl/variables.rs b/third_party/rust/naga/src/front/glsl/variables.rs index 6b74b254bd15..16c5bb65d6b6 100644 --- a/third_party/rust/naga/src/front/glsl/variables.rs +++ b/third_party/rust/naga/src/front/glsl/variables.rs @@ -294,14 +294,17 @@ impl Frontend { .any(|i| components[i..].contains(&components[i - 1])); if not_unique { self.errors.push(Error { - kind: - ErrorKind::SemanticError( - format!( - "swizzle cannot have duplicate components in left-hand-side expression for \"{name:?}\"" - ) - .into(), - ), - meta , + kind: ErrorKind::SemanticError( + format!( + concat!( + "swizzle cannot have duplicate components in ", + "left-hand-side expression for \"{:?}\"" + ), + name + ) + .into(), + ), + meta, }) } } diff --git a/third_party/rust/naga/src/front/spv/error.rs b/third_party/rust/naga/src/front/spv/error.rs index bcbb47ddebe1..898113d44692 100644 --- a/third_party/rust/naga/src/front/spv/error.rs +++ b/third_party/rust/naga/src/front/spv/error.rs @@ -47,7 +47,13 @@ pub enum Error { UnsupportedBinaryOperator(spirv::Word), #[error("Naga supports OpTypeRuntimeArray in the StorageBuffer storage class only")] UnsupportedRuntimeArrayStorageClass, - #[error("unsupported matrix stride {stride} for a {columns}x{rows} matrix with scalar width={width}")] + #[error( + "unsupported matrix stride {} for a {}x{} matrix with scalar width={}", + stride, + columns, + rows, + width + )] UnsupportedMatrixStride { stride: u32, columns: u8, @@ -162,6 +168,6 @@ impl Error { impl From for Error { fn from(source: atomic_upgrade::Error) -> Self { - crate::front::spv::Error::AtomicUpgradeError(source) + Error::AtomicUpgradeError(source) } } diff --git a/third_party/rust/naga/src/front/wgsl/error.rs b/third_party/rust/naga/src/front/wgsl/error.rs index 3d4ac621831b..7c65d93de31f 100644 --- a/third_party/rust/naga/src/front/wgsl/error.rs +++ b/third_party/rust/naga/src/front/wgsl/error.rs @@ -298,32 +298,42 @@ impl<'a> Error<'a> { match *self { Error::Unexpected(unexpected_span, expected) => { let expected_str = match expected { - ExpectedToken::Token(token) => { - match token { - Token::Separator(c) => format!("'{c}'"), - Token::Paren(c) => format!("'{c}'"), - Token::Attribute => "@".to_string(), - Token::Number(_) => "number".to_string(), - Token::Word(s) => s.to_string(), - Token::Operation(c) => format!("operation ('{c}')"), - Token::LogicalOperation(c) => format!("logical operation ('{c}')"), - Token::ShiftOperation(c) => format!("bitshift ('{c}{c}')"), - Token::AssignmentOperation(c) if c=='<' || c=='>' => format!("bitshift ('{c}{c}=')"), - Token::AssignmentOperation(c) => format!("operation ('{c}=')"), - Token::IncrementOperation => "increment operation".to_string(), - Token::DecrementOperation => "decrement operation".to_string(), - Token::Arrow => "->".to_string(), - Token::Unknown(c) => format!("unknown ('{c}')"), - Token::Trivia => "trivia".to_string(), - Token::End => "end".to_string(), + ExpectedToken::Token(token) => match token { + Token::Separator(c) => format!("'{c}'"), + Token::Paren(c) => format!("'{c}'"), + Token::Attribute => "@".to_string(), + Token::Number(_) => "number".to_string(), + Token::Word(s) => s.to_string(), + Token::Operation(c) => format!("operation ('{c}')"), + Token::LogicalOperation(c) => format!("logical operation ('{c}')"), + Token::ShiftOperation(c) => format!("bitshift ('{c}{c}')"), + Token::AssignmentOperation(c) if c == '<' || c == '>' => { + format!("bitshift ('{c}{c}=')") } - } + Token::AssignmentOperation(c) => format!("operation ('{c}=')"), + Token::IncrementOperation => "increment operation".to_string(), + Token::DecrementOperation => "decrement operation".to_string(), + Token::Arrow => "->".to_string(), + Token::Unknown(c) => format!("unknown ('{c}')"), + Token::Trivia => "trivia".to_string(), + Token::End => "end".to_string(), + }, ExpectedToken::Identifier => "identifier".to_string(), ExpectedToken::PrimaryExpression => "expression".to_string(), ExpectedToken::Assignment => "assignment or increment/decrement".to_string(), - ExpectedToken::SwitchItem => "switch item ('case' or 'default') or a closing curly bracket to signify the end of the switch statement ('}')".to_string(), - ExpectedToken::WorkgroupSizeSeparator => "workgroup size separator (',') or a closing parenthesis".to_string(), - ExpectedToken::GlobalItem => "global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file".to_string(), + ExpectedToken::SwitchItem => concat!( + "switch item ('case' or 'default') or a closing curly bracket ", + "to signify the end of the switch statement ('}')" + ) + .to_string(), + ExpectedToken::WorkgroupSizeSeparator => { + "workgroup size separator (',') or a closing parenthesis".to_string() + } + ExpectedToken::GlobalItem => concat!( + "global item ('struct', 'const', 'var', 'alias', ';', 'fn') ", + "or the end of the file" + ) + .to_string(), ExpectedToken::Type => "type".to_string(), ExpectedToken::Variable => "variable access".to_string(), ExpectedToken::Function => "function name".to_string(), @@ -384,9 +394,11 @@ impl<'a> Error<'a> { notes: vec![], }, Error::BadIncrDecrReferenceType(span) => ParseError { - message: - "increment/decrement operation requires reference type to be one of i32 or u32" - .to_string(), + message: concat!( + "increment/decrement operation requires ", + "reference type to be one of i32 or u32" + ) + .to_string(), labels: vec![(span, "must be a reference type of i32 or u32".into())], notes: vec![], }, @@ -527,25 +539,24 @@ impl<'a> Error<'a> { labels: vec![(span, "type can't be inferred".into())], notes: vec![], }, - Error::InitializationTypeMismatch { name, ref expected, ref got } => { - ParseError { - message: format!( - "the type of `{}` is expected to be `{}`, but got `{}`", - &source[name], expected, got, - ), - labels: vec![( - name, - format!("definition of `{}`", &source[name]).into(), - )], - notes: vec![], - } - } + Error::InitializationTypeMismatch { + name, + ref expected, + ref got, + } => ParseError { + message: format!( + "the type of `{}` is expected to be `{}`, but got `{}`", + &source[name], expected, got, + ), + labels: vec![(name, format!("definition of `{}`", &source[name]).into())], + notes: vec![], + }, Error::DeclMissingTypeAndInit(name_span) => ParseError { - message: format!("declaration of `{}` needs a type specifier or initializer", &source[name_span]), - labels: vec![( - name_span, - "needs a type specifier or initializer".into(), - )], + message: format!( + "declaration of `{}` needs a type specifier or initializer", + &source[name_span] + ), + labels: vec![(name_span, "needs a type specifier or initializer".into())], notes: vec![], }, Error::MissingAttribute(name, name_span) => ParseError { @@ -725,7 +736,11 @@ impl<'a> Error<'a> { notes: vec![message.into()], }, Error::ExpectedConstExprConcreteIntegerScalar(span) => ParseError { - message: "must be a const-expression that resolves to a concrete integer scalar (u32 or i32)".to_string(), + message: concat!( + "must be a const-expression that ", + "resolves to a concrete integer scalar (u32 or i32)" + ) + .to_string(), labels: vec![(span, "must resolve to u32 or i32".into())], notes: vec![], }, @@ -754,9 +769,17 @@ impl<'a> Error<'a> { }, Error::AutoConversion(ref error) => { // destructuring ensures all fields are handled - let AutoConversionError { dest_span, ref dest_type, source_span, ref source_type } = **error; + let AutoConversionError { + dest_span, + ref dest_type, + source_span, + ref source_type, + } = **error; ParseError { - message: format!("automatic conversions cannot convert `{source_type}` to `{dest_type}`"), + message: format!( + "automatic conversions cannot convert `{}` to `{}`", + source_type, dest_type + ), labels: vec![ ( dest_span, @@ -765,72 +788,77 @@ impl<'a> Error<'a> { ( source_span, format!("this expression has type {source_type}").into(), - ) + ), ], notes: vec![], } - }, + } Error::AutoConversionLeafScalar(ref error) => { - let AutoConversionLeafScalarError { dest_span, ref dest_scalar, source_span, ref source_type } = **error; + let AutoConversionLeafScalarError { + dest_span, + ref dest_scalar, + source_span, + ref source_type, + } = **error; ParseError { - message: format!("automatic conversions cannot convert elements of `{source_type}` to `{dest_scalar}`"), + message: format!( + "automatic conversions cannot convert elements of `{}` to `{}`", + source_type, dest_scalar + ), labels: vec![ ( dest_span, - format!("a value with elements of type {dest_scalar} is required here").into(), + format!( + "a value with elements of type {} is required here", + dest_scalar + ) + .into(), ), ( source_span, format!("this expression has type {source_type}").into(), - ) + ), ], notes: vec![], } - }, + } Error::ConcretizationFailed(ref error) => { - let ConcretizationFailedError { expr_span, ref expr_type, ref scalar, ref inner } = **error; + let ConcretizationFailedError { + expr_span, + ref expr_type, + ref scalar, + ref inner, + } = **error; ParseError { - message: format!("failed to convert expression to a concrete type: {}", inner), - labels: vec![ - ( - expr_span, - format!("this expression has type {}", expr_type).into(), - ) - ], - notes: vec![ - format!("the expression should have been converted to have {} scalar type", scalar), - ] + message: format!("failed to convert expression to a concrete type: {inner}"), + labels: vec![( + expr_span, + format!("this expression has type {expr_type}").into(), + )], + notes: vec![format!( + "the expression should have been converted to have {} scalar type", + scalar + )], } - }, + } Error::ExceededLimitForNestedBraces { span, limit } => ParseError { message: "brace nesting limit reached".into(), labels: vec![(span, "limit reached at this brace".into())], - notes: vec![ - format!("nesting limit is currently set to {limit}"), - ], + notes: vec![format!("nesting limit is currently set to {limit}")], }, Error::PipelineConstantIDValue(span) => ParseError { message: "pipeline constant ID must be between 0 and 65535 inclusive".to_string(), - labels: vec![( - span, - "must be between 0 and 65535 inclusive".into(), - )], + labels: vec![(span, "must be between 0 and 65535 inclusive".into())], notes: vec![], }, Error::NotBool(span) => ParseError { message: "must be a const-expression that resolves to a bool".to_string(), - labels: vec![( - span, - "must resolve to bool".into(), - )], + labels: vec![(span, "must resolve to bool".into())], notes: vec![], }, Error::ConstAssertFailed(span) => ParseError { message: "const_assert failure".to_string(), - labels: vec![( - span, - "evaluates to false".into(), - )], + labels: vec![(span, "evaluates to false".into())], notes: vec![], }, } diff --git a/third_party/rust/naga/src/front/wgsl/lower/mod.rs b/third_party/rust/naga/src/front/wgsl/lower/mod.rs index 7586f98dc3cf..78e81350b436 100644 --- a/third_party/rust/naga/src/front/wgsl/lower/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/lower/mod.rs @@ -1778,12 +1778,14 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { return Ok(()); } - ast::StatementKind::Ignore(expr) => { + ast::StatementKind::Phony(expr) => { let mut emitter = Emitter::default(); emitter.start(&ctx.function.expressions); - let _ = self.expression(expr, &mut ctx.as_expression(block, &mut emitter))?; + let value = self.expression(expr, &mut ctx.as_expression(block, &mut emitter))?; block.extend(emitter.finish(&ctx.function.expressions)); + ctx.named_expressions + .insert(value, ("phony".to_string(), stmt.span)); return Ok(()); } }; diff --git a/third_party/rust/naga/src/front/wgsl/parse/ast.rs b/third_party/rust/naga/src/front/wgsl/parse/ast.rs index c4a798411540..4307ca3d9f8c 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/ast.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/ast.rs @@ -284,7 +284,7 @@ pub enum StatementKind<'a> { }, Increment(Handle>), Decrement(Handle>), - Ignore(Handle>), + Phony(Handle>), ConstAssert(Handle>), } diff --git a/third_party/rust/naga/src/front/wgsl/parse/mod.rs b/third_party/rust/naga/src/front/wgsl/parse/mod.rs index 0157aa3a781a..3b1d60620bf2 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/mod.rs @@ -1696,7 +1696,7 @@ impl Parser { let expr = self.general_expression(lexer, ctx)?; lexer.expect(Token::Separator(';'))?; - ast::StatementKind::Ignore(expr) + ast::StatementKind::Phony(expr) } "let" => { let _ = lexer.next(); diff --git a/third_party/rust/naga/src/lib.rs b/third_party/rust/naga/src/lib.rs index 85fd7a450834..038e215a6ae9 100644 --- a/third_party/rust/naga/src/lib.rs +++ b/third_party/rust/naga/src/lib.rs @@ -1402,21 +1402,20 @@ pub enum Expression { /// ## Dynamic indexing restrictions /// /// To accommodate restrictions in some of the shader languages that Naga - /// targets, it is not permitted to subscript a matrix or array with a - /// dynamically computed index unless that matrix or array appears behind a - /// pointer. In other words, if the inner type of `base` is [`Array`] or - /// [`Matrix`], then `index` must be a constant. But if the type of `base` - /// is a [`Pointer`] to an array or matrix or a [`ValuePointer`] with a - /// `size`, then the index may be any expression of integer type. + /// targets, it is not permitted to subscript a matrix with a dynamically + /// computed index unless that matrix appears behind a pointer. In other + /// words, if the inner type of `base` is [`Matrix`], then `index` must be a + /// constant. But if the type of `base` is a [`Pointer`] to an matrix, then + /// the index may be any expression of integer type. /// /// You can use the [`Expression::is_dynamic_index`] method to determine - /// whether a given index expression requires matrix or array base operands - /// to be behind a pointer. + /// whether a given index expression requires matrix base operands to be + /// behind a pointer. /// /// (It would be simpler to always require the use of `AccessIndex` when - /// subscripting arrays and matrices that are not behind pointers, but to - /// accommodate existing front ends, Naga also permits `Access`, with a - /// restricted `index`.) + /// subscripting matrices that are not behind pointers, but to accommodate + /// existing front ends, Naga also permits `Access`, with a restricted + /// `index`.) /// /// [`Vector`]: TypeInner::Vector /// [`Matrix`]: TypeInner::Matrix diff --git a/third_party/rust/naga/src/proc/mod.rs b/third_party/rust/naga/src/proc/mod.rs index a5b3ea4e381d..abbe0c7e461e 100644 --- a/third_party/rust/naga/src/proc/mod.rs +++ b/third_party/rust/naga/src/proc/mod.rs @@ -521,12 +521,12 @@ impl crate::Expression { } } - /// Return true if this expression is a dynamic array index, for [`Access`]. + /// Return true if this expression is a dynamic array/vector/matrix index, + /// for [`Access`]. /// /// This method returns true if this expression is a dynamically computed - /// index, and as such can only be used to index matrices and arrays when - /// they appear behind a pointer. See the documentation for [`Access`] for - /// details. + /// index, and as such can only be used to index matrices when they appear + /// behind a pointer. See the documentation for [`Access`] for details. /// /// Note, this does not check the _type_ of the given expression. It's up to /// the caller to establish that the `Access` expression is well-typed diff --git a/third_party/rust/naga/src/proc/typifier.rs b/third_party/rust/naga/src/proc/typifier.rs index d8af0cd23662..04c776365f0a 100644 --- a/third_party/rust/naga/src/proc/typifier.rs +++ b/third_party/rust/naga/src/proc/typifier.rs @@ -92,6 +92,13 @@ pub enum TypeResolution { /// available in the associated arena. However, the `TypeInner` itself may /// contain `Handle` values referring to types from the arena. /// + /// The inner type must only be one of the following variants: + /// - TypeInner::Pointer + /// - TypeInner::ValuePointer + /// - TypeInner::Matrix (generated by matrix multiplication) + /// - TypeInner::Vector + /// - TypeInner::Scalar + /// /// [`TypeInner`]: crate::TypeInner Value(crate::TypeInner), } @@ -631,41 +638,37 @@ impl<'a> ResolveContext<'a> { use crate::MathFunction as Mf; let res_arg = past(arg)?; match fun { - // comparison - Mf::Abs | - Mf::Min | - Mf::Max | - Mf::Clamp | - Mf::Saturate | - // trigonometry - Mf::Cos | - Mf::Cosh | - Mf::Sin | - Mf::Sinh | - Mf::Tan | - Mf::Tanh | - Mf::Acos | - Mf::Asin | - Mf::Atan | - Mf::Atan2 | - Mf::Asinh | - Mf::Acosh | - Mf::Atanh | - Mf::Radians | - Mf::Degrees | - // decomposition - Mf::Ceil | - Mf::Floor | - Mf::Round | - Mf::Fract | - Mf::Trunc | - Mf::Ldexp | - // exponent - Mf::Exp | - Mf::Exp2 | - Mf::Log | - Mf::Log2 | - Mf::Pow => res_arg.clone(), + Mf::Abs + | Mf::Min + | Mf::Max + | Mf::Clamp + | Mf::Saturate + | Mf::Cos + | Mf::Cosh + | Mf::Sin + | Mf::Sinh + | Mf::Tan + | Mf::Tanh + | Mf::Acos + | Mf::Asin + | Mf::Atan + | Mf::Atan2 + | Mf::Asinh + | Mf::Acosh + | Mf::Atanh + | Mf::Radians + | Mf::Degrees + | Mf::Ceil + | Mf::Floor + | Mf::Round + | Mf::Fract + | Mf::Trunc + | Mf::Ldexp + | Mf::Exp + | Mf::Exp2 + | Mf::Log + | Mf::Log2 + | Mf::Pow => res_arg.clone(), Mf::Modf | Mf::Frexp => { let (size, width) = match res_arg.inner_with(types) { &Ti::Scalar(crate::Scalar { @@ -673,77 +676,81 @@ impl<'a> ResolveContext<'a> { width, }) => (None, width), &Ti::Vector { - scalar: crate::Scalar { - kind: crate::ScalarKind::Float, - width, - }, + scalar: + crate::Scalar { + kind: crate::ScalarKind::Float, + width, + }, size, } => (Some(size), width), - ref other => - return Err(ResolveError::IncompatibleOperands(format!("{fun:?}({other:?}, _)"))) + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?}, _)" + ))) + } }; let result = self - .special_types - .predeclared_types - .get(&if fun == Mf::Modf { - crate::PredeclaredType::ModfResult { size, width } - } else { - crate::PredeclaredType::FrexpResult { size, width } - }) - .ok_or(ResolveError::MissingSpecialType)?; + .special_types + .predeclared_types + .get(&if fun == Mf::Modf { + crate::PredeclaredType::ModfResult { size, width } + } else { + crate::PredeclaredType::FrexpResult { size, width } + }) + .ok_or(ResolveError::MissingSpecialType)?; TypeResolution::Handle(*result) - }, - // geometry + } Mf::Dot => match *res_arg.inner_with(types) { - Ti::Vector { - size: _, - scalar, - } => TypeResolution::Value(Ti::Scalar(scalar)), - ref other => - return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?}, _)") - )), + Ti::Vector { size: _, scalar } => TypeResolution::Value(Ti::Scalar(scalar)), + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?}, _)" + ))) + } }, Mf::Outer => { - let arg1 = arg1.ok_or_else(|| ResolveError::IncompatibleOperands( - format!("{fun:?}(_, None)") - ))?; + let arg1 = arg1.ok_or_else(|| { + ResolveError::IncompatibleOperands(format!("{fun:?}(_, None)")) + })?; match (res_arg.inner_with(types), past(arg1)?.inner_with(types)) { ( - &Ti::Vector { size: columns, scalar }, - &Ti::Vector{ size: rows, .. } + &Ti::Vector { + size: columns, + scalar, + }, + &Ti::Vector { size: rows, .. }, ) => TypeResolution::Value(Ti::Matrix { columns, rows, scalar, }), - (left, right) => - return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({left:?}, {right:?})") - )), + (left, right) => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({left:?}, {right:?})" + ))) + } + } + } + Mf::Cross => res_arg.clone(), + Mf::Distance | Mf::Length => match *res_arg.inner_with(types) { + Ti::Scalar(scalar) | Ti::Vector { scalar, size: _ } => { + TypeResolution::Value(Ti::Scalar(scalar)) + } + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?})" + ))) } }, - Mf::Cross => res_arg.clone(), - Mf::Distance | - Mf::Length => match *res_arg.inner_with(types) { - Ti::Scalar(scalar) | - Ti::Vector {scalar,size:_} => TypeResolution::Value(Ti::Scalar(scalar)), - ref other => return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?})") - )), - }, - Mf::Normalize | - Mf::FaceForward | - Mf::Reflect | - Mf::Refract => res_arg.clone(), + Mf::Normalize | Mf::FaceForward | Mf::Reflect | Mf::Refract => res_arg.clone(), // computational - Mf::Sign | - Mf::Fma | - Mf::Mix | - Mf::Step | - Mf::SmoothStep | - Mf::Sqrt | - Mf::InverseSqrt => res_arg.clone(), + Mf::Sign + | Mf::Fma + | Mf::Mix + | Mf::Step + | Mf::SmoothStep + | Mf::Sqrt + | Mf::InverseSqrt => res_arg.clone(), Mf::Transpose => match *res_arg.inner_with(types) { Ti::Matrix { columns, @@ -754,9 +761,11 @@ impl<'a> ResolveContext<'a> { rows: columns, scalar, }), - ref other => return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?})") - )), + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?})" + ))) + } }, Mf::Inverse => match *res_arg.inner_with(types) { Ti::Matrix { @@ -768,70 +777,75 @@ impl<'a> ResolveContext<'a> { rows, scalar, }), - ref other => return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?})") - )), + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?})" + ))) + } }, Mf::Determinant => match *res_arg.inner_with(types) { - Ti::Matrix { - scalar, - .. - } => TypeResolution::Value(Ti::Scalar(scalar)), - ref other => return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?})") - )), + Ti::Matrix { scalar, .. } => TypeResolution::Value(Ti::Scalar(scalar)), + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?})" + ))) + } }, // bits - Mf::CountTrailingZeros | - Mf::CountLeadingZeros | - Mf::CountOneBits | - Mf::ReverseBits | - Mf::ExtractBits | - Mf::InsertBits | - Mf::FirstTrailingBit | - Mf::FirstLeadingBit => match *res_arg.inner_with(types) { - Ti::Scalar(scalar @ crate::Scalar { - kind: crate::ScalarKind::Sint | crate::ScalarKind::Uint, - .. - }) => TypeResolution::Value(Ti::Scalar(scalar)), - Ti::Vector { - size, - scalar: scalar @ crate::Scalar { + Mf::CountTrailingZeros + | Mf::CountLeadingZeros + | Mf::CountOneBits + | Mf::ReverseBits + | Mf::ExtractBits + | Mf::InsertBits + | Mf::FirstTrailingBit + | Mf::FirstLeadingBit => match *res_arg.inner_with(types) { + Ti::Scalar( + scalar @ crate::Scalar { kind: crate::ScalarKind::Sint | crate::ScalarKind::Uint, .. - } + }, + ) => TypeResolution::Value(Ti::Scalar(scalar)), + Ti::Vector { + size, + scalar: + scalar @ crate::Scalar { + kind: crate::ScalarKind::Sint | crate::ScalarKind::Uint, + .. + }, } => TypeResolution::Value(Ti::Vector { size, scalar }), - ref other => return Err(ResolveError::IncompatibleOperands( - format!("{fun:?}({other:?})") - )), + ref other => { + return Err(ResolveError::IncompatibleOperands(format!( + "{fun:?}({other:?})" + ))) + } }, // data packing - Mf::Pack4x8snorm | - Mf::Pack4x8unorm | - Mf::Pack2x16snorm | - Mf::Pack2x16unorm | - Mf::Pack2x16float | - Mf::Pack4xI8 | - Mf::Pack4xU8 => TypeResolution::Value(Ti::Scalar(crate::Scalar::U32)), + Mf::Pack4x8snorm + | Mf::Pack4x8unorm + | Mf::Pack2x16snorm + | Mf::Pack2x16unorm + | Mf::Pack2x16float + | Mf::Pack4xI8 + | Mf::Pack4xU8 => TypeResolution::Value(Ti::Scalar(crate::Scalar::U32)), // data unpacking - Mf::Unpack4x8snorm | - Mf::Unpack4x8unorm => TypeResolution::Value(Ti::Vector { + Mf::Unpack4x8snorm | Mf::Unpack4x8unorm => TypeResolution::Value(Ti::Vector { size: crate::VectorSize::Quad, - scalar: crate::Scalar::F32 - }), - Mf::Unpack2x16snorm | - Mf::Unpack2x16unorm | - Mf::Unpack2x16float => TypeResolution::Value(Ti::Vector { - size: crate::VectorSize::Bi, - scalar: crate::Scalar::F32 + scalar: crate::Scalar::F32, }), + Mf::Unpack2x16snorm | Mf::Unpack2x16unorm | Mf::Unpack2x16float => { + TypeResolution::Value(Ti::Vector { + size: crate::VectorSize::Bi, + scalar: crate::Scalar::F32, + }) + } Mf::Unpack4xI8 => TypeResolution::Value(Ti::Vector { size: crate::VectorSize::Quad, - scalar: crate::Scalar::I32 + scalar: crate::Scalar::I32, }), Mf::Unpack4xU8 => TypeResolution::Value(Ti::Vector { size: crate::VectorSize::Quad, - scalar: crate::Scalar::U32 + scalar: crate::Scalar::U32, }), } } diff --git a/third_party/rust/naga/src/span.rs b/third_party/rust/naga/src/span.rs index 82cfbe5a4be8..f8a0f67fbeb5 100644 --- a/third_party/rust/naga/src/span.rs +++ b/third_party/rust/naga/src/span.rs @@ -11,6 +11,7 @@ pub struct Span { impl Span { pub const UNDEFINED: Self = Self { start: 0, end: 0 }; + /// Creates a new `Span` from a range of byte indices /// /// Note: end is exclusive, it doesn't belong to the `Span` diff --git a/third_party/rust/naga/src/valid/analyzer.rs b/third_party/rust/naga/src/valid/analyzer.rs index 89b3da6a4c12..af95fd098f8f 100644 --- a/third_party/rust/naga/src/valid/analyzer.rs +++ b/third_party/rust/naga/src/valid/analyzer.rs @@ -589,23 +589,16 @@ impl FunctionInfo { requirements: UniformityRequirements::empty(), } } - // depends on the builtin or interpolation + // depends on the builtin E::FunctionArgument(index) => { let arg = &resolve_context.arguments[index as usize]; let uniform = match arg.binding { Some(crate::Binding::BuiltIn( - // per-polygon built-ins are uniform - crate::BuiltIn::FrontFacing // per-work-group built-ins are uniform - | crate::BuiltIn::WorkGroupId + crate::BuiltIn::WorkGroupId | crate::BuiltIn::WorkGroupSize - | crate::BuiltIn::NumWorkGroups) - ) => true, - // only flat inputs are uniform - Some(crate::Binding::Location { - interpolation: Some(crate::Interpolation::Flat), - .. - }) => true, + | crate::BuiltIn::NumWorkGroups, + )) => true, _ => false, }; Uniformity { diff --git a/third_party/rust/naga/src/valid/expression.rs b/third_party/rust/naga/src/valid/expression.rs index 0b0d115c572a..2b479d3a737e 100644 --- a/third_party/rust/naga/src/valid/expression.rs +++ b/third_party/rust/naga/src/valid/expression.rs @@ -240,9 +240,10 @@ impl super::Validator { let base_type = &resolver[base]; // See the documentation for `Expression::Access`. let dynamic_indexing_restricted = match *base_type { - Ti::Vector { .. } => false, - Ti::Matrix { .. } | Ti::Array { .. } => true, - Ti::Pointer { .. } + Ti::Matrix { .. } => true, + Ti::Vector { .. } + | Ti::Array { .. } + | Ti::Pointer { .. } | Ti::ValuePointer { size: Some(_), .. } | Ti::BindingArray { .. } => false, ref other => { diff --git a/third_party/rust/naga/src/valid/type.rs b/third_party/rust/naga/src/valid/type.rs index 32d5d58f1c48..c0c25dab79f5 100644 --- a/third_party/rust/naga/src/valid/type.rs +++ b/third_party/rust/naga/src/valid/type.rs @@ -664,9 +664,6 @@ impl super::Validator { ) } Ti::BindingArray { base, size } => { - if base >= handle { - return Err(TypeError::InvalidArrayBaseType(base)); - } let type_info_mask = match size { crate::ArraySize::Constant(_) => TypeFlags::SIZED | TypeFlags::HOST_SHAREABLE, crate::ArraySize::Dynamic => { @@ -680,7 +677,6 @@ impl super::Validator { // Currently Naga only supports binding arrays of structs for non-handle types. match gctx.types[base].inner { crate::TypeInner::Struct { .. } => {} - crate::TypeInner::Array { .. } => {} _ => return Err(TypeError::BindingArrayBaseTypeNotStruct(base)), }; } diff --git a/third_party/rust/thiserror-impl/.cargo-checksum.json b/third_party/rust/thiserror-impl/.cargo-checksum.json index 6a356ee364fd..fc9593bc55ec 100644 --- a/third_party/rust/thiserror-impl/.cargo-checksum.json +++ b/third_party/rust/thiserror-impl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"8f4acbe57979cf65fdca303b08b8ba7bda1d71b73dbdf699b5b765842103fd6c","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"9b6cd6b1553483c99cd7e36aa422d37f4353c99b15da55534d28822f7fa7fd08","src/attr.rs":"d662f37c1a892aac6ab652ba6111335121748df728e49399aff736b654d5dd1c","src/expand.rs":"2736a714372a4b81ac5438783dd2c0f656d624bec5cc4089af96ceecaeee011e","src/fmt.rs":"5d1cefc012403c2d4ff7ab2513c0ec559166df4271d5983a6463939b5ec8c3e1","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"5eea86c771e643328ad9bc3b881cce4bf9d50adae1b33e0d07645bdd9044003d","src/prop.rs":"5ba613e38430831259f20b258f33d57dcb783fbaeeb49e5faffa7b2a7be99e67","src/span.rs":"430460a4fa0d1fa9c627c1ddd575d2b101778fea84217591e1a93a5f6a2a0132","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"} \ No newline at end of file +{"files":{"Cargo.toml":"8abf73f36897db35f75f1efed6733948434c7bbc78e002b2a824f46a289c5b65","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"9b6cd6b1553483c99cd7e36aa422d37f4353c99b15da55534d28822f7fa7fd08","src/attr.rs":"d662f37c1a892aac6ab652ba6111335121748df728e49399aff736b654d5dd1c","src/expand.rs":"50c30146e65a28ac4f6768e5e9d173bde0162b7ad7c5adc39e4eab6e69650371","src/fmt.rs":"5d1cefc012403c2d4ff7ab2513c0ec559166df4271d5983a6463939b5ec8c3e1","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"5eea86c771e643328ad9bc3b881cce4bf9d50adae1b33e0d07645bdd9044003d","src/prop.rs":"5ba613e38430831259f20b258f33d57dcb783fbaeeb49e5faffa7b2a7be99e67","src/span.rs":"430460a4fa0d1fa9c627c1ddd575d2b101778fea84217591e1a93a5f6a2a0132","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"} \ No newline at end of file diff --git a/third_party/rust/thiserror-impl/Cargo.toml b/third_party/rust/thiserror-impl/Cargo.toml index 333924050d88..194cd6f12536 100644 --- a/third_party/rust/thiserror-impl/Cargo.toml +++ b/third_party/rust/thiserror-impl/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" authors = ["David Tolnay "] build = false autobins = false diff --git a/third_party/rust/thiserror-impl/src/expand.rs b/third_party/rust/thiserror-impl/src/expand.rs index 296b567bdccb..403cd07d8c44 100644 --- a/third_party/rust/thiserror-impl/src/expand.rs +++ b/third_party/rust/thiserror-impl/src/expand.rs @@ -36,6 +36,7 @@ fn fallback(input: &DeriveInput, error: syn::Error) -> TokenStream { #error #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics std::error::Error for #ty #ty_generics #where_clause where // Work around trivial bounds being unstable. @@ -44,6 +45,7 @@ fn fallback(input: &DeriveInput, error: syn::Error) -> TokenStream { {} #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause { fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::unreachable!() @@ -178,6 +180,7 @@ fn impl_struct(input: Struct) -> TokenStream { let display_where_clause = display_inferred_bounds.augment_where_clause(input.generics); quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics ::core::fmt::Display for #ty #ty_generics #display_where_clause { #[allow(clippy::used_underscore_binding)] fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { @@ -193,6 +196,7 @@ fn impl_struct(input: Struct) -> TokenStream { let body = from_initializer(from_field, backtrace_field); quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics ::core::convert::From<#from> for #ty #ty_generics #where_clause { #[allow(deprecated)] fn from(source: #from) -> Self { @@ -211,6 +215,7 @@ fn impl_struct(input: Struct) -> TokenStream { quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause { #source_method #provide_method @@ -427,6 +432,7 @@ fn impl_enum(input: Enum) -> TokenStream { let display_where_clause = display_inferred_bounds.augment_where_clause(input.generics); Some(quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics ::core::fmt::Display for #ty #ty_generics #display_where_clause { fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { #use_as_display @@ -449,6 +455,7 @@ fn impl_enum(input: Enum) -> TokenStream { let body = from_initializer(from_field, backtrace_field); Some(quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics ::core::convert::From<#from> for #ty #ty_generics #where_clause { #[allow(deprecated)] fn from(source: #from) -> Self { @@ -467,6 +474,7 @@ fn impl_enum(input: Enum) -> TokenStream { quote! { #[allow(unused_qualifications)] + #[automatically_derived] impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause { #source_method #provide_method diff --git a/third_party/rust/thiserror/.cargo-checksum.json b/third_party/rust/thiserror/.cargo-checksum.json index 923b43e4d9b1..bba8544765ec 100644 --- a/third_party/rust/thiserror/.cargo-checksum.json +++ b/third_party/rust/thiserror/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3cf35724af79fd32f56da3d664d1f9fe4c02c39e74bf66d3bf10280a0caf3d28","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"9949a22eba5b2516c14067076367da47af50fa65357e9f72f99ab6b0b7b47f5b","build.rs":"14f51456047fbf92c32020daea746f15482a0832a752edbbe3e809075d97674b","build/probe.rs":"2e2198c1aa004aabf8b36cc34e057b4dfce56d23401fe0a7582d8480225817f7","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"26f2e9fffd60a24c60c525c2f83bf03803d09b4f6feaafb651ae311eae0dfb7a","src/display.rs":"54735ba3d1d98fd4a4774ec3dc4156c40171371adda996d13ca392aa3ac83f96","src/lib.rs":"fb129197c7665a463f2f2169b1f42c52ff0cf180f591a319cae7c029fdd6887a","src/provide.rs":"8007e22953bacfcc57bb7d12a03fbeb0acece5d2ec889cf55522a4e071d26df3","tests/compiletest.rs":"4e381aa8ca3eabb7ac14d1e0c3700b3223e47640547a6988cfa13ad68255f60f","tests/test_backtrace.rs":"9c54584f46c1a71ab42993e0e24558a636d30c1c9677106e0bedadb70f0a57e9","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"b0ff4dc82850e050b46b3dd7a7d4e268eeedeeae1a5997657c0e658e78636502","tests/test_error.rs":"eba9a2bae06e45365dc9f1be39d00e5cdee57127909c5f4b1f5558fe1dbb60ef","tests/test_expr.rs":"d33f1e79a7ced9fad185a487ba696a79f217c2a61499e4aad2fb3ecdc19e8c44","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"294a95b40c7e921c7b90fdcd430a667a850346bf55ef0864e796d6f345285683","tests/test_lints.rs":"93d66ea5b6b91634ddf18a520b455f8bc65f3e9bbf90874e239f45ab15b0c125","tests/test_option.rs":"e73039a518b41b72bdd1e9c55a098ed82c265d0ef9b090ed20d729764b707697","tests/test_path.rs":"af9c48b51288392953f53868539037e00f70159fc7fdc3fbb45bf631cca4d6ed","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/fallback-impl-with-display.rs":"0b8ce57ba958008f90aaa078fa1066b47b8d4a5146b6a91ec7d8d96122f0637a","tests/ui/fallback-impl-with-display.stderr":"1b3dad712b97598fbee70125471de1a8106eb161d42ce1f790ae07be8c8984ba","tests/ui/from-backtrace-backtrace.rs":"0caac64486c0eb9c076553c0502d468fbc477602a9a2595165a1dcd95524e5ff","tests/ui/from-backtrace-backtrace.stderr":"e24156ae0828878f3282341732b6e032eaa8cb4b4db366a6b5437ed0731d40a7","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/invalid-input-impl-anyway.rs":"6de91f71ddf038dffa3b9da33763a2ec3a5aa0047528e19ba998d5efe3aada5b","tests/ui/invalid-input-impl-anyway.stderr":"fa2725053cd87fc37f87546b377e6e5eed95c45e2a960863303b21a1935fdddb","tests/ui/lifetime.rs":"1da6748767b9a5b25ad7c013becb2e243b39c7c764cbdf00487794f6fc812890","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-display.rs":"c1fd1bc0ec0fb103d7f7b128837f717d49485662839899d570b3c983f1332888","tests/ui/missing-display.stderr":"a8de0f1559da9320ee99ef334937d532d9e9f40a32ed7f8ce56fb465628bff96","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"c145dbdd39e145b5c6f26f8504fbf1e33efa2eada37e09900b39dd62667f22d7","tests/ui/source-enum-not-error.rs":"3add5e7b4503d964bcae0848904822e1473c1d08c5a146c2df5347314ce1b8df","tests/ui/source-enum-not-error.stderr":"aeba0a8a0084833e470b6be2250370809f53c279ad603232af5302b9de9f8cce","tests/ui/source-enum-unnamed-field-not-error.rs":"a98989e908b84a8e6e6dceef02af7bdd1098a444d229950f67ed4f54d55c62e7","tests/ui/source-enum-unnamed-field-not-error.stderr":"4f3d90525dd462e67f633e83b26acec75d9af3626e40d28ded2c2438e0c73192","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"b45eb66f078fec68d44feff1f8d6a676c341e9e9d9acb35daa58ec1ea20f9dae","tests/ui/source-struct-unnamed-field-not-error.rs":"eee605a9aafbb093666393e25cef4f7d7b8e90d518b9fadbdbed9685c66ccfcd","tests/ui/source-struct-unnamed-field-not-error.stderr":"10e408f71c1b61880b1d52739f222ec58a66be70a1df17e44c536fe0f9ffe2a6","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-not-error.rs":"f6315993e68bc71d6d4d39afa4d059695308ef785f92cc0d1df3e9ff55be2a9a","tests/ui/transparent-enum-not-error.stderr":"3a5fe056cd4566f402b03cb591394e0ba85bd74da53df3c8d50bda4a05c2e5ba","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-enum-unnamed-field-not-error.rs":"0c720567e9e0f87921055dfa9f607661725377633445e01a4b5048c7a7a50a85","tests/ui/transparent-enum-unnamed-field-not-error.stderr":"6d84e9a7f4e88daba12931a6c1508be60bb19125d06e44fa2fa205126d953bb1","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-not-error.rs":"fd814d3141c9182b1267b558d9daef8dd6e8b6462e1ad42b197f3a1c0703dce2","tests/ui/transparent-struct-not-error.stderr":"ac7634ea72096d8a5c1a91fd4f1b45ef870130a2698d9ae7c6530cec2f9799d5","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/transparent-struct-unnamed-field-not-error.rs":"fbff5874be44a5dcc347693d7929537256b187dfec467ed72c9968c095228d8d","tests/ui/transparent-struct-unnamed-field-not-error.stderr":"ea99d5422348c2588ad7374360e2a24649f040b9c5614c9308eff958f61960ec","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"} \ No newline at end of file +{"files":{"Cargo.toml":"7552165fbef97e0a219f970f8cdade9455807937e11e4e6b657defc95c3b1ef8","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"9949a22eba5b2516c14067076367da47af50fa65357e9f72f99ab6b0b7b47f5b","build.rs":"14f51456047fbf92c32020daea746f15482a0832a752edbbe3e809075d97674b","build/probe.rs":"2e2198c1aa004aabf8b36cc34e057b4dfce56d23401fe0a7582d8480225817f7","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"26f2e9fffd60a24c60c525c2f83bf03803d09b4f6feaafb651ae311eae0dfb7a","src/display.rs":"54735ba3d1d98fd4a4774ec3dc4156c40171371adda996d13ca392aa3ac83f96","src/lib.rs":"1ae9600d469bf8806c0b63c274f22d1e6e68166b974cc5ea60cc31a0a376d16f","src/provide.rs":"8007e22953bacfcc57bb7d12a03fbeb0acece5d2ec889cf55522a4e071d26df3","tests/compiletest.rs":"4e381aa8ca3eabb7ac14d1e0c3700b3223e47640547a6988cfa13ad68255f60f","tests/test_backtrace.rs":"9c54584f46c1a71ab42993e0e24558a636d30c1c9677106e0bedadb70f0a57e9","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"b0ff4dc82850e050b46b3dd7a7d4e268eeedeeae1a5997657c0e658e78636502","tests/test_error.rs":"eba9a2bae06e45365dc9f1be39d00e5cdee57127909c5f4b1f5558fe1dbb60ef","tests/test_expr.rs":"d33f1e79a7ced9fad185a487ba696a79f217c2a61499e4aad2fb3ecdc19e8c44","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"15011bbeabf47cc116e2b0e9c09f2241b54cd932fa02ea5e74ca4839bb314889","tests/test_lints.rs":"93d66ea5b6b91634ddf18a520b455f8bc65f3e9bbf90874e239f45ab15b0c125","tests/test_option.rs":"e73039a518b41b72bdd1e9c55a098ed82c265d0ef9b090ed20d729764b707697","tests/test_path.rs":"af9c48b51288392953f53868539037e00f70159fc7fdc3fbb45bf631cca4d6ed","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/fallback-impl-with-display.rs":"0b8ce57ba958008f90aaa078fa1066b47b8d4a5146b6a91ec7d8d96122f0637a","tests/ui/fallback-impl-with-display.stderr":"1b3dad712b97598fbee70125471de1a8106eb161d42ce1f790ae07be8c8984ba","tests/ui/from-backtrace-backtrace.rs":"0caac64486c0eb9c076553c0502d468fbc477602a9a2595165a1dcd95524e5ff","tests/ui/from-backtrace-backtrace.stderr":"e24156ae0828878f3282341732b6e032eaa8cb4b4db366a6b5437ed0731d40a7","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/invalid-input-impl-anyway.rs":"6de91f71ddf038dffa3b9da33763a2ec3a5aa0047528e19ba998d5efe3aada5b","tests/ui/invalid-input-impl-anyway.stderr":"fa2725053cd87fc37f87546b377e6e5eed95c45e2a960863303b21a1935fdddb","tests/ui/lifetime.rs":"1da6748767b9a5b25ad7c013becb2e243b39c7c764cbdf00487794f6fc812890","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-display.rs":"c1fd1bc0ec0fb103d7f7b128837f717d49485662839899d570b3c983f1332888","tests/ui/missing-display.stderr":"a8de0f1559da9320ee99ef334937d532d9e9f40a32ed7f8ce56fb465628bff96","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"c145dbdd39e145b5c6f26f8504fbf1e33efa2eada37e09900b39dd62667f22d7","tests/ui/source-enum-not-error.rs":"3add5e7b4503d964bcae0848904822e1473c1d08c5a146c2df5347314ce1b8df","tests/ui/source-enum-not-error.stderr":"aeba0a8a0084833e470b6be2250370809f53c279ad603232af5302b9de9f8cce","tests/ui/source-enum-unnamed-field-not-error.rs":"a98989e908b84a8e6e6dceef02af7bdd1098a444d229950f67ed4f54d55c62e7","tests/ui/source-enum-unnamed-field-not-error.stderr":"4f3d90525dd462e67f633e83b26acec75d9af3626e40d28ded2c2438e0c73192","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"b45eb66f078fec68d44feff1f8d6a676c341e9e9d9acb35daa58ec1ea20f9dae","tests/ui/source-struct-unnamed-field-not-error.rs":"eee605a9aafbb093666393e25cef4f7d7b8e90d518b9fadbdbed9685c66ccfcd","tests/ui/source-struct-unnamed-field-not-error.stderr":"10e408f71c1b61880b1d52739f222ec58a66be70a1df17e44c536fe0f9ffe2a6","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-not-error.rs":"f6315993e68bc71d6d4d39afa4d059695308ef785f92cc0d1df3e9ff55be2a9a","tests/ui/transparent-enum-not-error.stderr":"3a5fe056cd4566f402b03cb591394e0ba85bd74da53df3c8d50bda4a05c2e5ba","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-enum-unnamed-field-not-error.rs":"0c720567e9e0f87921055dfa9f607661725377633445e01a4b5048c7a7a50a85","tests/ui/transparent-enum-unnamed-field-not-error.stderr":"6d84e9a7f4e88daba12931a6c1508be60bb19125d06e44fa2fa205126d953bb1","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-not-error.rs":"fd814d3141c9182b1267b558d9daef8dd6e8b6462e1ad42b197f3a1c0703dce2","tests/ui/transparent-struct-not-error.stderr":"ac7634ea72096d8a5c1a91fd4f1b45ef870130a2698d9ae7c6530cec2f9799d5","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/transparent-struct-unnamed-field-not-error.rs":"fbff5874be44a5dcc347693d7929537256b187dfec467ed72c9968c095228d8d","tests/ui/transparent-struct-unnamed-field-not-error.stderr":"ea99d5422348c2588ad7374360e2a24649f040b9c5614c9308eff958f61960ec","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"} \ No newline at end of file diff --git a/third_party/rust/thiserror/Cargo.toml b/third_party/rust/thiserror/Cargo.toml index c921b994fa35..709f2d360ee6 100644 --- a/third_party/rust/thiserror/Cargo.toml +++ b/third_party/rust/thiserror/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "thiserror" -version = "1.0.63" +version = "1.0.64" authors = ["David Tolnay "] build = "build.rs" autobins = false @@ -93,7 +93,7 @@ name = "test_transparent" path = "tests/test_transparent.rs" [dependencies.thiserror-impl] -version = "=1.0.63" +version = "=1.0.64" [dev-dependencies.anyhow] version = "1.0.73" diff --git a/third_party/rust/thiserror/src/lib.rs b/third_party/rust/thiserror/src/lib.rs index 42dd65b69702..92d3c5dd74d3 100644 --- a/third_party/rust/thiserror/src/lib.rs +++ b/third_party/rust/thiserror/src/lib.rs @@ -258,7 +258,7 @@ //! //! [`anyhow`]: https://github.com/dtolnay/anyhow -#![doc(html_root_url = "https://docs.rs/thiserror/1.0.63")] +#![doc(html_root_url = "https://docs.rs/thiserror/1.0.64")] #![allow( clippy::module_name_repetitions, clippy::needless_lifetimes, diff --git a/third_party/rust/thiserror/tests/test_generics.rs b/third_party/rust/thiserror/tests/test_generics.rs index ac5d6f3bc302..d7790e2dfe30 100644 --- a/third_party/rust/thiserror/tests/test_generics.rs +++ b/third_party/rust/thiserror/tests/test_generics.rs @@ -158,4 +158,4 @@ pub struct StructFromGeneric { // #[derive(Error, Debug)] #[error(transparent)] -pub struct StructTransparentGeneric(E); +pub struct StructTransparentGeneric(pub E); diff --git a/third_party/rust/unicode-xid/.cargo-checksum.json b/third_party/rust/unicode-xid/.cargo-checksum.json index 4afdc89ede79..1c852437d745 100644 --- a/third_party/rust/unicode-xid/.cargo-checksum.json +++ b/third_party/rust/unicode-xid/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"03a1994da0569af5311597c8b43633512303e7fc3e8f93107b5b69478b249155","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"5a4b2a4f0abc2877a7c6a7652b884539ca98bc88ccb2003d42fde89d1b635b93","benches/xid.rs":"a2986ce1df5d93bff51e73dc234bffb341d4fe5d749247296f02396dde16a72b","src/lib.rs":"5ec8dbe7a10106d8798e8469986408ecfb60710e7f6a936e265283753c8d1a94","src/tables.rs":"bb89d0f90360bb871577990f8ae0299b6ac8afcd4205be14b78947660a01455f","src/tests.rs":"56da0662966bb3c69201ae3eb1f69a62b808d604584b7fbdc4f930905301e4c6","tests/exhaustive_tests.rs":"ec91e9124d61e5b3e2fbbbf37a2fd30d6c7a8fa22639d6720b416d9ebc1007c5"},"package":"229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a"} \ No newline at end of file +{"files":{"COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"030ed8e60fcd73b831f174ab2df10e0f913d5d1476909c92aee26849323370f3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"651a08ce6a8967dfd5eaa7de96f527c59d3ca2cac2754b8a5ff7a014b7551700","benches/xid.rs":"a2986ce1df5d93bff51e73dc234bffb341d4fe5d749247296f02396dde16a72b","src/lib.rs":"5ec8dbe7a10106d8798e8469986408ecfb60710e7f6a936e265283753c8d1a94","src/tables.rs":"6a886d9107d42e8dbec81fa7f4acbb6a82adcec4976b56f757551c7a61cf788d","src/tests.rs":"56da0662966bb3c69201ae3eb1f69a62b808d604584b7fbdc4f930905301e4c6","tests/exhaustive_tests.rs":"ec91e9124d61e5b3e2fbbbf37a2fd30d6c7a8fa22639d6720b416d9ebc1007c5"},"package":"ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"} \ No newline at end of file diff --git a/third_party/rust/unicode-xid/Cargo.toml b/third_party/rust/unicode-xid/Cargo.toml index 776f594d571c..3d5fd9140709 100644 --- a/third_party/rust/unicode-xid/Cargo.toml +++ b/third_party/rust/unicode-xid/Cargo.toml @@ -12,7 +12,7 @@ [package] rust-version = "1.17" name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" authors = [ "erick.tryzelaar ", "kwantam ", diff --git a/third_party/rust/unicode-xid/README.md b/third_party/rust/unicode-xid/README.md index d3f2f0ab16cc..5a1f0c829173 100644 --- a/third_party/rust/unicode-xid/README.md +++ b/third_party/rust/unicode-xid/README.md @@ -26,6 +26,10 @@ on std, and instead uses equivalent functions from core. # changelog +## 0.2.6 + +- Update to Unicode 16.0.0. + ## 0.2.5 - Update to Unicode 15.1.0. diff --git a/third_party/rust/unicode-xid/src/tables.rs b/third_party/rust/unicode-xid/src/tables.rs index 76e299db98f1..e5252f84ad13 100644 --- a/third_party/rust/unicode-xid/src/tables.rs +++ b/third_party/rust/unicode-xid/src/tables.rs @@ -14,7 +14,7 @@ /// The version of [Unicode](http://www.unicode.org/) /// that this version of unicode-xid is based on. -pub const UNICODE_VERSION: (u64, u64, u64) = (15, 1, 0); +pub const UNICODE_VERSION: (u64, u64, u64) = (16, 0, 0); fn bsearch_range_table(c: char, r: &[(char, char)]) -> bool { use core::cmp::Ordering::{Equal, Greater, Less}; @@ -91,7 +91,7 @@ pub mod derived_property { ('\u{860}', '\u{86a}'), ('\u{870}', '\u{887}'), ('\u{889}', '\u{88e}'), - ('\u{898}', '\u{8e1}'), + ('\u{897}', '\u{8e1}'), ('\u{8e3}', '\u{963}'), ('\u{966}', '\u{96f}'), ('\u{971}', '\u{983}'), @@ -314,7 +314,7 @@ pub mod derived_property { ('\u{1c00}', '\u{1c37}'), ('\u{1c40}', '\u{1c49}'), ('\u{1c4d}', '\u{1c7d}'), - ('\u{1c80}', '\u{1c88}'), + ('\u{1c80}', '\u{1c8a}'), ('\u{1c90}', '\u{1cba}'), ('\u{1cbd}', '\u{1cbf}'), ('\u{1cd0}', '\u{1cd2}'), @@ -399,10 +399,10 @@ pub mod derived_property { ('\u{a67f}', '\u{a6f1}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', '\u{a788}'), - ('\u{a78b}', '\u{a7ca}'), + ('\u{a78b}', '\u{a7cd}'), ('\u{a7d0}', '\u{a7d1}'), ('\u{a7d3}', '\u{a7d3}'), - ('\u{a7d5}', '\u{a7d9}'), + ('\u{a7d5}', '\u{a7dc}'), ('\u{a7f2}', '\u{a827}'), ('\u{a82c}', '\u{a82c}'), ('\u{a840}', '\u{a873}'), @@ -506,6 +506,7 @@ pub mod derived_property { ('\u{105a3}', '\u{105b1}'), ('\u{105b3}', '\u{105b9}'), ('\u{105bb}', '\u{105bc}'), + ('\u{105c0}', '\u{105f3}'), ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), ('\u{10760}', '\u{10767}'), @@ -546,10 +547,14 @@ pub mod derived_property { ('\u{10cc0}', '\u{10cf2}'), ('\u{10d00}', '\u{10d27}'), ('\u{10d30}', '\u{10d39}'), + ('\u{10d40}', '\u{10d65}'), + ('\u{10d69}', '\u{10d6d}'), + ('\u{10d6f}', '\u{10d85}'), ('\u{10e80}', '\u{10ea9}'), ('\u{10eab}', '\u{10eac}'), ('\u{10eb0}', '\u{10eb1}'), - ('\u{10efd}', '\u{10f1c}'), + ('\u{10ec2}', '\u{10ec4}'), + ('\u{10efc}', '\u{10f1c}'), ('\u{10f27}', '\u{10f27}'), ('\u{10f30}', '\u{10f50}'), ('\u{10f70}', '\u{10f85}'), @@ -595,6 +600,16 @@ pub mod derived_property { ('\u{1135d}', '\u{11363}'), ('\u{11366}', '\u{1136c}'), ('\u{11370}', '\u{11374}'), + ('\u{11380}', '\u{11389}'), + ('\u{1138b}', '\u{1138b}'), + ('\u{1138e}', '\u{1138e}'), + ('\u{11390}', '\u{113b5}'), + ('\u{113b7}', '\u{113c0}'), + ('\u{113c2}', '\u{113c2}'), + ('\u{113c5}', '\u{113c5}'), + ('\u{113c7}', '\u{113ca}'), + ('\u{113cc}', '\u{113d3}'), + ('\u{113e1}', '\u{113e2}'), ('\u{11400}', '\u{1144a}'), ('\u{11450}', '\u{11459}'), ('\u{1145e}', '\u{11461}'), @@ -609,6 +624,7 @@ pub mod derived_property { ('\u{11650}', '\u{11659}'), ('\u{11680}', '\u{116b8}'), ('\u{116c0}', '\u{116c9}'), + ('\u{116d0}', '\u{116e3}'), ('\u{11700}', '\u{1171a}'), ('\u{1171d}', '\u{1172b}'), ('\u{11730}', '\u{11739}'), @@ -632,6 +648,8 @@ pub mod derived_property { ('\u{11a50}', '\u{11a99}'), ('\u{11a9d}', '\u{11a9d}'), ('\u{11ab0}', '\u{11af8}'), + ('\u{11bc0}', '\u{11be0}'), + ('\u{11bf0}', '\u{11bf9}'), ('\u{11c00}', '\u{11c08}'), ('\u{11c0a}', '\u{11c36}'), ('\u{11c38}', '\u{11c40}'), @@ -656,7 +674,7 @@ pub mod derived_property { ('\u{11f00}', '\u{11f10}'), ('\u{11f12}', '\u{11f3a}'), ('\u{11f3e}', '\u{11f42}'), - ('\u{11f50}', '\u{11f59}'), + ('\u{11f50}', '\u{11f5a}'), ('\u{11fb0}', '\u{11fb0}'), ('\u{12000}', '\u{12399}'), ('\u{12400}', '\u{1246e}'), @@ -664,7 +682,9 @@ pub mod derived_property { ('\u{12f90}', '\u{12ff0}'), ('\u{13000}', '\u{1342f}'), ('\u{13440}', '\u{13455}'), + ('\u{13460}', '\u{143fa}'), ('\u{14400}', '\u{14646}'), + ('\u{16100}', '\u{16139}'), ('\u{16800}', '\u{16a38}'), ('\u{16a40}', '\u{16a5e}'), ('\u{16a60}', '\u{16a69}'), @@ -677,6 +697,8 @@ pub mod derived_property { ('\u{16b50}', '\u{16b59}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), + ('\u{16d40}', '\u{16d6c}'), + ('\u{16d70}', '\u{16d79}'), ('\u{16e40}', '\u{16e7f}'), ('\u{16f00}', '\u{16f4a}'), ('\u{16f4f}', '\u{16f87}'), @@ -686,7 +708,7 @@ pub mod derived_property { ('\u{16ff0}', '\u{16ff1}'), ('\u{17000}', '\u{187f7}'), ('\u{18800}', '\u{18cd5}'), - ('\u{18d00}', '\u{18d08}'), + ('\u{18cff}', '\u{18d08}'), ('\u{1aff0}', '\u{1aff3}'), ('\u{1aff5}', '\u{1affb}'), ('\u{1affd}', '\u{1affe}'), @@ -701,6 +723,7 @@ pub mod derived_property { ('\u{1bc80}', '\u{1bc88}'), ('\u{1bc90}', '\u{1bc99}'), ('\u{1bc9d}', '\u{1bc9e}'), + ('\u{1ccf0}', '\u{1ccf9}'), ('\u{1cf00}', '\u{1cf2d}'), ('\u{1cf30}', '\u{1cf46}'), ('\u{1d165}', '\u{1d169}'), @@ -762,6 +785,7 @@ pub mod derived_property { ('\u{1e290}', '\u{1e2ae}'), ('\u{1e2c0}', '\u{1e2f9}'), ('\u{1e4d0}', '\u{1e4f9}'), + ('\u{1e5d0}', '\u{1e5fa}'), ('\u{1e7e0}', '\u{1e7e6}'), ('\u{1e7e8}', '\u{1e7eb}'), ('\u{1e7ed}', '\u{1e7ee}'), @@ -1045,7 +1069,7 @@ pub mod derived_property { ('\u{1c00}', '\u{1c23}'), ('\u{1c4d}', '\u{1c4f}'), ('\u{1c5a}', '\u{1c7d}'), - ('\u{1c80}', '\u{1c88}'), + ('\u{1c80}', '\u{1c8a}'), ('\u{1c90}', '\u{1cba}'), ('\u{1cbd}', '\u{1cbf}'), ('\u{1ce9}', '\u{1cec}'), @@ -1128,10 +1152,10 @@ pub mod derived_property { ('\u{a6a0}', '\u{a6ef}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', '\u{a788}'), - ('\u{a78b}', '\u{a7ca}'), + ('\u{a78b}', '\u{a7cd}'), ('\u{a7d0}', '\u{a7d1}'), ('\u{a7d3}', '\u{a7d3}'), - ('\u{a7d5}', '\u{a7d9}'), + ('\u{a7d5}', '\u{a7dc}'), ('\u{a7f2}', '\u{a801}'), ('\u{a803}', '\u{a805}'), ('\u{a807}', '\u{a80a}'), @@ -1236,6 +1260,7 @@ pub mod derived_property { ('\u{105a3}', '\u{105b1}'), ('\u{105b3}', '\u{105b9}'), ('\u{105bb}', '\u{105bc}'), + ('\u{105c0}', '\u{105f3}'), ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), ('\u{10760}', '\u{10767}'), @@ -1272,8 +1297,11 @@ pub mod derived_property { ('\u{10c80}', '\u{10cb2}'), ('\u{10cc0}', '\u{10cf2}'), ('\u{10d00}', '\u{10d23}'), + ('\u{10d4a}', '\u{10d65}'), + ('\u{10d6f}', '\u{10d85}'), ('\u{10e80}', '\u{10ea9}'), ('\u{10eb0}', '\u{10eb1}'), + ('\u{10ec2}', '\u{10ec4}'), ('\u{10f00}', '\u{10f1c}'), ('\u{10f27}', '\u{10f27}'), ('\u{10f30}', '\u{10f45}'), @@ -1312,6 +1340,13 @@ pub mod derived_property { ('\u{1133d}', '\u{1133d}'), ('\u{11350}', '\u{11350}'), ('\u{1135d}', '\u{11361}'), + ('\u{11380}', '\u{11389}'), + ('\u{1138b}', '\u{1138b}'), + ('\u{1138e}', '\u{1138e}'), + ('\u{11390}', '\u{113b5}'), + ('\u{113b7}', '\u{113b7}'), + ('\u{113d1}', '\u{113d1}'), + ('\u{113d3}', '\u{113d3}'), ('\u{11400}', '\u{11434}'), ('\u{11447}', '\u{1144a}'), ('\u{1145f}', '\u{11461}'), @@ -1346,6 +1381,7 @@ pub mod derived_property { ('\u{11a5c}', '\u{11a89}'), ('\u{11a9d}', '\u{11a9d}'), ('\u{11ab0}', '\u{11af8}'), + ('\u{11bc0}', '\u{11be0}'), ('\u{11c00}', '\u{11c08}'), ('\u{11c0a}', '\u{11c2e}'), ('\u{11c40}', '\u{11c40}'), @@ -1369,7 +1405,9 @@ pub mod derived_property { ('\u{12f90}', '\u{12ff0}'), ('\u{13000}', '\u{1342f}'), ('\u{13441}', '\u{13446}'), + ('\u{13460}', '\u{143fa}'), ('\u{14400}', '\u{14646}'), + ('\u{16100}', '\u{1611d}'), ('\u{16800}', '\u{16a38}'), ('\u{16a40}', '\u{16a5e}'), ('\u{16a70}', '\u{16abe}'), @@ -1378,6 +1416,7 @@ pub mod derived_property { ('\u{16b40}', '\u{16b43}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), + ('\u{16d40}', '\u{16d6c}'), ('\u{16e40}', '\u{16e7f}'), ('\u{16f00}', '\u{16f4a}'), ('\u{16f50}', '\u{16f50}'), @@ -1386,7 +1425,7 @@ pub mod derived_property { ('\u{16fe3}', '\u{16fe3}'), ('\u{17000}', '\u{187f7}'), ('\u{18800}', '\u{18cd5}'), - ('\u{18d00}', '\u{18d08}'), + ('\u{18cff}', '\u{18d08}'), ('\u{1aff0}', '\u{1aff3}'), ('\u{1aff5}', '\u{1affb}'), ('\u{1affd}', '\u{1affe}'), @@ -1439,6 +1478,8 @@ pub mod derived_property { ('\u{1e290}', '\u{1e2ad}'), ('\u{1e2c0}', '\u{1e2eb}'), ('\u{1e4d0}', '\u{1e4eb}'), + ('\u{1e5d0}', '\u{1e5ed}'), + ('\u{1e5f0}', '\u{1e5f0}'), ('\u{1e7e0}', '\u{1e7e6}'), ('\u{1e7e8}', '\u{1e7eb}'), ('\u{1e7ed}', '\u{1e7ee}'), diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json index aa7e5ff7b61b..5d0a6884ff53 100644 --- a/third_party/rust/wgpu-core/.cargo-checksum.json +++ b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"497f60fd2d61c1c7b6a62dba6be9c19cdedcf45cfc6efa92b6e370df5b247611","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","build.rs":"a99478d7f63fb41429e3834f4d0e5cd333f94ba1834c68295f929170e16987de","src/binding_model.rs":"3bb83ac752c61fe14984502d79947604e16d5105aacd8da3ab23ad8ce2c4fada","src/command/allocator.rs":"882d780e5d58b7a60370b58fffd7f35ffd4c087cf2ff2536267fcd57071b5f68","src/command/bind.rs":"e6a50b50daf7d75a51498b37269d9fc2cb0174c7fb91a5292e68bfd531f13e65","src/command/bundle.rs":"32651b8f5507158ed0920e016f0b83fafe3a96fa498ee203879dee200a40eb0f","src/command/clear.rs":"adaa0701e6d9ad3204ccc330246a71f7e4b110da7d186c0c926e92220cc84a70","src/command/compute.rs":"18f06a110c0ce050e70553dfcf82d9878b45d355869172deef3c6080a2d4c14c","src/command/compute_command.rs":"7befc7eb479c150f71510730c16e737bb390cbf5d2d58b0a44327ad4375938e9","src/command/draw.rs":"2f9e1d08f77425baa4680ea8b8e023321f8ac3a986f78299f8cc8bc083353fc1","src/command/memory_init.rs":"fadd17881d35ea5b2918de48ae9d631e16d6c49aba744d334e3edee64c0e839d","src/command/mod.rs":"c007a7f94a9ba94233b6d0721b3c3655a6e6c2cb9192ca20a408a0c3d5af788d","src/command/query.rs":"74ade834ad8098473a1d94259bfd98afb67b3d61cda591f3f5953153155e0717","src/command/render.rs":"2e6e240b8e906eb576504cae5728ed888359d1d5978559bf8fe9bd0b96fdc672","src/command/render_command.rs":"314a05272478511f0b62bdb3aa409284d1c7ce84a8715476feef7d058b782276","src/command/timestamp_writes.rs":"38d3a48ec70043c0cbf4113a8751a3bf267c31c3c8328dcfd9d86bacbc800dc3","src/command/transfer.rs":"0a263c7407a4fa05186bbb03686b6a866500c02b7394e1325ba9ad491ee8a050","src/conv.rs":"9bbcd0660741a808d29788266bbac34af54c58e8db8ed856082f8d2d1dfb792d","src/device/bgl.rs":"1198f47a486d4cad4c03b49c98d690bac039a7b370cc241a5f279c6767e0b010","src/device/global.rs":"cf6fd87d7054e89bc798b451681999f25b3c20626fd4801eed682ce36b9cf83f","src/device/life.rs":"5a6267bb36278c806905919cc016569bc13d1d7ab4afef10366890a32dd0fe79","src/device/mod.rs":"246d418260f2c99986a6ac44843b1926151e81ee717c80b4f3188d7385e9ccd0","src/device/queue.rs":"0196376c80522b96b6c9f9ce25ede7e1bb690e48cba99463d625b40681008bd5","src/device/resource.rs":"39a214b52f56d51a9bee30e1106c2ec79d588de8fac633170b885c8319e38433","src/device/trace.rs":"0e38395e0f41b763975d94d0b538ccbb926a3d784d4bfc78048884789c5b9d09","src/error.rs":"f509aa8a57c04e1aea9ba1b4a1589d007666018cd619db3f822c37082a76b871","src/global.rs":"75a984b96eb64bc2fa4027c6d0730a22761d91fe87882887459e8c58a2154b92","src/hal_api.rs":"29377c036d3eaaa05d83b87644a9a33916824eb51aa2d005704cde97e77925cb","src/hash_utils.rs":"e8d484027c7ce81978e4679a5e20af9416ab7d2fa595f1ca95992b29d625b0ca","src/hub.rs":"adb40e580f58155985f77b43fa56e6fee9be8d9d715c21585c5a3e3a6b726eae","src/id.rs":"f539031cd1ec345c35b08ceae6d9cfbd8878c1362bc9896e8143a4b7cf17dfc9","src/identity.rs":"28917262fa245d81a5c2738513c3376c3a8d9b581fb44e9b2e0bf365b921911f","src/init_tracker/buffer.rs":"85e7c942b0acc1b2f724bb63ca015389c8a9a853198c37108a162326a2b5e70b","src/init_tracker/mod.rs":"039f2c6a98b066f80fd28f1b01f84b5d42e56f92176ac63b22dd572b06e4804d","src/init_tracker/texture.rs":"8e69fa256bf7cf7ce7bcbe28991e12990bf199ddb359b7a2bd40eee950a0fea9","src/instance.rs":"a994257cea33e01e6b7c1e4feb8837472eba57ba7c1b6671725c1913c1ad6fdc","src/lib.rs":"f23f4b83d75846ecbcecd894ca430d01c13b065193cbc74a0261599c0f7cc1ec","src/lock/mod.rs":"c58ae08a8e6108432d9e14e7d8b7bd15af7bb5e98bf700d6bd9a469b80a38b11","src/lock/observing.rs":"50d7c675e64cc89a188c12163e1920e75fe64db1682e843fff778efd751aa037","src/lock/rank.rs":"e6eebdb0fe0bf5e6ef7f8b522b1d83957643d244f84e1523a1e96f8f0a8d8126","src/lock/ranked.rs":"bafe6f295b4cade449cc41491c0dcd1497a6e04c5d902124040ac2056996a44d","src/lock/vanilla.rs":"57581d4671e226438b55f74c4195baa0c4fe1d9f4911a4c026b667c77ab574ff","src/pipeline.rs":"7ccfc915125c6db19f83aa58de1db55032340d72d68cb421dec4b60eeecaf194","src/pipeline_cache.rs":"dbb6b93562a15c9b27acc006545449a6c033280433c1950806243fcfe0850c3e","src/pool.rs":"7899e74874da17c83ec39a88b360de12f564ef4bee2bb1240c37becdaeb57a86","src/present.rs":"162237dce1b9c174171a85ea51066e630997da637c1fba6cde93dfe380ee1277","src/registry.rs":"adf47a507fe23abf6307cb37ea1cf5053294a3263fed477f39481cb7c690b5d7","src/resource.rs":"ec3777dd407935598d46139509c19e6554a3c95c320f142896b223411a5f4f24","src/snatch.rs":"c16e3d21547198b4b7d22a10d115376d2d6f5fa0a62d51ced2dd6a4f934d7ef7","src/storage.rs":"b7a4eabcb90c66668083de94dfea57e491dd42d42558d2960c190c73b330e90a","src/track/buffer.rs":"dc671db7ab4b8378af0e4a0f7dab181d86708922f942e3b01f7fc5d48507c509","src/track/metadata.rs":"44b3a8361780e8c8b2bd8910355e0ce89e2b04d921a97da4b1857a599bd6f5a4","src/track/mod.rs":"7e80349251c0874ed1d50847beee61e193ae706b9161405061e35c26d389c1f2","src/track/range.rs":"2a15794e79b0470d5ba6b3267173a42f34312878e1cb288f198d2854a7888e53","src/track/stateless.rs":"e404d58dbe2644bed4a9fcdc2c01a699322d669aaa4e6619750347519fb56625","src/track/texture.rs":"c5b6f03861907b8ad7dd304af6122b4f102bce6b4fa3e30e1b6f604872fb46fe","src/validation.rs":"6ea396fec9f934aaed00cee98b348e9b569187028fea2bf79f89b70ad8c35442"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"852e023e845c692093e409eab727089642b18e956b2d369bf48d52b7a4b9dbe9","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","build.rs":"a99478d7f63fb41429e3834f4d0e5cd333f94ba1834c68295f929170e16987de","src/binding_model.rs":"b648d7ffd6dae828744a35ae1790334eaa278ea1e2af4dbb362194c074ddcea1","src/command/allocator.rs":"882d780e5d58b7a60370b58fffd7f35ffd4c087cf2ff2536267fcd57071b5f68","src/command/bind.rs":"e6a50b50daf7d75a51498b37269d9fc2cb0174c7fb91a5292e68bfd531f13e65","src/command/bundle.rs":"1652560431ca3509e3e88f185489f75a5184196ca7819c71e436542f4767a6a1","src/command/clear.rs":"adaa0701e6d9ad3204ccc330246a71f7e4b110da7d186c0c926e92220cc84a70","src/command/compute.rs":"65d7d6344efa46283500162998584b9e378e81d76441ad4c4d93e5b03c3afe0e","src/command/compute_command.rs":"7befc7eb479c150f71510730c16e737bb390cbf5d2d58b0a44327ad4375938e9","src/command/draw.rs":"2f9e1d08f77425baa4680ea8b8e023321f8ac3a986f78299f8cc8bc083353fc1","src/command/memory_init.rs":"fadd17881d35ea5b2918de48ae9d631e16d6c49aba744d334e3edee64c0e839d","src/command/mod.rs":"c007a7f94a9ba94233b6d0721b3c3655a6e6c2cb9192ca20a408a0c3d5af788d","src/command/query.rs":"74ade834ad8098473a1d94259bfd98afb67b3d61cda591f3f5953153155e0717","src/command/render.rs":"06911d9fe73267c10827e25d4f1f728dacfc572fb9afad076fda1d85fbf349d4","src/command/render_command.rs":"314a05272478511f0b62bdb3aa409284d1c7ce84a8715476feef7d058b782276","src/command/timestamp_writes.rs":"38d3a48ec70043c0cbf4113a8751a3bf267c31c3c8328dcfd9d86bacbc800dc3","src/command/transfer.rs":"0a263c7407a4fa05186bbb03686b6a866500c02b7394e1325ba9ad491ee8a050","src/conv.rs":"9bbcd0660741a808d29788266bbac34af54c58e8db8ed856082f8d2d1dfb792d","src/device/bgl.rs":"1198f47a486d4cad4c03b49c98d690bac039a7b370cc241a5f279c6767e0b010","src/device/global.rs":"cf6fd87d7054e89bc798b451681999f25b3c20626fd4801eed682ce36b9cf83f","src/device/life.rs":"5a6267bb36278c806905919cc016569bc13d1d7ab4afef10366890a32dd0fe79","src/device/mod.rs":"246d418260f2c99986a6ac44843b1926151e81ee717c80b4f3188d7385e9ccd0","src/device/queue.rs":"b4c0c087ea36f24d33ed1ac13f64a55894f3ba5ec340ca0d0fd49c8383bd1744","src/device/resource.rs":"732927fd34f1fdacfa5d4dda3ae7ac3351b93e4cfc3be3ad5decc1397c8f2f48","src/device/trace.rs":"0e38395e0f41b763975d94d0b538ccbb926a3d784d4bfc78048884789c5b9d09","src/error.rs":"f509aa8a57c04e1aea9ba1b4a1589d007666018cd619db3f822c37082a76b871","src/global.rs":"75a984b96eb64bc2fa4027c6d0730a22761d91fe87882887459e8c58a2154b92","src/hal_api.rs":"29377c036d3eaaa05d83b87644a9a33916824eb51aa2d005704cde97e77925cb","src/hash_utils.rs":"e8d484027c7ce81978e4679a5e20af9416ab7d2fa595f1ca95992b29d625b0ca","src/hub.rs":"adb40e580f58155985f77b43fa56e6fee9be8d9d715c21585c5a3e3a6b726eae","src/id.rs":"360be13c450d11dd67593419a8ea96a514a0ebfc828525b0189382d0d8836a5d","src/identity.rs":"28917262fa245d81a5c2738513c3376c3a8d9b581fb44e9b2e0bf365b921911f","src/init_tracker/buffer.rs":"85e7c942b0acc1b2f724bb63ca015389c8a9a853198c37108a162326a2b5e70b","src/init_tracker/mod.rs":"039f2c6a98b066f80fd28f1b01f84b5d42e56f92176ac63b22dd572b06e4804d","src/init_tracker/texture.rs":"8e69fa256bf7cf7ce7bcbe28991e12990bf199ddb359b7a2bd40eee950a0fea9","src/instance.rs":"a994257cea33e01e6b7c1e4feb8837472eba57ba7c1b6671725c1913c1ad6fdc","src/lib.rs":"9352df683eb4462904303c9abc656d1003a194ed4e29f9f1fb4b76977e45a0fa","src/lock/mod.rs":"c58ae08a8e6108432d9e14e7d8b7bd15af7bb5e98bf700d6bd9a469b80a38b11","src/lock/observing.rs":"50d7c675e64cc89a188c12163e1920e75fe64db1682e843fff778efd751aa037","src/lock/rank.rs":"e6eebdb0fe0bf5e6ef7f8b522b1d83957643d244f84e1523a1e96f8f0a8d8126","src/lock/ranked.rs":"bafe6f295b4cade449cc41491c0dcd1497a6e04c5d902124040ac2056996a44d","src/lock/vanilla.rs":"57581d4671e226438b55f74c4195baa0c4fe1d9f4911a4c026b667c77ab574ff","src/pipeline.rs":"7ccfc915125c6db19f83aa58de1db55032340d72d68cb421dec4b60eeecaf194","src/pipeline_cache.rs":"dbb6b93562a15c9b27acc006545449a6c033280433c1950806243fcfe0850c3e","src/pool.rs":"7899e74874da17c83ec39a88b360de12f564ef4bee2bb1240c37becdaeb57a86","src/present.rs":"54884ac002eac9c17938330051649de2d95225004737c92fb21e120f0ee8a698","src/registry.rs":"adf47a507fe23abf6307cb37ea1cf5053294a3263fed477f39481cb7c690b5d7","src/resource.rs":"3ee9c11fc70cd4109cece33216fcccf6371d764c1fcaba1c914dbf95933d0b8d","src/snatch.rs":"f5f82eb6cfb216d3cc5ee89a7f4baa529cbc2e1f990c9d92748a507890af6885","src/storage.rs":"b7a4eabcb90c66668083de94dfea57e491dd42d42558d2960c190c73b330e90a","src/track/buffer.rs":"dc671db7ab4b8378af0e4a0f7dab181d86708922f942e3b01f7fc5d48507c509","src/track/metadata.rs":"44b3a8361780e8c8b2bd8910355e0ce89e2b04d921a97da4b1857a599bd6f5a4","src/track/mod.rs":"7e80349251c0874ed1d50847beee61e193ae706b9161405061e35c26d389c1f2","src/track/range.rs":"2a15794e79b0470d5ba6b3267173a42f34312878e1cb288f198d2854a7888e53","src/track/stateless.rs":"e404d58dbe2644bed4a9fcdc2c01a699322d669aaa4e6619750347519fb56625","src/track/texture.rs":"c5b6f03861907b8ad7dd304af6122b4f102bce6b4fa3e30e1b6f604872fb46fe","src/validation.rs":"6ea396fec9f934aaed00cee98b348e9b569187028fea2bf79f89b70ad8c35442"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-core/Cargo.toml b/third_party/rust/wgpu-core/Cargo.toml index 222a7978ac67..7823d5cc00fa 100644 --- a/third_party/rust/wgpu-core/Cargo.toml +++ b/third_party/rust/wgpu-core/Cargo.toml @@ -58,7 +58,6 @@ version = "2.6" [dependencies.bytemuck] version = "1.18" -features = ["derive"] optional = true [dependencies.document-features] @@ -110,7 +109,7 @@ optional = true version = "1" [dependencies.thiserror] -version = "1.0.63" +version = "1.0.64" [dependencies.wgt] version = "22.0.0" diff --git a/third_party/rust/wgpu-core/src/binding_model.rs b/third_party/rust/wgpu-core/src/binding_model.rs index 2357a8c77641..6f43ac5234f1 100644 --- a/third_party/rust/wgpu-core/src/binding_model.rs +++ b/third_party/rust/wgpu-core/src/binding_model.rs @@ -373,10 +373,6 @@ impl BindingTypeMaxCountValidator { limits.max_sampled_textures_per_shader_stage, BindingTypeMaxCountErrorKind::SampledTextures, )?; - self.storage_buffers.validate( - limits.max_storage_buffers_per_shader_stage, - BindingTypeMaxCountErrorKind::StorageBuffers, - )?; self.samplers.validate( limits.max_samplers_per_shader_stage, BindingTypeMaxCountErrorKind::Samplers, diff --git a/third_party/rust/wgpu-core/src/command/bundle.rs b/third_party/rust/wgpu-core/src/command/bundle.rs index 394858f9fde1..b0d90976dd63 100644 --- a/third_party/rust/wgpu-core/src/command/bundle.rs +++ b/third_party/rust/wgpu-core/src/command/bundle.rs @@ -1584,8 +1584,7 @@ pub mod bundle_ffi { /// /// This function is unsafe as there is no guarantee that the given pointer is /// valid for `offset_length` elements. - #[no_mangle] - pub unsafe extern "C" fn wgpu_render_bundle_set_bind_group( + pub unsafe fn wgpu_render_bundle_set_bind_group( bundle: &mut RenderBundleEncoder, index: u32, bind_group_id: Option, @@ -1612,8 +1611,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_set_pipeline( + pub fn wgpu_render_bundle_set_pipeline( bundle: &mut RenderBundleEncoder, pipeline_id: id::RenderPipelineId, ) { @@ -1627,8 +1625,7 @@ pub mod bundle_ffi { .push(RenderCommand::SetPipeline(pipeline_id)); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_set_vertex_buffer( + pub fn wgpu_render_bundle_set_vertex_buffer( bundle: &mut RenderBundleEncoder, slot: u32, buffer_id: id::BufferId, @@ -1643,8 +1640,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_set_index_buffer( + pub fn wgpu_render_bundle_set_index_buffer( encoder: &mut RenderBundleEncoder, buffer: id::BufferId, index_format: IndexFormat, @@ -1658,8 +1654,7 @@ pub mod bundle_ffi { /// /// This function is unsafe as there is no guarantee that the given pointer is /// valid for `data` elements. - #[no_mangle] - pub unsafe extern "C" fn wgpu_render_bundle_set_push_constants( + pub unsafe fn wgpu_render_bundle_set_push_constants( pass: &mut RenderBundleEncoder, stages: wgt::ShaderStages, offset: u32, @@ -1695,8 +1690,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_draw( + pub fn wgpu_render_bundle_draw( bundle: &mut RenderBundleEncoder, vertex_count: u32, instance_count: u32, @@ -1711,8 +1705,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_draw_indexed( + pub fn wgpu_render_bundle_draw_indexed( bundle: &mut RenderBundleEncoder, index_count: u32, instance_count: u32, @@ -1729,8 +1722,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_draw_indirect( + pub fn wgpu_render_bundle_draw_indirect( bundle: &mut RenderBundleEncoder, buffer_id: id::BufferId, offset: BufferAddress, @@ -1743,8 +1735,7 @@ pub mod bundle_ffi { }); } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_draw_indexed_indirect( + pub fn wgpu_render_bundle_draw_indexed_indirect( bundle: &mut RenderBundleEncoder, buffer_id: id::BufferId, offset: BufferAddress, @@ -1761,16 +1752,14 @@ pub mod bundle_ffi { /// /// This function is unsafe as there is no guarantee that the given `label` /// is a valid null-terminated string. - #[no_mangle] - pub unsafe extern "C" fn wgpu_render_bundle_push_debug_group( + pub unsafe fn wgpu_render_bundle_push_debug_group( _bundle: &mut RenderBundleEncoder, _label: RawString, ) { //TODO } - #[no_mangle] - pub extern "C" fn wgpu_render_bundle_pop_debug_group(_bundle: &mut RenderBundleEncoder) { + pub fn wgpu_render_bundle_pop_debug_group(_bundle: &mut RenderBundleEncoder) { //TODO } @@ -1778,8 +1767,7 @@ pub mod bundle_ffi { /// /// This function is unsafe as there is no guarantee that the given `label` /// is a valid null-terminated string. - #[no_mangle] - pub unsafe extern "C" fn wgpu_render_bundle_insert_debug_marker( + pub unsafe fn wgpu_render_bundle_insert_debug_marker( _bundle: &mut RenderBundleEncoder, _label: RawString, ) { diff --git a/third_party/rust/wgpu-core/src/command/compute.rs b/third_party/rust/wgpu-core/src/command/compute.rs index 5de03917d21b..133a5af35a31 100644 --- a/third_party/rust/wgpu-core/src/command/compute.rs +++ b/third_party/rust/wgpu-core/src/command/compute.rs @@ -136,6 +136,8 @@ pub enum ComputePassErrorInner { BindGroupIndexOutOfRange { index: u32, max: u32 }, #[error(transparent)] DestroyedResource(#[from] DestroyedResourceError), + #[error("Indirect buffer offset {0:?} is not a multiple of 4")] + UnalignedIndirectBufferOffset(BufferAddress), #[error("Indirect buffer uses bytes {offset}..{end_offset} which overruns indirect buffer of size {buffer_size}")] IndirectBufferOverrun { offset: u64, @@ -495,8 +497,6 @@ impl Global { state.raw_encoder.begin_compute_pass(&hal_desc); } - // TODO: We should be draining the commands here, avoiding extra copies in the process. - // (A command encoder can't be executed twice!) for command in base.commands { match command { ArcComputeCommand::SetBindGroup { @@ -780,7 +780,7 @@ fn set_push_constant( .binder .pipeline_layout .as_ref() - //TODO: don't error here, lazily update the push constants + // TODO: don't error here, lazily update the push constants using `state.push_constants` .ok_or(ComputePassErrorInner::Dispatch( DispatchError::MissingPipeline, ))?; @@ -847,6 +847,10 @@ fn dispatch_indirect( .merge_single(&buffer, hal::BufferUses::INDIRECT)?; buffer.check_usage(wgt::BufferUsages::INDIRECT)?; + if offset % 4 != 0 { + return Err(ComputePassErrorInner::UnalignedIndirectBufferOffset(offset)); + } + let end_offset = offset + size_of::() as u64; if end_offset > buffer.size { return Err(ComputePassErrorInner::IndirectBufferOverrun { diff --git a/third_party/rust/wgpu-core/src/command/render.rs b/third_party/rust/wgpu-core/src/command/render.rs index b6680333c2cb..d22eb5f0d6f5 100644 --- a/third_party/rust/wgpu-core/src/command/render.rs +++ b/third_party/rust/wgpu-core/src/command/render.rs @@ -638,6 +638,8 @@ pub enum RenderPassErrorInner { MissingFeatures(#[from] MissingFeatures), #[error(transparent)] MissingDownlevelFlags(#[from] MissingDownlevelFlags), + #[error("Indirect buffer offset {0:?} is not a multiple of 4")] + UnalignedIndirectBufferOffset(BufferAddress), #[error("Indirect draw uses bytes {offset}..{end_offset} {} which overruns indirect buffer of size {buffer_size}", count.map_or_else(String::new, |v| format!("(using count {v})")))] IndirectBufferOverrun { @@ -2450,6 +2452,10 @@ fn multi_draw_indirect( let actual_count = count.map_or(1, |c| c.get()); + if offset % 4 != 0 { + return Err(RenderPassErrorInner::UnalignedIndirectBufferOffset(offset)); + } + let end_offset = offset + stride as u64 * actual_count as u64; if end_offset > indirect_buffer.size { return Err(RenderPassErrorInner::IndirectBufferOverrun { @@ -2534,6 +2540,10 @@ fn multi_draw_indirect_count( count_buffer.check_usage(BufferUsages::INDIRECT)?; let count_raw = count_buffer.try_raw(state.snatch_guard)?; + if offset % 4 != 0 { + return Err(RenderPassErrorInner::UnalignedIndirectBufferOffset(offset)); + } + let end_offset = offset + stride * max_count as u64; if end_offset > indirect_buffer.size { return Err(RenderPassErrorInner::IndirectBufferOverrun { diff --git a/third_party/rust/wgpu-core/src/device/queue.rs b/third_party/rust/wgpu-core/src/device/queue.rs index f576b2412557..bd6d99f1c3a1 100644 --- a/third_party/rust/wgpu-core/src/device/queue.rs +++ b/third_party/rust/wgpu-core/src/device/queue.rs @@ -1027,11 +1027,13 @@ impl Global { &self, queue_id: QueueId, command_buffer_ids: &[id::CommandBufferId], - ) -> Result { + ) -> Result { profiling::scope!("Queue::submit"); api_log!("Queue::submit {queue_id:?}"); - let (submit_index, callbacks) = { + let submit_index; + + let res = 'error: { let hub = &self.hub; let queue = hub.queues.get(queue_id); @@ -1042,7 +1044,7 @@ impl Global { // Fence lock must be acquired after the snatch lock everywhere to avoid deadlocks. let mut fence = device.fence.write(); - let submit_index = device + submit_index = device .active_submission_index .fetch_add(1, Ordering::SeqCst) + 1; @@ -1119,18 +1121,29 @@ impl Global { } // execute resource transitions - unsafe { + if let Err(e) = unsafe { baked.encoder.begin_encoding(hal_label( Some("(wgpu internal) Transit"), device.instance_flags, )) } - .map_err(|e| device.handle_hal_error(e))?; + .map_err(|e| device.handle_hal_error(e)) + { + break 'error Err(e.into()); + } //Note: locking the trackers has to be done after the storages let mut trackers = device.trackers.lock(); - baked.initialize_buffer_memory(&mut trackers, &snatch_guard)?; - baked.initialize_texture_memory(&mut trackers, device, &snatch_guard)?; + if let Err(e) = baked.initialize_buffer_memory(&mut trackers, &snatch_guard) + { + break 'error Err(e.into()); + } + if let Err(e) = + baked.initialize_texture_memory(&mut trackers, device, &snatch_guard) + { + break 'error Err(e.into()); + } + //Note: stateless trackers are not merged: // device already knows these resources exist. CommandBuffer::insert_barriers_from_device_tracker( @@ -1147,13 +1160,16 @@ impl Global { // Note: we could technically do it after all of the command buffers, // but here we have a command encoder by hand, so it's easier to use it. if !used_surface_textures.is_empty() { - unsafe { + if let Err(e) = unsafe { baked.encoder.begin_encoding(hal_label( Some("(wgpu internal) Present"), device.instance_flags, )) } - .map_err(|e| device.handle_hal_error(e))?; + .map_err(|e| device.handle_hal_error(e)) + { + break 'error Err(e.into()); + } let texture_barriers = trackers .textures .set_from_usage_scope_and_drain_transitions( @@ -1180,7 +1196,7 @@ impl Global { } if let Some(first_error) = first_error { - return Err(first_error); + break 'error Err(first_error); } } } @@ -1190,9 +1206,9 @@ impl Global { { used_surface_textures.set_size(hub.textures.read().len()); for texture in pending_writes.dst_textures.values() { - match texture.try_inner(&snatch_guard)? { - TextureInner::Native { .. } => {} - TextureInner::Surface { .. } => { + match texture.try_inner(&snatch_guard) { + Ok(TextureInner::Native { .. }) => {} + Ok(TextureInner::Surface { .. }) => { // Compare the Arcs by pointer as Textures don't implement Eq submit_surface_textures_owned .insert(Arc::as_ptr(texture), texture.clone()); @@ -1203,6 +1219,7 @@ impl Global { .unwrap() }; } + Err(e) => break 'error Err(e.into()), } } @@ -1224,10 +1241,12 @@ impl Global { } } - if let Some(pending_execution) = - pending_writes.pre_submit(&device.command_allocator, device, &queue)? - { - active_executions.insert(0, pending_execution); + match pending_writes.pre_submit(&device.command_allocator, device, &queue) { + Ok(Some(pending_execution)) => { + active_executions.insert(0, pending_execution); + } + Ok(None) => {} + Err(e) => break 'error Err(e.into()), } let hal_command_buffers = active_executions @@ -1249,14 +1268,17 @@ impl Global { submit_surface_textures.push(raw); } - unsafe { + if let Err(e) = unsafe { queue.raw().submit( &hal_command_buffers, &submit_surface_textures, (fence.as_mut(), submit_index), ) } - .map_err(|e| device.handle_hal_error(e))?; + .map_err(|e| device.handle_hal_error(e)) + { + break 'error Err(e.into()); + } // Advance the successful submission index. device @@ -1280,12 +1302,19 @@ impl Global { let (closures, _) = match device.maintain(fence_guard, wgt::Maintain::Poll, snatch_guard) { Ok(closures) => closures, - Err(WaitIdleError::Device(err)) => return Err(QueueSubmitError::Queue(err)), - Err(WaitIdleError::StuckGpu) => return Err(QueueSubmitError::StuckGpu), + Err(WaitIdleError::Device(err)) => { + break 'error Err(QueueSubmitError::Queue(err)) + } + Err(WaitIdleError::StuckGpu) => break 'error Err(QueueSubmitError::StuckGpu), Err(WaitIdleError::WrongSubmissionIndex(..)) => unreachable!(), }; - (submit_index, closures) + Ok(closures) + }; + + let callbacks = match res { + Ok(ok) => ok, + Err(e) => return Err((submit_index, e)), }; // the closures should execute with nothing locked! diff --git a/third_party/rust/wgpu-core/src/device/resource.rs b/third_party/rust/wgpu-core/src/device/resource.rs index 1cd8ef0fe75e..5a726ef70fd7 100644 --- a/third_party/rust/wgpu-core/src/device/resource.rs +++ b/third_party/rust/wgpu-core/src/device/resource.rs @@ -38,7 +38,6 @@ use arrayvec::ArrayVec; use once_cell::sync::OnceCell; use smallvec::SmallVec; -use thiserror::Error; use wgt::{ math::align_to, DeviceLostReason, TextureFormat, TextureSampleType, TextureViewDimension, }; @@ -187,14 +186,6 @@ impl Drop for Device { } } -#[derive(Clone, Debug, Error)] -pub enum CreateDeviceError { - #[error("Not enough memory left to create device")] - OutOfMemory, - #[error("Failed to create internal buffer for initializing textures")] - FailedToCreateZeroBuffer(#[from] DeviceError), -} - impl Device { pub(crate) fn raw(&self) -> &dyn hal::DynDevice { self.raw.as_ref() @@ -372,7 +363,7 @@ impl Device { let Some(view) = view.upgrade() else { continue; }; - let Some(raw_view) = view.raw.snatch(self.snatchable_lock.write()) else { + let Some(raw_view) = view.raw.snatch(&mut self.snatchable_lock.write()) else { continue; }; @@ -386,7 +377,8 @@ impl Device { let Some(bind_group) = bind_group.upgrade() else { continue; }; - let Some(raw_bind_group) = bind_group.raw.snatch(self.snatchable_lock.write()) + let Some(raw_bind_group) = + bind_group.raw.snatch(&mut self.snatchable_lock.write()) else { continue; }; @@ -437,13 +429,11 @@ impl Device { .last_successful_submission_index .load(Ordering::Acquire); - if let wgt::Maintain::WaitForSubmissionIndex(submission_index) = maintain { - if submission_index > last_successful_submission_index { - return Err(WaitIdleError::WrongSubmissionIndex( - submission_index, - last_successful_submission_index, - )); - } + if submission_index > last_successful_submission_index { + return Err(WaitIdleError::WrongSubmissionIndex( + submission_index, + last_successful_submission_index, + )); } submission_index @@ -457,13 +447,13 @@ impl Device { // If necessary, wait for that submission to complete. if maintain.is_wait() { + log::trace!("Device::maintain: waiting for submission index {submission_index}"); unsafe { self.raw() .wait(fence.as_ref(), submission_index, CLEANUP_WAIT_MS) } .map_err(|e| self.handle_hal_error(e))?; } - log::trace!("Device::maintain: waiting for submission index {submission_index}"); let mut life_tracker = self.lock_life(); let submission_closures = diff --git a/third_party/rust/wgpu-core/src/id.rs b/third_party/rust/wgpu-core/src/id.rs index 76ea8e3337af..4e4897c832a9 100644 --- a/third_party/rust/wgpu-core/src/id.rs +++ b/third_party/rust/wgpu-core/src/id.rs @@ -4,22 +4,23 @@ use std::{ fmt::{self, Debug}, hash::Hash, marker::PhantomData, + mem::size_of, num::NonZeroU64, }; use wgt::WasmNotSendSync; const _: () = { - if std::mem::size_of::() != 4 { + if size_of::() != 4 { panic!() } }; const _: () = { - if std::mem::size_of::() != 4 { + if size_of::() != 4 { panic!() } }; const _: () = { - if std::mem::size_of::() != 8 { + if size_of::() != 8 { panic!() } }; diff --git a/third_party/rust/wgpu-core/src/lib.rs b/third_party/rust/wgpu-core/src/lib.rs index ccbe64d527d3..521238a7d6a0 100644 --- a/third_party/rust/wgpu-core/src/lib.rs +++ b/third_party/rust/wgpu-core/src/lib.rs @@ -128,16 +128,26 @@ pub fn hal_label(opt: Option<&str>, flags: wgt::InstanceFlags) -> Option<&str> { opt } -const DOWNLEVEL_WARNING_MESSAGE: &str = "The underlying API or device in use does not \ -support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. \ -If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, \ -call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current \ -platform supports."; -const DOWNLEVEL_ERROR_MESSAGE: &str = "This is not an invalid use of WebGPU: the underlying API or device does not \ -support enough features to be a fully compliant implementation. A subset of the features can still be used. \ -If you are running this program on native and not in a browser and wish to work around this issue, call \ -Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current \ -platform supports."; +const DOWNLEVEL_WARNING_MESSAGE: &str = concat!( + "The underlying API or device in use does not ", + "support enough features to be a fully compliant implementation of WebGPU. ", + "A subset of the features can still be used. ", + "If you are running this program on native and not in a browser and wish to limit ", + "the features you use to the supported subset, ", + "call Adapter::downlevel_properties or Device::downlevel_properties to get ", + "a listing of the features the current ", + "platform supports." +); + +const DOWNLEVEL_ERROR_MESSAGE: &str = concat!( + "This is not an invalid use of WebGPU: the underlying API or device does not ", + "support enough features to be a fully compliant implementation. ", + "A subset of the features can still be used. ", + "If you are running this program on native and not in a browser ", + "and wish to work around this issue, call ", + "Adapter::downlevel_properties or Device::downlevel_properties ", + "to get a listing of the features the current platform supports." +); #[cfg(feature = "api_log_info")] macro_rules! api_log { diff --git a/third_party/rust/wgpu-core/src/present.rs b/third_party/rust/wgpu-core/src/present.rs index c9d0124bf43b..b12e35328ab8 100644 --- a/third_party/rust/wgpu-core/src/present.rs +++ b/third_party/rust/wgpu-core/src/present.rs @@ -288,8 +288,11 @@ impl Global { .textures .remove(texture.tracker_index()); let suf = surface.raw(device.backend()).unwrap(); - let exclusive_snatch_guard = device.snatchable_lock.write(); - match texture.inner.snatch(exclusive_snatch_guard).unwrap() { + match texture + .inner + .snatch(&mut device.snatchable_lock.write()) + .unwrap() + { resource::TextureInner::Surface { raw, parent_id } => { if surface_id != parent_id { log::error!("Presented frame is from a different surface"); @@ -359,8 +362,11 @@ impl Global { .textures .remove(texture.tracker_index()); let suf = surface.raw(device.backend()); - let exclusive_snatch_guard = device.snatchable_lock.write(); - match texture.inner.snatch(exclusive_snatch_guard).unwrap() { + match texture + .inner + .snatch(&mut device.snatchable_lock.write()) + .unwrap() + { resource::TextureInner::Surface { raw, parent_id } => { if surface_id == parent_id { unsafe { suf.unwrap().discard_texture(raw) }; diff --git a/third_party/rust/wgpu-core/src/resource.rs b/third_party/rust/wgpu-core/src/resource.rs index 5df285da5426..32fde3dd5792 100644 --- a/third_party/rust/wgpu-core/src/resource.rs +++ b/third_party/rust/wgpu-core/src/resource.rs @@ -737,8 +737,7 @@ impl Buffer { let device = &self.device; let temp = { - let snatch_guard = device.snatchable_lock.write(); - let raw = match self.raw.snatch(snatch_guard) { + let raw = match self.raw.snatch(&mut device.snatchable_lock.write()) { Some(raw) => raw, None => { return Err(DestroyError::AlreadyDestroyed); @@ -1185,8 +1184,7 @@ impl Texture { let device = &self.device; let temp = { - let snatch_guard = device.snatchable_lock.write(); - let raw = match self.inner.snatch(snatch_guard) { + let raw = match self.inner.snatch(&mut device.snatchable_lock.write()) { Some(TextureInner::Native { raw }) => raw, Some(TextureInner::Surface { .. }) => { return Ok(()); diff --git a/third_party/rust/wgpu-core/src/snatch.rs b/third_party/rust/wgpu-core/src/snatch.rs index 9866b777230f..a817e2068ce0 100644 --- a/third_party/rust/wgpu-core/src/snatch.rs +++ b/third_party/rust/wgpu-core/src/snatch.rs @@ -38,7 +38,7 @@ impl Snatchable { } /// Take the value. Requires a the snatchable lock's write guard. - pub fn snatch(&self, _guard: ExclusiveSnatchGuard) -> Option { + pub fn snatch(&self, _guard: &mut ExclusiveSnatchGuard) -> Option { unsafe { (*self.value.get()).take() } } diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index 1af0fe105777..0c006c1ab97a 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"5e6abc86972473fc93e2ebeb5bb279639547afc28389e270bffdfd813b417377","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"8930213345c3edb1273533f22d2c44bd8a7c6c4fe2510d71852a7e2d27116c6e","build.rs":"c80bdc0152a00471eec6ed0dd0f7d55d0b975498a00ba05e94100c84ad639a49","examples/halmark/main.rs":"251a067ed7e8cfe8850b5dc1789b5ae3e35ddde2540196fa649337eee8ede022","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"efa99462c04f4728c5db738af4901bfd238405a95fc815b5cc95c7d2343c62bf","examples/ray-traced-triangle/main.rs":"ab0715ce6e720682fa2ab4df018bd3e7250bae3f6cbc7d7474c59702ce0f849a","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"0c68c8890d1a4e397f5f8465af3612b90181e4ebc4ebdfefbd40a4f845993bc2","src/auxil/dxgi/exception.rs":"fd9ca0a9bdfe028ee9d41d149f91351de7563c23864757fd4e6f3e046192f65f","src/auxil/dxgi/factory.rs":"f47fb2c35b53b23e623fabbbf0ad531c5cc4611fffd5d1afa9088e25f0885f59","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"a14b8b0dd052e7dde11220043f180d2e8ce7ae522dea6e96536c82db13fc7abc","src/auxil/dxgi/time.rs":"6235cc071b8535b4b58f843dbaf4ff4564a37e80a99c452c4a8988e436192483","src/auxil/mod.rs":"b07c43813541136786f06b8a0c11a8b89157932dde14c0f7a4ead1ba1ee401cc","src/auxil/renderdoc.rs":"be2a012b7f326173cdeeccc0925bc26c64e3439c974338f5d5836f20afcf0022","src/dx12/adapter.rs":"16cb1bfe2666f56e269db34f25545649643a4d768b7451796bc3842167ad5e7b","src/dx12/command.rs":"80bcfde3deabf829ca1d192f21f5c4ae870e66e2f13c40cd6f84502819440ba5","src/dx12/conv.rs":"14d74445762d000f88067670118a4a259e37e94002904879fbdc56a965236955","src/dx12/descriptor.rs":"46e47cb6ca2b50631872aebdecb9beb6c43c205f8e04f89f867c4830eb8139f6","src/dx12/device.rs":"caf6ce9c1c62b4916768711435d1e811a6d74680803cf5ea3874acf1819e51ab","src/dx12/instance.rs":"58ee9969b9b14861e352fdad9af94d14774621df5547609d23f02533d6dc7275","src/dx12/mod.rs":"3d175d71f0dff738b02a11a407910c829eaaac251f0060a10699799a6a50467b","src/dx12/shader_compilation.rs":"d96c54d732993445b05aeaaaae3d8b8ee3d3a5b4f7551d5bd4169e55ad300f48","src/dx12/suballocation.rs":"f71bb7ee28cb3396608db86d0564f3a4dfe3a662ee6c2a9bb518dd5d8a78fb79","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"1b10cee262487ca0466d07c4f994ff6b1ff95178bd037d1c8a1cf1a74cea0581","src/dynamic/adapter.rs":"ea69fd063e4f0492e7927bcca64501640daa53af9b2d81b8948ac7c5836d0910","src/dynamic/command.rs":"a6d7c8e05ca783a618a51f9ff25af7cbad0cc4f5b4486da8c39eb21458cd7588","src/dynamic/device.rs":"3023e8e69ed712989f321eb705ffae5acfa764ceb62ed8703cd89a856c796728","src/dynamic/instance.rs":"6c1f3b325a8059ae4717e016d03d3c1f6074c98422f787f776aeb6d46a828c26","src/dynamic/mod.rs":"c8f25c902c35306a15cdbe47d8c3877968d9ca6586c5b2c3db1f9e45d7f536fb","src/dynamic/queue.rs":"23367e59dbf97cbaf5363cc68c00b0d2096a296f79ec5f636479f2132ab9a39c","src/dynamic/surface.rs":"c07327f244687c4a700390d3a8f0a443e4fff2a9192bf026962687bad945ccd2","src/empty.rs":"e6681210a0352cb7eb9e85149b2b6e5d1d875a316ca480ab31dcfe05570b0d6b","src/gles/adapter.rs":"cabe4ea115a9dd26f28117b6256a826f133c12b648eb23cea741c59bf181dfd1","src/gles/command.rs":"470347bb905f702dd3b9e6cf80f1e5bf0ee53b069f4b347bb4d49216c548d901","src/gles/conv.rs":"addf1deae35a6d5d38c49a95932e2fbd5c51caa87299a1eb19a145576977353c","src/gles/device.rs":"48b61c769254bcbe0d6ecc808a21129e06bd654be62168308a0c2469ec1240c5","src/gles/egl.rs":"601f6986c3a1fb63a93badb78aa7463a36a19f90c31831f761bc96b9f8a9b342","src/gles/emscripten.rs":"d225171b044a949bb4ebc295d975f73cca85440e8f892605bf5ef42373e6772d","src/gles/mod.rs":"ce951bd0030a0a4e42e1fac233618fb59410a3bd70935ceca0136774fe903473","src/gles/queue.rs":"36fc2318e37f6eb5e98b01f12c9903f2877075301ddc1f3f75d8c76c839541b4","src/gles/shaders/clear.frag":"9133ed8ed97d3641fbb6b5f5ea894a3554c629ccc1b80a5fc9221d7293aa1954","src/gles/shaders/clear.vert":"a543768725f4121ff2e9e1fb5b00644931e9d6f2f946c0ef01968afb5a135abd","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"2c7bd33d66bc41f9fc63226fe92b995b2d9dbfef7ffa4c7930d5133182b5aa87","src/gles/wgl.rs":"0d3ccbe0040646d9bd5cefd5b3769acd46b5a4f0cf5be627b008f8fe584958b3","src/lib.rs":"a21532b0f5e2e497c7c844285416d64096d3a7494fe9fad749bfe9ded30602ab","src/metal/adapter.rs":"fceb4ab5233411993da8c8eebbb04c9cea9605c02d8a4e0514d86d0852be33f0","src/metal/command.rs":"a09cabb0a4aac05ef853d17c4979cf4144f83ebfd153d4f548469f0c79494a17","src/metal/conv.rs":"a34a44e6affb594f3285f8d585b0fb33132aa7dc6a612f7c1aecaa400fe43265","src/metal/device.rs":"1c3da79d63cb4941bd6fbc50c8bedf5de043ff069e2a8b5a5803fb4af240bc39","src/metal/mod.rs":"b1d8e977a83c4603e86699c9874e804256ce04e17294aa0ff67fe80eca52a6d0","src/metal/surface.rs":"6fe7aa7e3d35b9dd77369345dc6034e1403a25f350661dd0cda5cb7f2a55263a","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"bcce8f1926dda0191cfba64d2ef7c262cb608869268f0f44f141d14edd5ec134","src/vulkan/command.rs":"133192c9d113a5f3bcdddebbf43a91c4204353632045255939e6e3b1b46d1ff5","src/vulkan/conv.rs":"41b62e73124cdad43dd261e7a4f2e2c30e9d43d15e526d225ca523fc18284abd","src/vulkan/device.rs":"b076aa25af60b4ad5386157698cd1519f2011cf4322721d95f4b12bac772ae02","src/vulkan/instance.rs":"7369639a708990c2327ea1a8d0f0785893f38b62619bc2441e35cea2ab1002a3","src/vulkan/mod.rs":"7097d9d306955b0ad44186489da663a159fce8b1a0410a2ec4af9df3037e2187"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"ebf9b39f46111d7d61adbd862660c367d1b5f43154acaf6f90c2d1f980a5e9c7","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"8930213345c3edb1273533f22d2c44bd8a7c6c4fe2510d71852a7e2d27116c6e","build.rs":"c80bdc0152a00471eec6ed0dd0f7d55d0b975498a00ba05e94100c84ad639a49","examples/halmark/main.rs":"251a067ed7e8cfe8850b5dc1789b5ae3e35ddde2540196fa649337eee8ede022","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"efa99462c04f4728c5db738af4901bfd238405a95fc815b5cc95c7d2343c62bf","examples/ray-traced-triangle/main.rs":"8ae2b5da8e58651b76e19deb236995830a2b5955d1ecc4cd4c0afaa1b3b5c659","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"0c68c8890d1a4e397f5f8465af3612b90181e4ebc4ebdfefbd40a4f845993bc2","src/auxil/dxgi/exception.rs":"fd9ca0a9bdfe028ee9d41d149f91351de7563c23864757fd4e6f3e046192f65f","src/auxil/dxgi/factory.rs":"f47fb2c35b53b23e623fabbbf0ad531c5cc4611fffd5d1afa9088e25f0885f59","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"a14b8b0dd052e7dde11220043f180d2e8ce7ae522dea6e96536c82db13fc7abc","src/auxil/dxgi/time.rs":"6235cc071b8535b4b58f843dbaf4ff4564a37e80a99c452c4a8988e436192483","src/auxil/mod.rs":"b07c43813541136786f06b8a0c11a8b89157932dde14c0f7a4ead1ba1ee401cc","src/auxil/renderdoc.rs":"b4514932dac7b7a2c5660f14182511695c7076dd868e2679aaaa5a3cb305700f","src/dx12/adapter.rs":"16cb1bfe2666f56e269db34f25545649643a4d768b7451796bc3842167ad5e7b","src/dx12/command.rs":"80bcfde3deabf829ca1d192f21f5c4ae870e66e2f13c40cd6f84502819440ba5","src/dx12/conv.rs":"14d74445762d000f88067670118a4a259e37e94002904879fbdc56a965236955","src/dx12/descriptor.rs":"46e47cb6ca2b50631872aebdecb9beb6c43c205f8e04f89f867c4830eb8139f6","src/dx12/device.rs":"caf6ce9c1c62b4916768711435d1e811a6d74680803cf5ea3874acf1819e51ab","src/dx12/instance.rs":"58ee9969b9b14861e352fdad9af94d14774621df5547609d23f02533d6dc7275","src/dx12/mod.rs":"3d175d71f0dff738b02a11a407910c829eaaac251f0060a10699799a6a50467b","src/dx12/shader_compilation.rs":"d96c54d732993445b05aeaaaae3d8b8ee3d3a5b4f7551d5bd4169e55ad300f48","src/dx12/suballocation.rs":"f71bb7ee28cb3396608db86d0564f3a4dfe3a662ee6c2a9bb518dd5d8a78fb79","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"1b10cee262487ca0466d07c4f994ff6b1ff95178bd037d1c8a1cf1a74cea0581","src/dynamic/adapter.rs":"ea69fd063e4f0492e7927bcca64501640daa53af9b2d81b8948ac7c5836d0910","src/dynamic/command.rs":"a6d7c8e05ca783a618a51f9ff25af7cbad0cc4f5b4486da8c39eb21458cd7588","src/dynamic/device.rs":"3023e8e69ed712989f321eb705ffae5acfa764ceb62ed8703cd89a856c796728","src/dynamic/instance.rs":"6c1f3b325a8059ae4717e016d03d3c1f6074c98422f787f776aeb6d46a828c26","src/dynamic/mod.rs":"c8f25c902c35306a15cdbe47d8c3877968d9ca6586c5b2c3db1f9e45d7f536fb","src/dynamic/queue.rs":"23367e59dbf97cbaf5363cc68c00b0d2096a296f79ec5f636479f2132ab9a39c","src/dynamic/surface.rs":"c07327f244687c4a700390d3a8f0a443e4fff2a9192bf026962687bad945ccd2","src/empty.rs":"e6681210a0352cb7eb9e85149b2b6e5d1d875a316ca480ab31dcfe05570b0d6b","src/gles/adapter.rs":"cabe4ea115a9dd26f28117b6256a826f133c12b648eb23cea741c59bf181dfd1","src/gles/command.rs":"470347bb905f702dd3b9e6cf80f1e5bf0ee53b069f4b347bb4d49216c548d901","src/gles/conv.rs":"addf1deae35a6d5d38c49a95932e2fbd5c51caa87299a1eb19a145576977353c","src/gles/device.rs":"48b61c769254bcbe0d6ecc808a21129e06bd654be62168308a0c2469ec1240c5","src/gles/egl.rs":"601f6986c3a1fb63a93badb78aa7463a36a19f90c31831f761bc96b9f8a9b342","src/gles/emscripten.rs":"d225171b044a949bb4ebc295d975f73cca85440e8f892605bf5ef42373e6772d","src/gles/mod.rs":"f8bd40a7a28ed6f59183f29e608565015b41a879be53730d3fc3a47a4a7ea90f","src/gles/queue.rs":"884db398081c5b1f9a29bdb1846fbab4c8f9dec474fdd1e08ea6b85c44e560b5","src/gles/shaders/clear.frag":"9133ed8ed97d3641fbb6b5f5ea894a3554c629ccc1b80a5fc9221d7293aa1954","src/gles/shaders/clear.vert":"a543768725f4121ff2e9e1fb5b00644931e9d6f2f946c0ef01968afb5a135abd","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"4c4438fdacbd720a9c07c1b2fcaaeb4b82522eb26d2180b52bb52a91cd76a243","src/gles/wgl.rs":"0d3ccbe0040646d9bd5cefd5b3769acd46b5a4f0cf5be627b008f8fe584958b3","src/lib.rs":"a21532b0f5e2e497c7c844285416d64096d3a7494fe9fad749bfe9ded30602ab","src/metal/adapter.rs":"fceb4ab5233411993da8c8eebbb04c9cea9605c02d8a4e0514d86d0852be33f0","src/metal/command.rs":"6c566d1ed5fa121ba7b2948f8bae0b2917087619e6178327160e7f7b388d0b5e","src/metal/conv.rs":"a34a44e6affb594f3285f8d585b0fb33132aa7dc6a612f7c1aecaa400fe43265","src/metal/device.rs":"1c3da79d63cb4941bd6fbc50c8bedf5de043ff069e2a8b5a5803fb4af240bc39","src/metal/mod.rs":"b1d8e977a83c4603e86699c9874e804256ce04e17294aa0ff67fe80eca52a6d0","src/metal/surface.rs":"6fe7aa7e3d35b9dd77369345dc6034e1403a25f350661dd0cda5cb7f2a55263a","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"bcce8f1926dda0191cfba64d2ef7c262cb608869268f0f44f141d14edd5ec134","src/vulkan/command.rs":"855d88242ee6daf0ed796a477ab5a4387aa2b47d0d026daa16019485a6f424f4","src/vulkan/conv.rs":"41b62e73124cdad43dd261e7a4f2e2c30e9d43d15e526d225ca523fc18284abd","src/vulkan/device.rs":"455c6d3589d3700256992b416cc63cd6db51d12850c9041c493860174890ad04","src/vulkan/instance.rs":"7fe4c85de8be7a6f2b496bff0b4b5e79fd876bda86edf42f2ecb85e0272a5892","src/vulkan/mod.rs":"dacc6161188ae50135f7e1e309f39d6fdff95c5774ac86adb0a08e345269ef4c"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-hal/Cargo.toml b/third_party/rust/wgpu-hal/Cargo.toml index 509f229d715b..293352d296cc 100644 --- a/third_party/rust/wgpu-hal/Cargo.toml +++ b/third_party/rust/wgpu-hal/Cargo.toml @@ -70,6 +70,10 @@ version = "0.7" [dependencies.bitflags] version = "2.6" +[dependencies.bytemuck] +version = "1.18" +optional = true + [dependencies.glow] version = "0.14.1" optional = true @@ -98,7 +102,7 @@ version = "0.6" version = "1.1.0" [dependencies.thiserror] -version = "1.0.63" +version = "1.0.64" [dependencies.wgt] version = "22.0.0" @@ -151,6 +155,7 @@ dx12 = [ fragile-send-sync-non-atomic-wasm = ["wgt/fragile-send-sync-non-atomic-wasm"] gles = [ "naga/glsl-out", + "dep:bytemuck", "dep:glow", "dep:glutin_wgl_sys", "dep:khronos-egl", diff --git a/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs b/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs index 816827b5ae35..4eedfe78173c 100644 --- a/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs +++ b/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs @@ -124,7 +124,12 @@ impl AccelerationStructureInstance { &mut self, shader_binding_table_record_offset: u32, ) { - debug_assert!(shader_binding_table_record_offset <= Self::MAX_U24, "shader_binding_table_record_offset uses more than 24 bits! {shader_binding_table_record_offset} > {}", Self::MAX_U24); + debug_assert!( + shader_binding_table_record_offset <= Self::MAX_U24, + "shader_binding_table_record_offset uses more than 24 bits! {} > {}", + shader_binding_table_record_offset, + Self::MAX_U24 + ); self.shader_binding_table_record_offset_and_flags = (shader_binding_table_record_offset & Self::LOW_24_MASK) | (self.shader_binding_table_record_offset_and_flags & !Self::LOW_24_MASK) @@ -151,7 +156,9 @@ impl AccelerationStructureInstance { ); debug_assert!( shader_binding_table_record_offset <= Self::MAX_U24, - "shader_binding_table_record_offset uses more than 24 bits! {shader_binding_table_record_offset} > {}", Self::MAX_U24 + "shader_binding_table_record_offset uses more than 24 bits! {} > {}", + shader_binding_table_record_offset, + Self::MAX_U24 ); AccelerationStructureInstance { transform: Self::affine_to_rows(transform), @@ -205,7 +212,7 @@ struct Example { uniform_buffer: A::Buffer, pipeline_layout: A::PipelineLayout, vertices_buffer: A::Buffer, - indices_buffer: A::Buffer, + indices_buffer: Option, texture: A::Texture, instances: [AccelerationStructureInstance; 3], instances_buffer: A::Buffer, @@ -217,6 +224,18 @@ struct Example { impl Example { fn init(window: &winit::window::Window) -> Result> { + let mut index_buffer = false; + + for arg in std::env::args() { + if arg == "index_buffer" { + index_buffer = true; + } + } + + if index_buffer { + log::info!("using index buffer") + } + let instance_desc = hal::InstanceDescriptor { name: "example", flags: wgt::InstanceFlags::default(), @@ -420,29 +439,34 @@ impl Example { vertices_buffer }; - let indices_buffer = unsafe { - let indices_buffer = device - .create_buffer(&hal::BufferDescriptor { - label: Some("indices buffer"), - size: indices_size_in_bytes as u64, - usage: hal::BufferUses::MAP_WRITE - | hal::BufferUses::BOTTOM_LEVEL_ACCELERATION_STRUCTURE_INPUT, - memory_flags: hal::MemoryFlags::TRANSIENT | hal::MemoryFlags::PREFER_COHERENT, - }) - .unwrap(); + let indices_buffer = if index_buffer { + unsafe { + let indices_buffer = device + .create_buffer(&hal::BufferDescriptor { + label: Some("indices buffer"), + size: indices_size_in_bytes as u64, + usage: hal::BufferUses::MAP_WRITE + | hal::BufferUses::BOTTOM_LEVEL_ACCELERATION_STRUCTURE_INPUT, + memory_flags: hal::MemoryFlags::TRANSIENT + | hal::MemoryFlags::PREFER_COHERENT, + }) + .unwrap(); - let mapping = device - .map_buffer(&indices_buffer, 0..indices_size_in_bytes as u64) - .unwrap(); - ptr::copy_nonoverlapping( - indices.as_ptr() as *const u8, - mapping.ptr.as_ptr(), - indices_size_in_bytes, - ); - device.unmap_buffer(&indices_buffer); - assert!(mapping.is_coherent); + let mapping = device + .map_buffer(&indices_buffer, 0..indices_size_in_bytes as u64) + .unwrap(); + ptr::copy_nonoverlapping( + indices.as_ptr() as *const u8, + mapping.ptr.as_ptr(), + indices_size_in_bytes, + ); + device.unmap_buffer(&indices_buffer); + assert!(mapping.is_coherent); - indices_buffer + Some((indices_buffer, indices.len())) + } + } else { + None }; let blas_triangles = vec![hal::AccelerationStructureTriangles { @@ -451,12 +475,15 @@ impl Example { vertex_format: wgt::VertexFormat::Float32x3, vertex_count: vertices.len() as u32, vertex_stride: 3 * 4, - indices: Some(hal::AccelerationStructureTriangleIndices { - buffer: Some(&indices_buffer), - format: wgt::IndexFormat::Uint32, - offset: 0, - count: indices.len() as u32, + indices: indices_buffer.as_ref().map(|(buf, len)| { + hal::AccelerationStructureTriangleIndices { + buffer: Some(buf), + format: wgt::IndexFormat::Uint32, + offset: 0, + count: *len as u32, + } }), + transform: None, flags: hal::AccelerationStructureGeometryFlags::OPAQUE, }]; @@ -800,7 +827,7 @@ impl Example { tlas, scratch_buffer, time: 0.0, - indices_buffer, + indices_buffer: indices_buffer.map(|(buf, _)| buf), vertices_buffer, uniform_buffer, texture_view, @@ -1026,7 +1053,9 @@ impl Example { self.device.destroy_bind_group(self.bind_group); self.device.destroy_buffer(self.scratch_buffer); self.device.destroy_buffer(self.instances_buffer); - self.device.destroy_buffer(self.indices_buffer); + if let Some(buffer) = self.indices_buffer { + self.device.destroy_buffer(buffer); + } self.device.destroy_buffer(self.vertices_buffer); self.device.destroy_buffer(self.uniform_buffer); self.device.destroy_acceleration_structure(self.tlas); diff --git a/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs b/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs index 3b08955fad4c..3879bb9545e3 100644 --- a/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs +++ b/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs @@ -74,7 +74,8 @@ impl RenderDoc { Err(e) => { return RenderDoc::NotAvailable { reason: format!( - "Unable to get RENDERDOC_GetAPI from renderdoc library '{renderdoc_filename}': {e:?}" + "Unable to get RENDERDOC_GetAPI from renderdoc library '{}': {e:?}", + renderdoc_filename ), } } @@ -89,7 +90,8 @@ impl RenderDoc { }, return_value => RenderDoc::NotAvailable { reason: format!( - "Unable to get API from renderdoc library '{renderdoc_filename}': {return_value}" + "Unable to get API from renderdoc library '{}': {}", + renderdoc_filename, return_value ), }, } diff --git a/third_party/rust/wgpu-hal/src/gles/mod.rs b/third_party/rust/wgpu-hal/src/gles/mod.rs index df5977806518..8eb2800895b3 100644 --- a/third_party/rust/wgpu-hal/src/gles/mod.rs +++ b/third_party/rust/wgpu-hal/src/gles/mod.rs @@ -457,11 +457,24 @@ impl Texture { }; log::error!( - "wgpu-hal heuristics assumed that the view dimension will be equal to `{got}` rather than `{view_dimension:?}`.\n{}\n{}\n{}\n{}", - "`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`", - "`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`", - "`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`", - "`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`", + concat!( + "wgpu-hal heuristics assumed that ", + "the view dimension will be equal to `{}` rather than `{:?}`.\n", + "`D2` textures with ", + "`depth_or_array_layers == 1` ", + "are assumed to have view dimension `D2`\n", + "`D2` textures with ", + "`depth_or_array_layers > 1` ", + "are assumed to have view dimension `D2Array`\n", + "`D2` textures with ", + "`depth_or_array_layers == 6` ", + "are assumed to have view dimension `Cube`\n", + "`D2` textures with ", + "`depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` ", + "are assumed to have view dimension `CubeArray`\n", + ), + got, + view_dimension, ); } } diff --git a/third_party/rust/wgpu-hal/src/gles/queue.rs b/third_party/rust/wgpu-hal/src/gles/queue.rs index 39315f72b7d4..fc106eb23dfd 100644 --- a/third_party/rust/wgpu-hal/src/gles/queue.rs +++ b/third_party/rust/wgpu-hal/src/gles/queue.rs @@ -1603,19 +1603,13 @@ impl super::Queue { ref uniform, offset, } => { - // T must be POD - // - // This function is absolutely sketchy and we really should be using bytemuck. - unsafe fn get_data(data: &[u8], offset: u32) -> &[T; COUNT] { + fn get_data(data: &[u8], offset: u32) -> [T; COUNT] + where + [T; COUNT]: bytemuck::AnyBitPattern, + { let data_required = size_of::() * COUNT; - let raw = &data[(offset as usize)..][..data_required]; - - debug_assert_eq!(data_required, raw.len()); - - let slice: &[T] = unsafe { slice::from_raw_parts(raw.as_ptr().cast(), COUNT) }; - - slice.try_into().unwrap() + bytemuck::pod_read_unaligned(raw) } let location = Some(&uniform.location); @@ -1625,28 +1619,28 @@ impl super::Queue { // --- Float 1-4 Component --- // naga::TypeInner::Scalar(naga::Scalar::F32) => { - let data = unsafe { get_data::(data_bytes, offset)[0] }; + let data = get_data::(data_bytes, offset)[0]; unsafe { gl.uniform_1_f32(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Bi, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_2_f32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Tri, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_3_f32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Quad, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_4_f32_slice(location, data) }; } @@ -1654,28 +1648,28 @@ impl super::Queue { // --- Int 1-4 Component --- // naga::TypeInner::Scalar(naga::Scalar::I32) => { - let data = unsafe { get_data::(data_bytes, offset)[0] }; + let data = get_data::(data_bytes, offset)[0]; unsafe { gl.uniform_1_i32(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Bi, scalar: naga::Scalar::I32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_2_i32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Tri, scalar: naga::Scalar::I32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_3_i32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Quad, scalar: naga::Scalar::I32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_4_i32_slice(location, data) }; } @@ -1683,28 +1677,28 @@ impl super::Queue { // --- Uint 1-4 Component --- // naga::TypeInner::Scalar(naga::Scalar::U32) => { - let data = unsafe { get_data::(data_bytes, offset)[0] }; + let data = get_data::(data_bytes, offset)[0]; unsafe { gl.uniform_1_u32(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Bi, scalar: naga::Scalar::U32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_2_u32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Tri, scalar: naga::Scalar::U32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_3_u32_slice(location, data) }; } naga::TypeInner::Vector { size: naga::VectorSize::Quad, scalar: naga::Scalar::U32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_4_u32_slice(location, data) }; } @@ -1716,7 +1710,7 @@ impl super::Queue { rows: naga::VectorSize::Bi, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_2_f32_slice(location, false, data) }; } naga::TypeInner::Matrix { @@ -1725,7 +1719,7 @@ impl super::Queue { scalar: naga::Scalar::F32, } => { // repack 2 vec3s into 6 values. - let unpacked_data = unsafe { get_data::(data_bytes, offset) }; + let unpacked_data = &get_data::(data_bytes, offset); #[rustfmt::skip] let packed_data = [ unpacked_data[0], unpacked_data[1], unpacked_data[2], @@ -1738,7 +1732,7 @@ impl super::Queue { rows: naga::VectorSize::Quad, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_2x4_f32_slice(location, false, data) }; } @@ -1750,7 +1744,7 @@ impl super::Queue { rows: naga::VectorSize::Bi, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_3x2_f32_slice(location, false, data) }; } naga::TypeInner::Matrix { @@ -1759,7 +1753,7 @@ impl super::Queue { scalar: naga::Scalar::F32, } => { // repack 3 vec3s into 9 values. - let unpacked_data = unsafe { get_data::(data_bytes, offset) }; + let unpacked_data = &get_data::(data_bytes, offset); #[rustfmt::skip] let packed_data = [ unpacked_data[0], unpacked_data[1], unpacked_data[2], @@ -1773,7 +1767,7 @@ impl super::Queue { rows: naga::VectorSize::Quad, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_3x4_f32_slice(location, false, data) }; } @@ -1785,7 +1779,7 @@ impl super::Queue { rows: naga::VectorSize::Bi, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_4x2_f32_slice(location, false, data) }; } naga::TypeInner::Matrix { @@ -1794,7 +1788,7 @@ impl super::Queue { scalar: naga::Scalar::F32, } => { // repack 4 vec3s into 12 values. - let unpacked_data = unsafe { get_data::(data_bytes, offset) }; + let unpacked_data = &get_data::(data_bytes, offset); #[rustfmt::skip] let packed_data = [ unpacked_data[0], unpacked_data[1], unpacked_data[2], @@ -1809,7 +1803,7 @@ impl super::Queue { rows: naga::VectorSize::Quad, scalar: naga::Scalar::F32, } => { - let data = unsafe { get_data::(data_bytes, offset) }; + let data = &get_data::(data_bytes, offset); unsafe { gl.uniform_matrix_4_f32_slice(location, false, data) }; } _ => panic!("Unsupported uniform datatype: {:?}!", uniform.ty), diff --git a/third_party/rust/wgpu-hal/src/gles/web.rs b/third_party/rust/wgpu-hal/src/gles/web.rs index ae7f8362233c..06bd87124747 100644 --- a/third_party/rust/wgpu-hal/src/gles/web.rs +++ b/third_party/rust/wgpu-hal/src/gles/web.rs @@ -64,9 +64,10 @@ impl Instance { // “not supported” could include “insufficient GPU resources” or “the GPU process // previously crashed”. So, we must return it as an `Err` since it could occur // for circumstances outside the application author's control. - return Err(crate::InstanceError::new(String::from( - "canvas.getContext() returned null; webgl2 not available or canvas already in use" - ))); + return Err(crate::InstanceError::new(String::from(concat!( + "canvas.getContext() returned null; ", + "webgl2 not available or canvas already in use" + )))); } Err(js_error) => { // diff --git a/third_party/rust/wgpu-hal/src/metal/command.rs b/third_party/rust/wgpu-hal/src/metal/command.rs index 069013570f07..9e38cf865627 100644 --- a/third_party/rust/wgpu-hal/src/metal/command.rs +++ b/third_party/rust/wgpu-hal/src/metal/command.rs @@ -490,7 +490,7 @@ impl crate::CommandEncoder for super::CommandEncoder { wgt::QueryType::Timestamp => { encoder.resolve_counters( set.counter_sample_buffer.as_ref().unwrap(), - metal::NSRange::new(range.start as u64, range.end as u64), + metal::NSRange::new(range.start as u64, (range.end - range.start) as u64), &buffer.raw, offset, ); diff --git a/third_party/rust/wgpu-hal/src/vulkan/command.rs b/third_party/rust/wgpu-hal/src/vulkan/command.rs index 8bd749cd3b00..6b02e35f4e5b 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/command.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/command.rs @@ -503,6 +503,9 @@ impl crate::CommandEncoder for super::CommandEncoder { for triangles in in_geometries { let mut triangle_data = vk::AccelerationStructureGeometryTrianglesDataKHR::default() + // IndexType::NONE_KHR is not set by default (due to being provided by VK_KHR_acceleration_structure) but unless there is an + // index buffer we need to have IndexType::NONE_KHR as our index type. + .index_type(vk::IndexType::NONE_KHR) .vertex_data(vk::DeviceOrHostAddressConstKHR { device_address: get_device_address(triangles.vertex_buffer), }) diff --git a/third_party/rust/wgpu-hal/src/vulkan/device.rs b/third_party/rust/wgpu-hal/src/vulkan/device.rs index 6c3bfc5ed23b..9f0fc67738e6 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/device.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/device.rs @@ -2538,8 +2538,7 @@ impl super::DeviceShared { } None => { crate::hal_usage_error(format!( - "no signals reached value {}", - wait_value + "no signals reached value {wait_value}" )); } } diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs index 5673859e451e..6d56ecf96412 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/instance.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -745,7 +745,12 @@ impl crate::Instance for super::Instance { Ok(sdk_ver) => sdk_ver, Err(err) => { log::error!( - "Couldn't parse Android's ro.build.version.sdk system property ({val}): {err}" + concat!( + "Couldn't parse Android's ", + "ro.build.version.sdk system property ({}): {}", + ), + val, + err, ); 0 } @@ -931,7 +936,10 @@ impl crate::Instance for super::Instance { if version < (21, 2) { // See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688 log::warn!( - "Disabling presentation on '{}' (id {:?}) due to NV Optimus and Intel Mesa < v21.2", + concat!( + "Disabling presentation on '{}' (id {:?}) ", + "due to NV Optimus and Intel Mesa < v21.2" + ), exposed.info.name, exposed.adapter.raw ); diff --git a/third_party/rust/wgpu-hal/src/vulkan/mod.rs b/third_party/rust/wgpu-hal/src/vulkan/mod.rs index 843b836f46af..3b0f026fdefc 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/mod.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/mod.rs @@ -418,7 +418,13 @@ impl Surface { swapchain.next_present_time = Some(present_timing); } else { // Ideally we'd use something like `device.required_features` here, but that's in `wgpu-core`, which we are a dependency of - panic!("Tried to set display timing properties without the corresponding feature ({features:?}) enabled."); + panic!( + concat!( + "Tried to set display timing properties ", + "without the corresponding feature ({:?}) enabled." + ), + features + ); } } }