tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 64788e622c1ef22e73a15dee35034ee4364a000e
parent 4f6c6f86d721a4a310bb97a4fb547ddf1ffbfcc6
Author: Erich Gubler <erichdongubler@gmail.com>
Date:   Mon,  5 Jan 2026 17:52:13 +0000

Bug 2007791 - chore(webgpu): update wgpu to a2c8c0de7cdb57a74070ce70b9912e853893d502 r=webgpu-reviewers,supply-chain-reviewers,nical

Notes:

- Most changes in expected permanent outcomes are driven by migration of wgpu to the next `maxInterStageShaderVariables` limit, dropping the old `maxInterStageShaderComponents` limit.
  - Some of CTS' tests for this limit are actually incorrect, while wgpu is correct. I'm filing up (and have even landed in CTS upstream) some work to correct them. See [gpuweb/cts#4538](https://github.com/gpuweb/cts/issues/4538) for more details.
  - CTS isn't entirely to blame; I did make one check for fragment built-in inputs too restrictive. This has been corrected with [wgpu#8792](https://github.com/gfx-rs/wgpu/pull/8792).
- I decided to roll a `spirv` upgrade into this: 0.3.0+sdk-1.3.268.0 → 0.3.0+sdk-1.4.309.0@git:89ce4d0e64c91b0635f617409dc57cb031749a39

  …since it's only used by this, and most changes should go away after the `spirv` releases its current mainline history.

Differential Revision: https://phabricator.services.mozilla.com/D277553

Diffstat:
M.cargo/config.toml.in | 9+++++++--
MCargo.lock | 19++++++++++---------
Mgfx/wgpu_bindings/Cargo.toml | 12++++++------
Mgfx/wgpu_bindings/moz.yaml | 4++--
Mgfx/wgpu_bindings/src/server.rs | 3++-
Msupply-chain/audits.toml | 48++++++++++++++++++++++++++++++++++++------------
Msupply-chain/config.toml | 4++++
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxInterStageShaderVariables/cts.https.html.ini | 254+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/image_copy/layout_related/cts.https.html.ini | 10++++++++++
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/depth_stencil_state/cts.https.html.ini | 67-------------------------------------------------------------------
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/fragment_state/cts.https.html.ini | 47+++++++++++++++++++++++++++++++----------------
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/inter_stage/cts.https.html.ini | 24++++++++++++++++--------
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/state/device_lost/destroy/cts.https.html.ini | 27+++++++++++++++++++--------
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/subgroupAdd/cts.https.html.ini | 2++
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureLoad/cts.https.html.ini | 2+-
Mtesting/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/robust_access_vertex/cts.https.html.ini | 5++---
Mthird_party/rust/naga/.cargo-checksum.json | 4++--
Mthird_party/rust/naga/Cargo.toml | 6++++++
Mthird_party/rust/naga/src/back/dot/mod.rs | 22++++++++++++++++++++++
Mthird_party/rust/naga/src/back/glsl/writer.rs | 8++++++--
Mthird_party/rust/naga/src/back/hlsl/writer.rs | 7++++++-
Mthird_party/rust/naga/src/back/mod.rs | 6++----
Mthird_party/rust/naga/src/back/msl/keywords.rs | 2++
Mthird_party/rust/naga/src/back/msl/mod.rs | 4+++-
Mthird_party/rust/naga/src/back/msl/writer.rs | 208++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mthird_party/rust/naga/src/back/pipeline_constants.rs | 24+++++++++++++++++++++++-
Mthird_party/rust/naga/src/back/spv/block.rs | 115+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mthird_party/rust/naga/src/back/spv/instructions.rs | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/rust/naga/src/back/spv/mod.rs | 32++++++++++++++++++++++++++++++++
Mthird_party/rust/naga/src/back/spv/writer.rs | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
Mthird_party/rust/naga/src/back/wgsl/writer.rs | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/rust/naga/src/common/wgsl/to_wgsl.rs | 20++++++++++++++------
Mthird_party/rust/naga/src/common/wgsl/types.rs | 15+++++++++++++++
Mthird_party/rust/naga/src/compact/expressions.rs | 22++++++++++++++++++++++
Mthird_party/rust/naga/src/compact/statements.rs | 13+++++++++++++
Mthird_party/rust/naga/src/compact/types.rs | 2++
Mthird_party/rust/naga/src/front/spv/mod.rs | 1+
Mthird_party/rust/naga/src/front/wgsl/error.rs | 18++++++++++++++++++
Mthird_party/rust/naga/src/front/wgsl/lower/construction.rs | 23+++++++++++++++++++++++
Mthird_party/rust/naga/src/front/wgsl/lower/conversion.rs | 2++
Mthird_party/rust/naga/src/front/wgsl/lower/mod.rs | 138+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
Mthird_party/rust/naga/src/front/wgsl/parse/ast.rs | 23+++++++++++++++++++++++
Mthird_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs | 11+++++++++++
Mthird_party/rust/naga/src/front/wgsl/parse/lexer.rs | 12++++++++++++
Mthird_party/rust/naga/src/front/wgsl/parse/mod.rs | 74+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mthird_party/rust/naga/src/ir/mod.rs | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/rust/naga/src/proc/constant_evaluator.rs | 5+++++
Mthird_party/rust/naga/src/proc/layouter.rs | 19+++++++++++++++++++
Mthird_party/rust/naga/src/proc/terminator.rs | 3++-
Mthird_party/rust/naga/src/proc/type_methods.rs | 15++++++++++++---
Mthird_party/rust/naga/src/proc/typifier.rs | 46+++++++++++++++++++++++++++++++++++++++++++++-
Mthird_party/rust/naga/src/valid/analyzer.rs | 19+++++++++++++++++++
Mthird_party/rust/naga/src/valid/expression.rs | 43++++++++++++++++++++++++++++++++++++++++---
Mthird_party/rust/naga/src/valid/function.rs | 42+++++++++++++++++++++++++++++++++++++++---
Mthird_party/rust/naga/src/valid/handles.rs | 13+++++++++++++
Mthird_party/rust/naga/src/valid/mod.rs | 3+++
Mthird_party/rust/naga/src/valid/type.rs | 24++++++++++++++++++++++++
Mthird_party/rust/spirv/.cargo-checksum.json | 4++--
Mthird_party/rust/spirv/Cargo.toml | 32++++++++++++++++++++------------
Mthird_party/rust/spirv/README.md | 9---------
Mthird_party/rust/spirv/autogen_spirv.rs | 2644++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
Mthird_party/rust/spirv/lib.rs | 1+
Mthird_party/rust/wgpu-core/.cargo-checksum.json | 4++--
Mthird_party/rust/wgpu-core/Cargo.toml | 2--
Mthird_party/rust/wgpu-core/src/command/mod.rs | 6+++---
Mthird_party/rust/wgpu-core/src/device/mod.rs | 4++++
Mthird_party/rust/wgpu-core/src/device/resource.rs | 75+++++++++++++++++++++++++++++++++++++++++++++++----------------------------
Mthird_party/rust/wgpu-core/src/global.rs | 2+-
Mthird_party/rust/wgpu-core/src/instance.rs | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++--------
Mthird_party/rust/wgpu-core/src/pipeline.rs | 6++++--
Mthird_party/rust/wgpu-core/src/validation.rs | 343+++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------
Athird_party/rust/wgpu-core/src/validation/shader_io_deductions.rs | 156+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/rust/wgpu-hal/.cargo-checksum.json | 4++--
Mthird_party/rust/wgpu-hal/Cargo.toml | 10++++++++++
Mthird_party/rust/wgpu-hal/examples/halmark/main.rs | 7+++++--
Mthird_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs | 7+++++--
Mthird_party/rust/wgpu-hal/src/dx12/adapter.rs | 3++-
Mthird_party/rust/wgpu-hal/src/dx12/instance.rs | 2+-
Mthird_party/rust/wgpu-hal/src/gles/adapter.rs | 9+++++----
Mthird_party/rust/wgpu-hal/src/gles/egl.rs | 445+++++++++++++++++++++++--------------------------------------------------------
Mthird_party/rust/wgpu-hal/src/gles/web.rs | 2+-
Mthird_party/rust/wgpu-hal/src/gles/wgl.rs | 2+-
Mthird_party/rust/wgpu-hal/src/lib.rs | 12++++++++++--
Mthird_party/rust/wgpu-hal/src/metal/adapter.rs | 64+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
Mthird_party/rust/wgpu-hal/src/metal/mod.rs | 3++-
Mthird_party/rust/wgpu-hal/src/noop/mod.rs | 6++++--
Mthird_party/rust/wgpu-hal/src/vulkan/adapter.rs | 201+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mthird_party/rust/wgpu-hal/src/vulkan/instance.rs | 4++--
Mthird_party/rust/wgpu-types/.cargo-checksum.json | 4++--
Mthird_party/rust/wgpu-types/Cargo.toml | 4++++
Mthird_party/rust/wgpu-types/src/adapter.rs | 39+++++++++++++++++++++++++++++++++++++++
Mthird_party/rust/wgpu-types/src/features.rs | 46+++++++++++++++++++++++++++++++++-------------
Mthird_party/rust/wgpu-types/src/instance.rs | 39++++++++++++++++++++++++++++++++++++++-
Mthird_party/rust/wgpu-types/src/lib.rs | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
Mthird_party/rust/wgpu-types/src/limits.rs | 21+++++++++++----------
95 files changed, 4301 insertions(+), 1877 deletions(-)

diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in @@ -35,9 +35,14 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc"] +[source."git+https://github.com/gfx-rs/rspirv?rev=89ce4d0e64c91b0635f617409dc57cb031749a39"] +git = "https://github.com/gfx-rs/rspirv" +rev = "89ce4d0e64c91b0635f617409dc57cb031749a39" +replace-with = "vendored-sources" + +[source."git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502"] git = "https://github.com/gfx-rs/wgpu" -rev = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" replace-with = "vendored-sources" [source."git+https://github.com/glandium/allocator-api2?rev=ad5f3d56a5a4519eff52af4ff85293431466ef5c"] diff --git a/Cargo.lock b/Cargo.lock @@ -4784,7 +4784,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "arrayvec", "bit-set", @@ -6552,9 +6552,8 @@ dependencies = [ [[package]] name = "spirv" -version = "0.3.0+sdk-1.3.268.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +version = "0.3.0+sdk-1.4.309.0" +source = "git+https://github.com/gfx-rs/rspirv?rev=89ce4d0e64c91b0635f617409dc57cb031749a39#89ce4d0e64c91b0635f617409dc57cb031749a39" dependencies = [ "bitflags 2.9.0", ] @@ -7981,7 +7980,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "arrayvec", "bit-set", @@ -7998,6 +7997,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", + "raw-window-handle", "ron", "rustc-hash 1.999.999", "serde", @@ -8012,7 +8012,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "wgpu-hal", ] @@ -8020,7 +8020,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-windows-linux-android" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "wgpu-hal", ] @@ -8028,7 +8028,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "android_system_properties", "arrayvec", @@ -8065,12 +8065,13 @@ dependencies = [ [[package]] name = "wgpu-types" version = "28.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc#3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +source = "git+https://github.com/gfx-rs/wgpu?rev=a2c8c0de7cdb57a74070ce70b9912e853893d502#a2c8c0de7cdb57a74070ce70b9912e853893d502" dependencies = [ "bitflags 2.9.0", "bytemuck", "js-sys", "log", + "raw-window-handle", "serde", "web-sys", ] diff --git 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 = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" features = ["serde", "trace", "strict_asserts", "wgsl", "api_log_info"] # We want the wgpu-core Metal backend on macOS and iOS. @@ -25,32 +25,32 @@ features = ["serde", "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 = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" 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 = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" 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 = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +rev = "a2c8c0de7cdb57a74070ce70b9912e853893d502" features = ["device_lost_panic", "internal_error_panic"] [target.'cfg(windows)'.dependencies] diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml @@ -8,8 +8,8 @@ origin: name: wgpu description: A cross-platform pure-Rust graphics API, modeled on the WebGPU standard url: https://github.com/gfx-rs/wgpu - release: 3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc (Wed Dec 17 22:05:10 2025 -0500) - revision: 3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc + release: a2c8c0de7cdb57a74070ce70b9912e853893d502 (2025-12-23T21:09:17Z). + revision: a2c8c0de7cdb57a74070ce70b9912e853893d502 license: ['MIT', 'Apache-2.0'] updatebot: diff --git a/gfx/wgpu_bindings/src/server.rs b/gfx/wgpu_bindings/src/server.rs @@ -151,7 +151,7 @@ pub extern "C" fn wgpu_server_new(owner: WebGPUParentPtr) -> *mut Global { let global = wgc::global::Global::new( "wgpu", - &wgt::InstanceDescriptor { + wgt::InstanceDescriptor { backends, flags: instance_flags, backend_options: wgt::BackendOptions { @@ -169,6 +169,7 @@ pub extern "C" fn wgpu_server_new(owner: WebGPUParentPtr) -> *mut Global { for_resource_creation: Some(95), for_device_loss: Some(99), }, + display: None, }, None, ); diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml @@ -4381,9 +4381,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.naga]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.net2]] @@ -5837,6 +5840,12 @@ who = "Nicolas Silva <nical@fastmail.com>" criteria = "safe-to-deploy" delta = "0.2.0+1.5.4 -> 0.3.0+sdk-1.3.268.0" +[[audits.spirv]] +who = "Erich Gubler <erichdongubler@gmail.com>" +criteria = "safe-to-deploy" +delta = "0.3.0+sdk-1.3.268.0 -> 0.3.0+sdk-1.4.309.0@git:89ce4d0e64c91b0635f617409dc57cb031749a39" +importable = false + [[audits.strck]] who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>" criteria = "safe-to-deploy" @@ -6983,9 +6992,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.wgpu-core]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.wgpu-core-deps-apple]] @@ -7019,9 +7031,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.wgpu-core-deps-apple]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.wgpu-core-deps-windows-linux-android]] @@ -7055,9 +7070,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.wgpu-core-deps-windows-linux-android]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.wgpu-hal]] @@ -7169,9 +7187,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.wgpu-hal]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.wgpu-types]] @@ -7278,9 +7299,12 @@ criteria = "safe-to-deploy" delta = "27.0.0 -> 28.0.0" [[audits.wgpu-types]] -who = "Jim Blandy <jimb@red-bean.com>" +who = [ + "Jim Blandy <jimb@red-bean.com>", + "Erich Gubler <erichdongubler@gmail.com>", +] criteria = "safe-to-deploy" -delta = "28.0.0 -> 28.0.0@git:3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc" +delta = "28.0.0 -> 28.0.0@git:a2c8c0de7cdb57a74070ce70b9912e853893d502" importable = false [[audits.whatsys]] diff --git a/supply-chain/config.toml b/supply-chain/config.toml @@ -227,6 +227,10 @@ notes = "This is a first-party crate which is also published to crates.io, but w audit-as-crates-io = true notes = "This is a first-party crate which is also published to crates.io, but we should publish audits for it for the benefit of the ecosystem." +[policy.spirv] +audit-as-crates-io = true +notes = "Contains only upstream mainline history pending release." + [policy.storage] audit-as-crates-io = false notes = "This is a first-party crate which is entirely unrelated to the crates.io package of the same name." diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxInterStageShaderVariables/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxInterStageShaderVariables/cts.https.html.ini @@ -2,12 +2,8 @@ tags: [webgpu, webgpu-long] implementation-status: backlog [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] - expected: - if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -18,24 +14,40 @@ [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -50,32 +62,44 @@ [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] - - [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: if os == "win": FAIL + [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] + [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -86,24 +110,40 @@ [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -118,24 +158,40 @@ [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="atDefault";testValueName="overLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: @@ -458,12 +514,8 @@ if os == "mac": FAIL [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] - expected: - if os == "win": FAIL [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: @@ -483,10 +535,12 @@ [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -499,26 +553,32 @@ [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -547,10 +607,12 @@ [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -563,35 +625,37 @@ [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] - expected: - if os == "win": FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: @@ -611,10 +675,12 @@ [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -627,26 +693,32 @@ [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: + if os == "win" and debug: FAIL if os == "win" and not debug: [PASS, FAIL] [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -692,26 +764,32 @@ [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] expected: if os == "win" and debug: [PASS, FAIL] + if os == "win" and not debug: FAIL [:limitTest="atMaximum";testValueName="overLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: @@ -1062,12 +1140,8 @@ if os == "mac": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] - expected: - if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -1078,24 +1152,40 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -1110,32 +1200,44 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] - - [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: if os == "win": FAIL + [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] + [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -1146,24 +1248,40 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -1178,24 +1296,40 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: @@ -1798,12 +1932,8 @@ [:limitTest="overMaximum";testValueName="overLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] - expected: - if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -1814,24 +1944,40 @@ [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -1846,32 +1992,44 @@ [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=false;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] - - [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: if os == "win": FAIL + [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] + [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] - expected: - if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] @@ -1882,24 +2040,40 @@ [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=false;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] @@ -1914,24 +2088,40 @@ [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=false;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=true] [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=false;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=false;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=false] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="atLimit";async=true;pointList=true;frontFacing=true;sampleIndex=true;sampleMaskIn=true;sampleMaskOut=true] + expected: + if os == "win": FAIL [:limitTest="underDefault";testValueName="overLimit";async=false;pointList=false;frontFacing=false;sampleIndex=false;sampleMaskIn=false;sampleMaskOut=false] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/image_copy/layout_related/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/image_copy/layout_related/cts.https.html.ini @@ -2714,6 +2714,8 @@ expected: if os == "mac": [OK, TIMEOUT] [:method="CopyB2T"] + expected: + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:method="CopyT2B"] expected: @@ -2730,12 +2732,20 @@ expected: if os == "mac": [OK, TIMEOUT] [:method="CopyB2T";dimension="1d";size=[4,1,1\]] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:method="CopyB2T";dimension="2d";size=[4,4,1\]] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:method="CopyB2T";dimension="2d";size=[4,4,3\]] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:method="CopyB2T";dimension="3d";size=[4,4,3\]] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:method="CopyT2B";dimension="1d";size=[4,1,1\]] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/depth_stencil_state/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/depth_stencil_state/cts.https.html.ini @@ -381,7 +381,6 @@ [cts.https.html?q=webgpu:api,validation,render_pipeline,depth_stencil_state:format:*] - implementation-status: backlog [:isAsync=false;format="astc-10x10-unorm"] [:isAsync=false;format="astc-10x10-unorm-srgb"] @@ -467,10 +466,8 @@ [:isAsync=false;format="bc7-rgba-unorm-srgb"] [:isAsync=false;format="bgra8unorm"] - expected: FAIL [:isAsync=false;format="bgra8unorm-srgb"] - expected: FAIL [:isAsync=false;format="depth16unorm"] @@ -503,117 +500,86 @@ [:isAsync=false;format="etc2-rgba8unorm-srgb"] [:isAsync=false;format="r16float"] - expected: FAIL [:isAsync=false;format="r16sint"] - expected: FAIL [:isAsync=false;format="r16snorm"] [:isAsync=false;format="r16uint"] - expected: FAIL [:isAsync=false;format="r16unorm"] [:isAsync=false;format="r32float"] - expected: FAIL [:isAsync=false;format="r32sint"] - expected: FAIL [:isAsync=false;format="r32uint"] - expected: FAIL [:isAsync=false;format="r8sint"] - expected: FAIL [:isAsync=false;format="r8snorm"] [:isAsync=false;format="r8uint"] - expected: FAIL [:isAsync=false;format="r8unorm"] - expected: FAIL [:isAsync=false;format="rg11b10ufloat"] - expected: FAIL [:isAsync=false;format="rg16float"] - expected: FAIL [:isAsync=false;format="rg16sint"] - expected: FAIL [:isAsync=false;format="rg16snorm"] [:isAsync=false;format="rg16uint"] - expected: FAIL [:isAsync=false;format="rg16unorm"] [:isAsync=false;format="rg32float"] - expected: FAIL [:isAsync=false;format="rg32sint"] - expected: FAIL [:isAsync=false;format="rg32uint"] - expected: FAIL [:isAsync=false;format="rg8sint"] - expected: FAIL [:isAsync=false;format="rg8snorm"] [:isAsync=false;format="rg8uint"] - expected: FAIL [:isAsync=false;format="rg8unorm"] - expected: FAIL [:isAsync=false;format="rgb10a2uint"] - expected: FAIL [:isAsync=false;format="rgb10a2unorm"] - expected: FAIL [:isAsync=false;format="rgb9e5ufloat"] [:isAsync=false;format="rgba16float"] - expected: FAIL [:isAsync=false;format="rgba16sint"] - expected: FAIL [:isAsync=false;format="rgba16snorm"] [:isAsync=false;format="rgba16uint"] - expected: FAIL [:isAsync=false;format="rgba16unorm"] [:isAsync=false;format="rgba32float"] - expected: FAIL [:isAsync=false;format="rgba32sint"] - expected: FAIL [:isAsync=false;format="rgba32uint"] - expected: FAIL [:isAsync=false;format="rgba8sint"] - expected: FAIL [:isAsync=false;format="rgba8snorm"] [:isAsync=false;format="rgba8uint"] - expected: FAIL [:isAsync=false;format="rgba8unorm"] - expected: FAIL [:isAsync=false;format="rgba8unorm-srgb"] - expected: FAIL [:isAsync=false;format="stencil8"] @@ -702,10 +668,8 @@ [:isAsync=true;format="bc7-rgba-unorm-srgb"] [:isAsync=true;format="bgra8unorm"] - expected: FAIL [:isAsync=true;format="bgra8unorm-srgb"] - expected: FAIL [:isAsync=true;format="depth16unorm"] @@ -738,117 +702,86 @@ [:isAsync=true;format="etc2-rgba8unorm-srgb"] [:isAsync=true;format="r16float"] - expected: FAIL [:isAsync=true;format="r16sint"] - expected: FAIL [:isAsync=true;format="r16snorm"] [:isAsync=true;format="r16uint"] - expected: FAIL [:isAsync=true;format="r16unorm"] [:isAsync=true;format="r32float"] - expected: FAIL [:isAsync=true;format="r32sint"] - expected: FAIL [:isAsync=true;format="r32uint"] - expected: FAIL [:isAsync=true;format="r8sint"] - expected: FAIL [:isAsync=true;format="r8snorm"] [:isAsync=true;format="r8uint"] - expected: FAIL [:isAsync=true;format="r8unorm"] - expected: FAIL [:isAsync=true;format="rg11b10ufloat"] - expected: FAIL [:isAsync=true;format="rg16float"] - expected: FAIL [:isAsync=true;format="rg16sint"] - expected: FAIL [:isAsync=true;format="rg16snorm"] [:isAsync=true;format="rg16uint"] - expected: FAIL [:isAsync=true;format="rg16unorm"] [:isAsync=true;format="rg32float"] - expected: FAIL [:isAsync=true;format="rg32sint"] - expected: FAIL [:isAsync=true;format="rg32uint"] - expected: FAIL [:isAsync=true;format="rg8sint"] - expected: FAIL [:isAsync=true;format="rg8snorm"] [:isAsync=true;format="rg8uint"] - expected: FAIL [:isAsync=true;format="rg8unorm"] - expected: FAIL [:isAsync=true;format="rgb10a2uint"] - expected: FAIL [:isAsync=true;format="rgb10a2unorm"] - expected: FAIL [:isAsync=true;format="rgb9e5ufloat"] [:isAsync=true;format="rgba16float"] - expected: FAIL [:isAsync=true;format="rgba16sint"] - expected: FAIL [:isAsync=true;format="rgba16snorm"] [:isAsync=true;format="rgba16uint"] - expected: FAIL [:isAsync=true;format="rgba16unorm"] [:isAsync=true;format="rgba32float"] - expected: FAIL [:isAsync=true;format="rgba32sint"] - expected: FAIL [:isAsync=true;format="rgba32uint"] - expected: FAIL [:isAsync=true;format="rgba8sint"] - expected: FAIL [:isAsync=true;format="rgba8snorm"] [:isAsync=true;format="rgba8uint"] - expected: FAIL [:isAsync=true;format="rgba8unorm"] - expected: FAIL [:isAsync=true;format="rgba8unorm-srgb"] - expected: FAIL [:isAsync=true;format="stencil8"] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/fragment_state/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/fragment_state/cts.https.html.ini @@ -5481,7 +5481,8 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="one"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="one-minus-constant"] expected: @@ -5497,7 +5498,8 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="one-minus-src"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="one-minus-src-alpha"] expected: @@ -5513,11 +5515,13 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="src"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="src-alpha"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="src-alpha-saturated"] expected: @@ -5533,20 +5537,23 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaDstFactor="zero"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="constant"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="dst"] expected: if os == "mac" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "mac" and not debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="dst-alpha"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one"] expected: @@ -5555,15 +5562,18 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-constant"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-dst"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-dst-alpha"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-src"] expected: @@ -5577,11 +5587,13 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-src1"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="one-minus-src1-alpha"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="src"] expected: @@ -5595,15 +5607,18 @@ [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="src-alpha-saturated"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="src1"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="src1-alpha"] expected: - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:isAsync=true;format="rgba8unorm";componentCount=2;alphaSrcFactor="zero"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/inter_stage/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/render_pipeline/inter_stage/cts.https.html.ini @@ -119,25 +119,33 @@ [cts.https.html?q=webgpu:api,validation,render_pipeline,inter_stage:max_shader_variable_location:*] - implementation-status: backlog + implementation-status: + if os == "linux": backlog + if os == "mac": backlog [:isAsync=false;locationDelta=-1] [:isAsync=false;locationDelta=-2] [:isAsync=false;locationDelta=0] - expected: FAIL + expected: + if os == "linux": FAIL + if os == "mac": FAIL [:isAsync=true;locationDelta=-1] [:isAsync=true;locationDelta=-2] [:isAsync=true;locationDelta=0] - expected: FAIL + expected: + if os == "linux": FAIL + if os == "mac": FAIL [cts.https.html?q=webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:*] implementation-status: backlog [:isAsync=false;numVariablesDelta=-1;useExtraBuiltinInputs=true] + expected: + if os == "win": FAIL [:isAsync=false;numVariablesDelta=0;useExtraBuiltinInputs=false] expected: @@ -154,6 +162,8 @@ if os == "mac": FAIL [:isAsync=true;numVariablesDelta=-1;useExtraBuiltinInputs=true] + expected: + if os == "win": FAIL [:isAsync=true;numVariablesDelta=0;useExtraBuiltinInputs=false] expected: @@ -171,7 +181,9 @@ [cts.https.html?q=webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,output:*] - implementation-status: backlog + implementation-status: + if os == "linux": backlog + if os == "mac": backlog [:isAsync=false;numVariablesDelta=-1;topology="point-list"] [:isAsync=false;numVariablesDelta=0;topology="point-list"] @@ -180,8 +192,6 @@ if os == "mac": FAIL [:isAsync=false;numVariablesDelta=0;topology="triangle-list"] - expected: - if os == "win": FAIL [:isAsync=false;numVariablesDelta=1;topology="triangle-list"] expected: @@ -196,8 +206,6 @@ if os == "mac": FAIL [:isAsync=true;numVariablesDelta=0;topology="triangle-list"] - expected: - if os == "win": FAIL [:isAsync=true;numVariablesDelta=1;topology="triangle-list"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/state/device_lost/destroy/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/state/device_lost/destroy/cts.https.html.ini @@ -2283,11 +2283,11 @@ [:format="eac-rg11snorm";usageType="texture";usageCopy="none";awaitLost=false] expected: - if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac": [PASS, TIMEOUT, NOTRUN] [:format="eac-rg11snorm";usageType="texture";usageCopy="none";awaitLost=true] expected: - if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac": [PASS, TIMEOUT, NOTRUN] [:format="eac-rg11snorm";usageType="texture";usageCopy="src";awaitLost=false] expected: @@ -2295,7 +2295,7 @@ [:format="eac-rg11snorm";usageType="texture";usageCopy="src";awaitLost=true] expected: - if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac": [PASS, TIMEOUT, NOTRUN] [:format="eac-rg11snorm";usageType="texture";usageCopy="src-dest";awaitLost=false] expected: @@ -2319,7 +2319,7 @@ [:format="eac-rg11unorm";usageType="texture";usageCopy="src-dest";awaitLost=false] expected: - if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac": [PASS, TIMEOUT, NOTRUN] [:format="eac-rg11unorm";usageType="texture";usageCopy="src-dest";awaitLost=true] @@ -4740,9 +4740,15 @@ if os == "mac": [PASS, TIMEOUT, NOTRUN] [:format="rg8uint";usageType="storage";usageCopy="dst";awaitLost=false] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:format="rg8uint";usageType="storage";usageCopy="dst";awaitLost=true] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux": FAIL + if os == "mac" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "mac" and not debug: FAIL [:format="rg8uint";usageType="storage";usageCopy="none";awaitLost=false] @@ -4750,6 +4756,8 @@ expected: FAIL [:format="rg8uint";usageType="storage";usageCopy="src";awaitLost=false] + expected: + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:format="rg8uint";usageType="storage";usageCopy="src";awaitLost=true] expected: FAIL @@ -5639,13 +5647,15 @@ [:format="rgba8sint";usageType="storage";usageCopy="none";awaitLost=false] expected: - if os == "win": [FAIL, TIMEOUT, NOTRUN] + if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [TIMEOUT, NOTRUN] [:format="rgba8sint";usageType="storage";usageCopy="none";awaitLost=true] expected: - if os == "win": [FAIL, TIMEOUT, NOTRUN] + if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [TIMEOUT, NOTRUN] @@ -5720,7 +5730,8 @@ [:format="rgba8sint";usageType="texture";usageCopy="src-dest";awaitLost=false] expected: - if os == "win": [FAIL, TIMEOUT, NOTRUN] + if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [TIMEOUT, NOTRUN] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/subgroupAdd/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/subgroupAdd/cts.https.html.ini @@ -9394,6 +9394,7 @@ [:case=740;type="f16";wgSize=[64,2,1\]] expected: if os == "win": [PASS, TIMEOUT, NOTRUN] + if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [TIMEOUT, NOTRUN] [:case=740;type="f32";wgSize=[128,1,1\]] @@ -9421,6 +9422,7 @@ [:case=741;type="f32";wgSize=[128,1,1\]] expected: if os == "win": [PASS, TIMEOUT, NOTRUN] + if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [TIMEOUT, NOTRUN] [:case=741;type="f32";wgSize=[64,2,1\]] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureLoad/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureLoad/cts.https.html.ini @@ -385,7 +385,7 @@ [:stage="f";format="bc5-rg-snorm";texture_type="texture_2d_array"] expected: - if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:stage="f";format="bc5-rg-unorm";texture_type="texture_2d_array"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/robust_access_vertex/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/robust_access_vertex/cts.https.html.ini @@ -257,8 +257,7 @@ [:indexed=true;indirect=false;drawCallTestParameter="baseVertex";type="float32x4";additionalBuffers=0;partialLastNumber=false;offsetVertexBuffer=true] expected: - if os == "linux" and debug: [PASS, FAIL] - if os == "linux" and not debug: FAIL + if os == "linux": [PASS, FAIL] [:indexed=true;indirect=false;drawCallTestParameter="baseVertex";type="float32x4";additionalBuffers=0;partialLastNumber=true;offsetVertexBuffer=false] @@ -297,7 +296,7 @@ [:indexed=true;indirect=false;drawCallTestParameter="vertexCountInIndexBuffer";type="float32x2";additionalBuffers=0;partialLastNumber=false;offsetVertexBuffer=true] expected: - if os == "linux" and debug: FAIL + if os == "linux": [PASS, FAIL] [:indexed=true;indirect=false;drawCallTestParameter="vertexCountInIndexBuffer";type="float32x2";additionalBuffers=0;partialLastNumber=true;offsetVertexBuffer=false] diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo/config.toml":"7248ed3bed246d755d7bf9e5d7842d74b5c270ba6c29ad907872b55a67707ee0","CHANGELOG.md":"e60105d413f857e37dae165f819c47491d0a595183d3c9146b259d811b98b14f","Cargo.toml":"7c9b3a811e078f9db2b84cf946b1787048aa87b6f3407f1121809f2592fac45b","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","README.md":"9550cbc1a518ad0f624aabe12c342c72f670705cb4a6878c0c87d172f1dacea0","build.rs":"e9098f486e87d91710c07d40f1b32716e5debfe94a0b5e53e37075b0ee997eec","src/arena/handle.rs":"897b2b0eebe0d9ae6a65bf2e8c210c8391924da06ef4c9e2a1225ad622400b6c","src/arena/handle_set.rs":"5c2a0bcf41d85c8173ac68b2d439552e79d0c3c0fe1ff3b1e1a48f0c83a4d48f","src/arena/handlevec.rs":"baaed995bcbd2f7d15bd63cede28e579175d408e5a40289f74b32ab65c6850c3","src/arena/mod.rs":"e305d0521233791e181b4b6e7de70175a6bc730811063ea066c3bd3b73d12979","src/arena/range.rs":"b783969dfe32b4937593d871aa5190d561bdd79b6f615da53cb54346e300b9e2","src/arena/unique_arena.rs":"0e2d1c372a7c40b77793dc413b8920e86459e4656775a010f32974b4ad67a7fd","src/back/continue_forward.rs":"8194d238763caa6d5601ec3af56ba39a471c39945f43152b58d582092c99aefa","src/back/dot/mod.rs":"3f63a91f4afde7bedb3163489a347ccfa4b833e1fc7a0f33ccd8817efc7d303a","src/back/glsl/conv.rs":"927aa5ec3c3b6c0d8a391373ea7e285a93d4711372e82fad5cb22013830cb868","src/back/glsl/features.rs":"3ca9a7b28327ac400a9fd439f3cc0c944fc938b5d52d0be58f58c0ea3fbf3f15","src/back/glsl/keywords.rs":"fee8ed132e44bace54869a7c169a1ab7ed55db1bf590b4b1bce9efa4552e1dd7","src/back/glsl/mod.rs":"74940fe468a13a4fcdd860b458a31e1b9ca7705ef7e9d265097a543b115ec490","src/back/glsl/writer.rs":"f1c78877a171eee8b1deb8e9505a8b06074dbe8b979e7fa89d267b471d5b3045","src/back/hlsl/conv.rs":"5da58838c166b753f135689a72b2bb46811269303c6104f8f483eeed93332ec3","src/back/hlsl/help.rs":"12ddb9d08fe64eb34b66ae2166edffce5106a04ccef0b8cc0391a6fafd676270","src/back/hlsl/keywords.rs":"f7fc06c44d2f0d620bcf1a02b699c98c32059741b771a0d1ba5645d71b2f433f","src/back/hlsl/mod.rs":"ed900ac6f261fba33c593b8d440f08917f7e65ebf19b8684f39bff7fb6e4f194","src/back/hlsl/ray.rs":"259db3bc8fd5b8ec343fb8620c7cef50048cbea2b9db1f17dc8813ff848269df","src/back/hlsl/storage.rs":"5083d03b1f25fe767e45e0c507bd30424352fccd48484c081620712d3682aae8","src/back/hlsl/writer.rs":"14cf359afd1291a8e9757fc53fd8656b046f8670a95cdec868cdec6aac677efa","src/back/mod.rs":"a561131429ad34cb9ef658e14f7e1b005b99fc11140326f433c8d724a20904ff","src/back/msl/keywords.rs":"762f47eaa5c395def2fd02f49cb387e5aec7a08c65f3377fa1f0408667a6c286","src/back/msl/mod.rs":"24fb03b7e5b8c8ac7e01f6858487619e09620db775a917c451528cc862aa1d9b","src/back/msl/sampler.rs":"db6c01814d939f1f52eb315e39f34494129c942fa114b11213035c5e3736ed18","src/back/msl/writer.rs":"16a01752592ef4147c4e19ddbd3b3130cc15449caf03ce1cfa2dd1fc384d4dd3","src/back/pipeline_constants.rs":"2d1ac050e587d23adc785ebcfe7120e743878101a63c4af4e62a88641fde5b43","src/back/spv/block.rs":"be008dd0083ddab2324c6075be4134c43a376356a50da75c3613a078cda638e2","src/back/spv/f16_polyfill.rs":"44ce07ef497dff13a9152eb9bc5936c486ef53de6d476da6b0a39396b0e6abdb","src/back/spv/helpers.rs":"8f7e158ca104a4f7a360c4019be67859d7c5c7dce3b44d500a45da01c2826e45","src/back/spv/image.rs":"105b5f8286d6afaabbb6fd7a5f86380274bae4011f3ba28c4f860c3694678557","src/back/spv/index.rs":"c410c0596c047c278def6b073a6373d233d53642a4c3f5a9be8cb53ca23d9c7d","src/back/spv/instructions.rs":"09117b61f340b34c4660089fd909e203e651214ae52282c80c784699b2dce6d0","src/back/spv/layout.rs":"28ba27739d7c9fa4b9e363ffc112cdc39c5e8ec4236d71a7260039d1bd8321d7","src/back/spv/mesh_shader.rs":"8687c7e45557fa85d144a68fba5510431a2000cd10d31d36684a4ec908e6a967","src/back/spv/mod.rs":"a1fc88e0ec0773a4dcbd901b404d35e334ccb3a034453c0cb9d09e7d510a6677","src/back/spv/ray.rs":"766b673bdcee4c5665ebd46775d89eebecd3bdfebbe8347d3fecf6a718286bbb","src/back/spv/recyclable.rs":"8ea397d4d8d3f2cd5fbc8e0be94d136c2d6e0f0e8a4b5eb567dcc1be104c9ae5","src/back/spv/selection.rs":"aea4bb4da7c0fa4e907b8f1e185433a48f2f0eb7ded97fdd3225beb3f6c1f249","src/back/spv/subgroup.rs":"68fc3e3153022a0a8bddec20ad9221820678f02921878318e571d5aa2ca13cee","src/back/spv/writer.rs":"b46ae56c44744af21d80cc7f83f4f9c0260bb35d19e1415e6446e40fbe0dbfc5","src/back/wgsl/mod.rs":"1b04d66e8dba609513d43431d1f0ee9a209fbfd8453862d6e8a7aa41f8910997","src/back/wgsl/polyfill/inverse/inverse_2x2_f16.wgsl":"9e7635d04724822931c805a8b35e76d6d294d447e4ea8d57b308ce45609bf736","src/back/wgsl/polyfill/inverse/inverse_2x2_f32.wgsl":"340d491abde07f93996391796db65a5f88402663eaf6b9d2d894d11cb8cf8b6d","src/back/wgsl/polyfill/inverse/inverse_3x3_f16.wgsl":"4f13a1a4b3e1b51f0f992d13c55cf854a80917554a4d13c997819fa1fe776ba4","src/back/wgsl/polyfill/inverse/inverse_3x3_f32.wgsl":"9b16d2f4b9e433c8e03a0cb46ab48508f3bf7e185ce1b4e26106c47e81a677cb","src/back/wgsl/polyfill/inverse/inverse_4x4_f16.wgsl":"86d39d1db5d03995b404950279db7f1698ad9622982aa319fdedb7532673235b","src/back/wgsl/polyfill/inverse/inverse_4x4_f32.wgsl":"dc510525ac2dce66389a8c4bf8b2f31f0dedd9e6debdbe4ffd939a0a7fc533d3","src/back/wgsl/polyfill/mod.rs":"f4ab3c9b9cdc36d16dab00d0f7f07d6e6beda0e27a36053e9b5ffeeb7ca18edc","src/back/wgsl/writer.rs":"a2ccc6024d0bc64e52e6b1e36967250b3bcb46a0ee99e9538ca6b75caa8d8bc7","src/common/diagnostic_debug.rs":"8c73fe605e5b6162d0485e264287ac50c061cf581743feebbffe1474d1d3516d","src/common/diagnostic_display.rs":"46f1ff8a32179703ef0bcdb704db9f6e6e8b4eaad6cadf94577eeab3d8a16cd1","src/common/mod.rs":"0c979fd43068cfbceb7b29ff0bc578327e0770d5403c12f48d8605f77efbe200","src/common/predeclared.rs":"a5f42d55f2e13d8f5a8213d4a881e9155c3994c4054d43edcf7bd7bb7c868ccf","src/common/wgsl/diagnostics.rs":"4fec985b4c5cc6dfae4dd78bd7c850adc88a1761d7b6691de0355ea49300e532","src/common/wgsl/mod.rs":"d944915ff692c96aecca67737bccc2d5d9eb68f475166a2744f29a025f4a4c93","src/common/wgsl/to_wgsl.rs":"4f1856538d15e00f6fe15c21a06298be58f0ddcb5de53b88ef311d056fd16a3c","src/common/wgsl/types.rs":"390323fecff390100fafcc2cb1e5cf349c7aac9da8065e9aec52a56718ab5534","src/compact/expressions.rs":"12653b34c7c7d68ce7d14a9c15e59c469fda4931425d14600fbaa99226af735f","src/compact/functions.rs":"27a0d33e5a8f02778b518c6e0db5a5d41f77a93b64eadef54b6cf0914067d7ad","src/compact/handle_set_map.rs":"b4688bff174487f2da4a1a946af07c80b6ba59f60dc84184c6a30039354209e8","src/compact/mod.rs":"1ace9291d919b0430e46184788a505513708506a5df40aacc96aece2c1e85cc9","src/compact/statements.rs":"85b2faf6a4caaebc0372e773ca3be2904db5bb0e691ac7ea845720ef0864a22b","src/compact/types.rs":"a955ce5e336afa8d26f750c14d4a6638dcee6b0b5e0fcd7c446d8f88a35d8277","src/diagnostic_filter.rs":"5e3d14a774974148b7d2918617ba3e2c3a07493e0f90485a7de9db86e05a7cd0","src/error.rs":"46180b139b60cca1e46a8848f9eecc5cab8220a022e4c6f8ce297d1d968e87e7","src/front/atomic_upgrade.rs":"86ce9f9628d92a1a09802cb534bb4310236b83f2799c921b81c687f009c589be","src/front/glsl/ast.rs":"78cdf7ae13a2d8ffa3397eb114a112f93b3d1a10c1983e008b50ea5a4371a87c","src/front/glsl/builtins.rs":"ffe36464b5758dd8c917c3e9505d4027268e4b019174f0f95a229cd16d4cafa1","src/front/glsl/context.rs":"fb933e2593097a404a7de3ee64966ba3521e32865ce35066485371afba9b17f0","src/front/glsl/error.rs":"f445297e0357919e2345ae15f2d23c58d36a64c9a666f1cf1b09cbcfd6e4627a","src/front/glsl/functions.rs":"8040564f5429bf4be23e8dbd02c9cd3bbdd7eb8915b1b90ded6bc889db0b88c7","src/front/glsl/lex.rs":"24706628b600b5ce435cef464c84196ac5d58013122a97e7b59d509cc25f85a2","src/front/glsl/mod.rs":"132f2a60812b3910f65e6281562d4dc94efa329fd1eb0f2778ffe67631a35f78","src/front/glsl/offset.rs":"66bd524a2d17dc44f431430dcbbb74a771fdab43c9581e88bb1123e6cfec516b","src/front/glsl/parser.rs":"9aedb0bc25f811fd1924f25017725d7ccda6c04163e96508012d96a17ac4b08c","src/front/glsl/parser/declarations.rs":"311212375f0ba39ef77889acadd54b9909cc9d043e424c0b6c9db3220d68d03e","src/front/glsl/parser/expressions.rs":"e056fbdde3bc7c8473acbd485aecd14120d3dbefbabd813ddbc5cfedaf605889","src/front/glsl/parser/functions.rs":"302e24e06190aff555131c33f9a80b15df6a0390d6c776f888a44d5ef7df697e","src/front/glsl/parser/types.rs":"ee242048a65cd3709e16b70a3882e9296e615327480f2ad779e3d2523778181f","src/front/glsl/parser_tests.rs":"6834f0d595f4077266054e5da43e4f1b60e5c6780611ab0f530d9964cc62fad3","src/front/glsl/token.rs":"83780c0c1954ef216896c9d8a48e412b357783e00ccd4909a7a249935c742629","src/front/glsl/types.rs":"286395d82707a09d28b4c1a8bade917822478e53d8eb277ceec5fa9e71649ba2","src/front/glsl/variables.rs":"97dbdfe45ae893bb18f47b1091e1b055e89912e486f8849722bd10b20c3bf782","src/front/interpolator.rs":"caf8c8c3ddca56fbece33cc18615c4d8c5b3b68112c9de22196d9dd49c84bf96","src/front/mod.rs":"fddd2be54ff44b52743ac8eb4a19e153a8a169af8e65d9061a9b9fc9857f64db","src/front/spv/convert.rs":"218d551db20a973763b70142124576ba75d94883b6b4ab99096241ac167fa5bc","src/front/spv/error.rs":"d08e1d65716ccc0f2a94a1285a1d034fa4840dc79ca60a5ec7481697bdec74d1","src/front/spv/function.rs":"55a3f0fa17f6acc71feb36ebb29e1254d056f797ec420f8c535f6ef8ddce3790","src/front/spv/image.rs":"c39ffdb19a19861cec009de39431a879be99bdd4d9d08c0ecdef397c2f3f6fa5","src/front/spv/mod.rs":"87c221527b2374a3e54f9633c8a50610ec8ba6fff40202e7783c041962bffc9a","src/front/spv/next_block.rs":"af6039f0664f500843c8787eaa6262894d9be220ce964cfa4d2152ecdef7d732","src/front/spv/null.rs":"ee20287365e025e8bcc91f29df930ff8b63cb6d7f26db0b1789d54de614a7353","src/front/type_gen.rs":"111832af89a268ae3206d2ba2159b9b9d64224ed09375a29eec142725ea7fb34","src/front/wgsl/error.rs":"d5931cb5e7d31b380e15582639c0e95625358f172db9fe6b2d5777f674e584d7","src/front/wgsl/index.rs":"476e5c4eddb14dfb53eee7976bcf4276c8a3fad81fbed92dc7b5dd31a5ab1593","src/front/wgsl/lower/construction.rs":"24e0eb2181974651ab9d13497cceaa126ee816c38848e9dbbd88f1e7b5f5c53c","src/front/wgsl/lower/conversion.rs":"d4a66519b38caa208b011846cdc3459e8a0b6bae8027235692b30188ae88e110","src/front/wgsl/lower/mod.rs":"c69224d0ec53f49667fedfdaff1b3d85c9b5d10122fdbde8766d54b89eed0658","src/front/wgsl/mod.rs":"95d38b0a49833638a06ac35c6df30c8fd3dcfa5494871e6d166f7e70f54b8fa3","src/front/wgsl/parse/ast.rs":"acc31dd4d5f3b784db77ff408856cefb9794e6238ca84e59d0483542396cc063","src/front/wgsl/parse/conv.rs":"09794cac771778d797476d188908aa5e5a91b1d25901bc1c929e8b3f4d169cc4","src/front/wgsl/parse/directive.rs":"c96f33cef2c1d8a374fe1b3827538f7db33d6b7811a6e0914d29de80b8963257","src/front/wgsl/parse/directive/enable_extension.rs":"7a3ab67784c867c5f62e7cb17c2be23441f24792b7bbb44a77f6b852d2e3fb53","src/front/wgsl/parse/directive/language_extension.rs":"f82ae1c1f1d82e9e27e336b6a6975e21c7c08e5f1700f28f8d351b7f03a1621c","src/front/wgsl/parse/lexer.rs":"2194d38da1dc803ffb850202023350a07b6a3b80af68857d772c76ea49bc6344","src/front/wgsl/parse/mod.rs":"0853849ce2ebf874f136d96c862954796dc56f6fee4e63efbf26c590555eb14b","src/front/wgsl/parse/number.rs":"7af92c71031e4c4258e9d8d323f7ee99a2fd4be3b6975ab9b8b53b95431845d9","src/front/wgsl/tests.rs":"9ce1dc978d64b7c551a07ac683cc9ec77d51f77c7394607ea93c30b22829e5e6","src/ir/block.rs":"b562a83a4fa53002d2ca21b4553ed8e2fa77f61e687f24fd4bbd90f1597b2a9d","src/ir/mod.rs":"e5eeec5613736a3a41bc7c32e7903ea290ac1ea0fc49fafd2160768354451672","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"7236f0e751066712970b4f3dc9942b41d678c6a6e202c7da834f4f398e7cc657","src/lib.rs":"1e40237435eebd4a91fd5c9b2e8a58664ebd1c40a0d27c0c5220047f0221704a","src/non_max_u32.rs":"b2d81efda0e1e5ace9e2fad990a7adf628f1dec63273b069c93d5423eb78350d","src/proc/constant_evaluator.rs":"f922147a2d43869d7edde27e90ee588a19f8cc53c4a712e529be60ed5f231e6c","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"17c22571251996583b724af87c7d238f584cd39104256c8e90de7b18e737bb09","src/proc/keyword_set.rs":"928414d2b79ee48735d532e03d3f0a58427c3f27a2a0c6938425749b00943784","src/proc/layouter.rs":"3cba1a304e8b485608f7913fda40dd9fe1777dfee3ffb2f8f34bac078edbd800","src/proc/mod.rs":"648c84cc836960242959d966693d344d238360a163377ea67618037517dd0aaf","src/proc/namer.rs":"8f295d03e29f7dab114fd13fe2a5d9271e373bf1c7bec889f1a6899298b9567a","src/proc/overloads/any_overload_set.rs":"877cd637d979abc08caa021dabb9821a79fc9109eb97024a230bcfac82830388","src/proc/overloads/constructor_set.rs":"b702f866ac1472bcc075bd0bede450388123b5899431934fd60a29865498c68b","src/proc/overloads/list.rs":"0a4ff2a43e035da2cf4a321a15afaff676377838095e691d3e5447f8d9180ab7","src/proc/overloads/mathfunction.rs":"305716a575bed3ec456db583e65bd5a972f1448612b6f260b278ae0b79802540","src/proc/overloads/mod.rs":"0e96479cbd0ec9fa8200a5e88c16a22ee7ed2021ecf6f80a7e4ded69cad5239f","src/proc/overloads/one_bits_iter.rs":"6b98769fdec777d311248084f13958c5cca44659d0928603ece8618387ea58b2","src/proc/overloads/regular.rs":"73d64fab79019d589cb0595d0ef606fd6af732c42a418c60c81da4c96e113c89","src/proc/overloads/rule.rs":"b7f87d5ca0cffdaa8ee0db0110918f5a726359fd8a72bc638d8ce27a4b0ae3b2","src/proc/overloads/scalar_set.rs":"3729bc754dbf29a2337379ecb46568fdc3149a48074a354244da91e3d9cb5cef","src/proc/overloads/utils.rs":"d8f661579e917edb892b6a7e8babadbc0db1a110d74558b81b49b3331bd07a5e","src/proc/terminator.rs":"61df2289408be24f69b6c23da469ca3f63f913568f8c314427c3571b826632dd","src/proc/type_methods.rs":"4aa2892ee2f0bfc136a7aa3e62f695533694b35521696b65cc38d8a4404d536a","src/proc/typifier.rs":"a31a97013838e43d31cef69b032680187ac709e13db0bf8fc85f4e8e11f236cf","src/racy_lock.rs":"6c541795172660e02bac86c3808cf7346b4791910febc0d289bf93d36271d416","src/span.rs":"e91190a7cd116fb811a295dcf9cd796a25b886cc5d35c3756771e3bc61768455","src/valid/analyzer.rs":"d72415dd8cb0586062c65e78122ea7882c71719faea37ba54b0040b7ad08e081","src/valid/compose.rs":"46eeed8c4d5b66fc043ddb701074bd864a9fdd24e38b88e282046230acefb747","src/valid/expression.rs":"9d5a0fdaff2b2d4df3c5cab64e3614b24527e0932551d68f5a64ee2ffcf9ff8c","src/valid/function.rs":"b494350c47d77b0c9e5fdede7f13dc89543803c87b647bd51a254980bb8ff946","src/valid/handles.rs":"65ea8d24307f6eadabd772a9eb95416f64b410ea3150b8e2cf00574ef55d6c3a","src/valid/interface.rs":"f9d105f5b4571633cb5955ce40606df370b8c38f90b4aecb0f77fe1c36740fea","src/valid/mod.rs":"1ebb2f98e44c60a5aacd8cbc274adc8eed634709a42918f8adcace98c5b1c641","src/valid/type.rs":"e71d6d4395fb26cf93e587d56a24d106a85dfb6b848b51a137a91e58b0bb10d3"},"package":null} -\ No newline at end of file +{"files":{".cargo/config.toml":"7248ed3bed246d755d7bf9e5d7842d74b5c270ba6c29ad907872b55a67707ee0","CHANGELOG.md":"e60105d413f857e37dae165f819c47491d0a595183d3c9146b259d811b98b14f","Cargo.toml":"9662970d40ab777b47f9202263a43b0170b876e767254771e469ff019ec2c037","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","README.md":"9550cbc1a518ad0f624aabe12c342c72f670705cb4a6878c0c87d172f1dacea0","build.rs":"e9098f486e87d91710c07d40f1b32716e5debfe94a0b5e53e37075b0ee997eec","src/arena/handle.rs":"897b2b0eebe0d9ae6a65bf2e8c210c8391924da06ef4c9e2a1225ad622400b6c","src/arena/handle_set.rs":"5c2a0bcf41d85c8173ac68b2d439552e79d0c3c0fe1ff3b1e1a48f0c83a4d48f","src/arena/handlevec.rs":"baaed995bcbd2f7d15bd63cede28e579175d408e5a40289f74b32ab65c6850c3","src/arena/mod.rs":"e305d0521233791e181b4b6e7de70175a6bc730811063ea066c3bd3b73d12979","src/arena/range.rs":"b783969dfe32b4937593d871aa5190d561bdd79b6f615da53cb54346e300b9e2","src/arena/unique_arena.rs":"0e2d1c372a7c40b77793dc413b8920e86459e4656775a010f32974b4ad67a7fd","src/back/continue_forward.rs":"8194d238763caa6d5601ec3af56ba39a471c39945f43152b58d582092c99aefa","src/back/dot/mod.rs":"ec559c1cf6f3c92c75af639c7150c48862fff04965ec6b3f30e20e3a41c7c772","src/back/glsl/conv.rs":"927aa5ec3c3b6c0d8a391373ea7e285a93d4711372e82fad5cb22013830cb868","src/back/glsl/features.rs":"3ca9a7b28327ac400a9fd439f3cc0c944fc938b5d52d0be58f58c0ea3fbf3f15","src/back/glsl/keywords.rs":"fee8ed132e44bace54869a7c169a1ab7ed55db1bf590b4b1bce9efa4552e1dd7","src/back/glsl/mod.rs":"74940fe468a13a4fcdd860b458a31e1b9ca7705ef7e9d265097a543b115ec490","src/back/glsl/writer.rs":"be9a3ee16bf6d13e0c03dd20b4bba769b84a28d3214143003b3006257ec0f685","src/back/hlsl/conv.rs":"5da58838c166b753f135689a72b2bb46811269303c6104f8f483eeed93332ec3","src/back/hlsl/help.rs":"12ddb9d08fe64eb34b66ae2166edffce5106a04ccef0b8cc0391a6fafd676270","src/back/hlsl/keywords.rs":"f7fc06c44d2f0d620bcf1a02b699c98c32059741b771a0d1ba5645d71b2f433f","src/back/hlsl/mod.rs":"ed900ac6f261fba33c593b8d440f08917f7e65ebf19b8684f39bff7fb6e4f194","src/back/hlsl/ray.rs":"259db3bc8fd5b8ec343fb8620c7cef50048cbea2b9db1f17dc8813ff848269df","src/back/hlsl/storage.rs":"5083d03b1f25fe767e45e0c507bd30424352fccd48484c081620712d3682aae8","src/back/hlsl/writer.rs":"b190163b42fb7d72c9de174b0014f3b36c22b3bca31ac6a77ed121e08dc7a38f","src/back/mod.rs":"0a1579522edcb2e2b183b8b0a64953e9c309c73409091023a962f8b1a8d8a089","src/back/msl/keywords.rs":"bba3d9da01ef28ad71b4aebcdb0cd3a0c17f7ebbe6a75f5defad0ccf7d905a2d","src/back/msl/mod.rs":"b3ec73360cfce4fa9deba2128ea435424255d1e70df8eae04418b7783f5d23c9","src/back/msl/sampler.rs":"db6c01814d939f1f52eb315e39f34494129c942fa114b11213035c5e3736ed18","src/back/msl/writer.rs":"b545b439e883a5c261f6a31dcf81aa519697f02cd7e0fd268fcb641075fad7d4","src/back/pipeline_constants.rs":"a0216c4a8c230d2544f7e167aaa2bca9827592988891ca451dd9cb30c992c8e4","src/back/spv/block.rs":"60d8a2331904a5cfb497edbe55ab669087f3beebe566fecdeb81f752423e3600","src/back/spv/f16_polyfill.rs":"44ce07ef497dff13a9152eb9bc5936c486ef53de6d476da6b0a39396b0e6abdb","src/back/spv/helpers.rs":"8f7e158ca104a4f7a360c4019be67859d7c5c7dce3b44d500a45da01c2826e45","src/back/spv/image.rs":"105b5f8286d6afaabbb6fd7a5f86380274bae4011f3ba28c4f860c3694678557","src/back/spv/index.rs":"c410c0596c047c278def6b073a6373d233d53642a4c3f5a9be8cb53ca23d9c7d","src/back/spv/instructions.rs":"de5fca1ce32c6ea3a2b55154007a0bc103a81580338cfb0cf6583f218cb61afb","src/back/spv/layout.rs":"28ba27739d7c9fa4b9e363ffc112cdc39c5e8ec4236d71a7260039d1bd8321d7","src/back/spv/mesh_shader.rs":"8687c7e45557fa85d144a68fba5510431a2000cd10d31d36684a4ec908e6a967","src/back/spv/mod.rs":"4876b184269afae3a97f479c866c524a7fb98c1f102b458d5b9a61a45134292a","src/back/spv/ray.rs":"766b673bdcee4c5665ebd46775d89eebecd3bdfebbe8347d3fecf6a718286bbb","src/back/spv/recyclable.rs":"8ea397d4d8d3f2cd5fbc8e0be94d136c2d6e0f0e8a4b5eb567dcc1be104c9ae5","src/back/spv/selection.rs":"aea4bb4da7c0fa4e907b8f1e185433a48f2f0eb7ded97fdd3225beb3f6c1f249","src/back/spv/subgroup.rs":"68fc3e3153022a0a8bddec20ad9221820678f02921878318e571d5aa2ca13cee","src/back/spv/writer.rs":"b40daf8d1949a65d345929c4f0fc51ee0246d9d45dada5aae38aa08af9904149","src/back/wgsl/mod.rs":"1b04d66e8dba609513d43431d1f0ee9a209fbfd8453862d6e8a7aa41f8910997","src/back/wgsl/polyfill/inverse/inverse_2x2_f16.wgsl":"9e7635d04724822931c805a8b35e76d6d294d447e4ea8d57b308ce45609bf736","src/back/wgsl/polyfill/inverse/inverse_2x2_f32.wgsl":"340d491abde07f93996391796db65a5f88402663eaf6b9d2d894d11cb8cf8b6d","src/back/wgsl/polyfill/inverse/inverse_3x3_f16.wgsl":"4f13a1a4b3e1b51f0f992d13c55cf854a80917554a4d13c997819fa1fe776ba4","src/back/wgsl/polyfill/inverse/inverse_3x3_f32.wgsl":"9b16d2f4b9e433c8e03a0cb46ab48508f3bf7e185ce1b4e26106c47e81a677cb","src/back/wgsl/polyfill/inverse/inverse_4x4_f16.wgsl":"86d39d1db5d03995b404950279db7f1698ad9622982aa319fdedb7532673235b","src/back/wgsl/polyfill/inverse/inverse_4x4_f32.wgsl":"dc510525ac2dce66389a8c4bf8b2f31f0dedd9e6debdbe4ffd939a0a7fc533d3","src/back/wgsl/polyfill/mod.rs":"f4ab3c9b9cdc36d16dab00d0f7f07d6e6beda0e27a36053e9b5ffeeb7ca18edc","src/back/wgsl/writer.rs":"d0ff5e12ad9d9558cb4d612a04da08de8a98dca8f5a8a6bb700dfcc6eb7658e6","src/common/diagnostic_debug.rs":"8c73fe605e5b6162d0485e264287ac50c061cf581743feebbffe1474d1d3516d","src/common/diagnostic_display.rs":"46f1ff8a32179703ef0bcdb704db9f6e6e8b4eaad6cadf94577eeab3d8a16cd1","src/common/mod.rs":"0c979fd43068cfbceb7b29ff0bc578327e0770d5403c12f48d8605f77efbe200","src/common/predeclared.rs":"a5f42d55f2e13d8f5a8213d4a881e9155c3994c4054d43edcf7bd7bb7c868ccf","src/common/wgsl/diagnostics.rs":"4fec985b4c5cc6dfae4dd78bd7c850adc88a1761d7b6691de0355ea49300e532","src/common/wgsl/mod.rs":"d944915ff692c96aecca67737bccc2d5d9eb68f475166a2744f29a025f4a4c93","src/common/wgsl/to_wgsl.rs":"720d1d915335474a8fd18d166650122ef0e81919558d79876c3d726026941528","src/common/wgsl/types.rs":"62da42d9d21f542b7aed9393303ba8c17feed49c4f82cb4a339fa0ac2bfacef0","src/compact/expressions.rs":"e2b4267ef76b75e452bc3b58c474b0a2960f0ffbec15788a79cc63eea14d73d6","src/compact/functions.rs":"27a0d33e5a8f02778b518c6e0db5a5d41f77a93b64eadef54b6cf0914067d7ad","src/compact/handle_set_map.rs":"b4688bff174487f2da4a1a946af07c80b6ba59f60dc84184c6a30039354209e8","src/compact/mod.rs":"1ace9291d919b0430e46184788a505513708506a5df40aacc96aece2c1e85cc9","src/compact/statements.rs":"35ea07c549183d8c768bc4dd26dbe9b5c9b2b70ca9b57bc96f6611b7587c5112","src/compact/types.rs":"32abe0e0e0d55044685c5c0d20d1688970217f106270f2bd4a35aa0444a5bdfe","src/diagnostic_filter.rs":"5e3d14a774974148b7d2918617ba3e2c3a07493e0f90485a7de9db86e05a7cd0","src/error.rs":"46180b139b60cca1e46a8848f9eecc5cab8220a022e4c6f8ce297d1d968e87e7","src/front/atomic_upgrade.rs":"86ce9f9628d92a1a09802cb534bb4310236b83f2799c921b81c687f009c589be","src/front/glsl/ast.rs":"78cdf7ae13a2d8ffa3397eb114a112f93b3d1a10c1983e008b50ea5a4371a87c","src/front/glsl/builtins.rs":"ffe36464b5758dd8c917c3e9505d4027268e4b019174f0f95a229cd16d4cafa1","src/front/glsl/context.rs":"fb933e2593097a404a7de3ee64966ba3521e32865ce35066485371afba9b17f0","src/front/glsl/error.rs":"f445297e0357919e2345ae15f2d23c58d36a64c9a666f1cf1b09cbcfd6e4627a","src/front/glsl/functions.rs":"8040564f5429bf4be23e8dbd02c9cd3bbdd7eb8915b1b90ded6bc889db0b88c7","src/front/glsl/lex.rs":"24706628b600b5ce435cef464c84196ac5d58013122a97e7b59d509cc25f85a2","src/front/glsl/mod.rs":"132f2a60812b3910f65e6281562d4dc94efa329fd1eb0f2778ffe67631a35f78","src/front/glsl/offset.rs":"66bd524a2d17dc44f431430dcbbb74a771fdab43c9581e88bb1123e6cfec516b","src/front/glsl/parser.rs":"9aedb0bc25f811fd1924f25017725d7ccda6c04163e96508012d96a17ac4b08c","src/front/glsl/parser/declarations.rs":"311212375f0ba39ef77889acadd54b9909cc9d043e424c0b6c9db3220d68d03e","src/front/glsl/parser/expressions.rs":"e056fbdde3bc7c8473acbd485aecd14120d3dbefbabd813ddbc5cfedaf605889","src/front/glsl/parser/functions.rs":"302e24e06190aff555131c33f9a80b15df6a0390d6c776f888a44d5ef7df697e","src/front/glsl/parser/types.rs":"ee242048a65cd3709e16b70a3882e9296e615327480f2ad779e3d2523778181f","src/front/glsl/parser_tests.rs":"6834f0d595f4077266054e5da43e4f1b60e5c6780611ab0f530d9964cc62fad3","src/front/glsl/token.rs":"83780c0c1954ef216896c9d8a48e412b357783e00ccd4909a7a249935c742629","src/front/glsl/types.rs":"286395d82707a09d28b4c1a8bade917822478e53d8eb277ceec5fa9e71649ba2","src/front/glsl/variables.rs":"97dbdfe45ae893bb18f47b1091e1b055e89912e486f8849722bd10b20c3bf782","src/front/interpolator.rs":"caf8c8c3ddca56fbece33cc18615c4d8c5b3b68112c9de22196d9dd49c84bf96","src/front/mod.rs":"fddd2be54ff44b52743ac8eb4a19e153a8a169af8e65d9061a9b9fc9857f64db","src/front/spv/convert.rs":"218d551db20a973763b70142124576ba75d94883b6b4ab99096241ac167fa5bc","src/front/spv/error.rs":"d08e1d65716ccc0f2a94a1285a1d034fa4840dc79ca60a5ec7481697bdec74d1","src/front/spv/function.rs":"55a3f0fa17f6acc71feb36ebb29e1254d056f797ec420f8c535f6ef8ddce3790","src/front/spv/image.rs":"c39ffdb19a19861cec009de39431a879be99bdd4d9d08c0ecdef397c2f3f6fa5","src/front/spv/mod.rs":"450ed9feaa8c212936b1a252cf03b2424fe6cc85e40195e0d6bd2799a62e9e03","src/front/spv/next_block.rs":"af6039f0664f500843c8787eaa6262894d9be220ce964cfa4d2152ecdef7d732","src/front/spv/null.rs":"ee20287365e025e8bcc91f29df930ff8b63cb6d7f26db0b1789d54de614a7353","src/front/type_gen.rs":"111832af89a268ae3206d2ba2159b9b9d64224ed09375a29eec142725ea7fb34","src/front/wgsl/error.rs":"93c84ce35d7c7e647465ec57aacc133bf7d619190983fa636979b97d6389b7d9","src/front/wgsl/index.rs":"476e5c4eddb14dfb53eee7976bcf4276c8a3fad81fbed92dc7b5dd31a5ab1593","src/front/wgsl/lower/construction.rs":"492053d2c8619f232da8b91fec6e11d7f4d97cb66f9bc3596dad9638825bdc82","src/front/wgsl/lower/conversion.rs":"f5f82649f91313dde91b2840aa399125c766340ec46a41bef6db33f00cafb7f6","src/front/wgsl/lower/mod.rs":"70f21aa0633d064bb52ca8f59fa2f2b635cfb2e02d4c57bd0fea4bafc1c040dd","src/front/wgsl/mod.rs":"95d38b0a49833638a06ac35c6df30c8fd3dcfa5494871e6d166f7e70f54b8fa3","src/front/wgsl/parse/ast.rs":"53bf346ba613e1ff54e29fe03d320d1f62846be7fc3c895bf666f2fa39b0f7e1","src/front/wgsl/parse/conv.rs":"09794cac771778d797476d188908aa5e5a91b1d25901bc1c929e8b3f4d169cc4","src/front/wgsl/parse/directive.rs":"c96f33cef2c1d8a374fe1b3827538f7db33d6b7811a6e0914d29de80b8963257","src/front/wgsl/parse/directive/enable_extension.rs":"6c8387a6fafe05b3ea072c796d301774b1bde53fc236d26fedad3d8721d4f03f","src/front/wgsl/parse/directive/language_extension.rs":"f82ae1c1f1d82e9e27e336b6a6975e21c7c08e5f1700f28f8d351b7f03a1621c","src/front/wgsl/parse/lexer.rs":"ddf4a49e7835255078c9e732cfd196c7c016c969aed1fb10b3c53d05a44d8c61","src/front/wgsl/parse/mod.rs":"5f3221ec05c620d92fc7d39c6cf40c2c0a833d218a0166466d45aae23de5eaf9","src/front/wgsl/parse/number.rs":"7af92c71031e4c4258e9d8d323f7ee99a2fd4be3b6975ab9b8b53b95431845d9","src/front/wgsl/tests.rs":"9ce1dc978d64b7c551a07ac683cc9ec77d51f77c7394607ea93c30b22829e5e6","src/ir/block.rs":"b562a83a4fa53002d2ca21b4553ed8e2fa77f61e687f24fd4bbd90f1597b2a9d","src/ir/mod.rs":"4ba885a0fac521d99859358d5184c64a12f0fb22f7d69b7f833a6ecba745feb5","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"7236f0e751066712970b4f3dc9942b41d678c6a6e202c7da834f4f398e7cc657","src/lib.rs":"1e40237435eebd4a91fd5c9b2e8a58664ebd1c40a0d27c0c5220047f0221704a","src/non_max_u32.rs":"b2d81efda0e1e5ace9e2fad990a7adf628f1dec63273b069c93d5423eb78350d","src/proc/constant_evaluator.rs":"cff73c7f816c8f8834639bf5e9246089f0aa22caeb568be7b51ba7d59666bb24","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"17c22571251996583b724af87c7d238f584cd39104256c8e90de7b18e737bb09","src/proc/keyword_set.rs":"928414d2b79ee48735d532e03d3f0a58427c3f27a2a0c6938425749b00943784","src/proc/layouter.rs":"d192ac6ca7e1bff7f95e49d60279b81e360237005605b67c7c6a1d71a3aec15e","src/proc/mod.rs":"648c84cc836960242959d966693d344d238360a163377ea67618037517dd0aaf","src/proc/namer.rs":"8f295d03e29f7dab114fd13fe2a5d9271e373bf1c7bec889f1a6899298b9567a","src/proc/overloads/any_overload_set.rs":"877cd637d979abc08caa021dabb9821a79fc9109eb97024a230bcfac82830388","src/proc/overloads/constructor_set.rs":"b702f866ac1472bcc075bd0bede450388123b5899431934fd60a29865498c68b","src/proc/overloads/list.rs":"0a4ff2a43e035da2cf4a321a15afaff676377838095e691d3e5447f8d9180ab7","src/proc/overloads/mathfunction.rs":"305716a575bed3ec456db583e65bd5a972f1448612b6f260b278ae0b79802540","src/proc/overloads/mod.rs":"0e96479cbd0ec9fa8200a5e88c16a22ee7ed2021ecf6f80a7e4ded69cad5239f","src/proc/overloads/one_bits_iter.rs":"6b98769fdec777d311248084f13958c5cca44659d0928603ece8618387ea58b2","src/proc/overloads/regular.rs":"73d64fab79019d589cb0595d0ef606fd6af732c42a418c60c81da4c96e113c89","src/proc/overloads/rule.rs":"b7f87d5ca0cffdaa8ee0db0110918f5a726359fd8a72bc638d8ce27a4b0ae3b2","src/proc/overloads/scalar_set.rs":"3729bc754dbf29a2337379ecb46568fdc3149a48074a354244da91e3d9cb5cef","src/proc/overloads/utils.rs":"d8f661579e917edb892b6a7e8babadbc0db1a110d74558b81b49b3331bd07a5e","src/proc/terminator.rs":"c0eed3f6ab3c392c6953fce47b7487d3a767a1299ec764711ed3bdcfbf1248f6","src/proc/type_methods.rs":"999872f43645541c4d96bd0217ce0e7a03ef599a6b72beee19b86abcf657fe1f","src/proc/typifier.rs":"2d9d1ec55b1c2d2f8f612cd3dbae8ff98e5d475b8292e3ddf60d3cf2966d0cab","src/racy_lock.rs":"6c541795172660e02bac86c3808cf7346b4791910febc0d289bf93d36271d416","src/span.rs":"e91190a7cd116fb811a295dcf9cd796a25b886cc5d35c3756771e3bc61768455","src/valid/analyzer.rs":"bc8c23c03f1f2287cc7ae6304283817cc5d28ca42264940e71ddbed500ba966a","src/valid/compose.rs":"46eeed8c4d5b66fc043ddb701074bd864a9fdd24e38b88e282046230acefb747","src/valid/expression.rs":"d9244aff5baf660fe76f10a0a313cb8fa5fd4544f8115e395e9a911c7e78689a","src/valid/function.rs":"f82cb5f60d24c73e1fd714b7f03075779514defbf651970f45b7d5727b8b937a","src/valid/handles.rs":"db70ae92d1e043c8e45bad8a356d5e9c6d6f1067f3f70ab29051146621ac6537","src/valid/interface.rs":"f9d105f5b4571633cb5955ce40606df370b8c38f90b4aecb0f77fe1c36740fea","src/valid/mod.rs":"72f3c612bd7be29eda7a810e4dcaaad8b7d4862c4f8d7f4e0d190501a617ea5d","src/valid/type.rs":"91fca7e53d134f6801e018e692f0d0f8165f321265fcd216e0a878f066098c26"},"package":null} +\ No newline at end of file diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml @@ -177,6 +177,8 @@ default-features = false [dependencies.spirv] version = "0.3" +git = "https://github.com/gfx-rs/rspirv" +rev = "89ce4d0e64c91b0635f617409dc57cb031749a39" optional = true [dependencies.thiserror] @@ -217,6 +219,8 @@ version = "0.12" [dev-dependencies.rspirv] version = "0.12" +git = "https://github.com/gfx-rs/rspirv" +rev = "89ce4d0e64c91b0635f617409dc57cb031749a39" [dev-dependencies.serde] version = "1.0.219" @@ -228,6 +232,8 @@ default-features = false [dev-dependencies.spirv] version = "0.3" +git = "https://github.com/gfx-rs/rspirv" +rev = "89ce4d0e64c91b0635f617409dc57cb031749a39" [dev-dependencies.strum] version = "0.27.1" diff --git a/third_party/rust/naga/src/back/dot/mod.rs b/third_party/rust/naga/src/back/dot/mod.rs @@ -403,6 +403,16 @@ impl StatementGraph { }, } } + S::CooperativeStore { target, data } => { + self.dependencies.push((id, target, "target")); + self.dependencies.push((id, data.pointer, "pointer")); + self.dependencies.push((id, data.stride, "stride")); + if data.row_major { + "CoopStoreT" + } else { + "CoopStore" + } + } }; // Set the last node to the merge node last_node = merge_id; @@ -742,6 +752,18 @@ fn write_function_expressions( let ty = if committed { "Committed" } else { "Candidate" }; (format!("get{ty}HitVertexPositions").into(), 4) } + E::CooperativeLoad { ref data, .. } => { + edges.insert("pointer", data.pointer); + edges.insert("stride", data.stride); + let suffix = if data.row_major { "T " } else { "" }; + (format!("coopLoad{suffix}").into(), 4) + } + E::CooperativeMultiplyAdd { a, b, c } => { + edges.insert("a", a); + edges.insert("b", b); + edges.insert("c", c); + ("cooperativeMultiplyAdd".into(), 4) + } }; // give uniform expressions an outline diff --git a/third_party/rust/naga/src/back/glsl/writer.rs b/third_party/rust/naga/src/back/glsl/writer.rs @@ -532,7 +532,8 @@ impl<'a, W: Write> Writer<'a, W> { | TypeInner::Sampler { .. } | TypeInner::AccelerationStructure { .. } | TypeInner::RayQuery { .. } - | TypeInner::BindingArray { .. } => { + | TypeInner::BindingArray { .. } + | TypeInner::CooperativeMatrix { .. } => { return Err(Error::Custom(format!("Unable to write type {inner:?}"))) } } @@ -2228,6 +2229,7 @@ impl<'a, W: Write> Writer<'a, W> { } writeln!(self.out, ");")?; } + Statement::CooperativeStore { .. } => unimplemented!(), } Ok(()) @@ -3764,7 +3766,9 @@ impl<'a, W: Write> Writer<'a, W> { } // not supported yet Expression::RayQueryGetIntersection { .. } - | Expression::RayQueryVertexPositions { .. } => unreachable!(), + | Expression::RayQueryVertexPositions { .. } + | Expression::CooperativeLoad { .. } + | Expression::CooperativeMultiplyAdd { .. } => unreachable!(), } Ok(()) diff --git a/third_party/rust/naga/src/back/hlsl/writer.rs b/third_party/rust/naga/src/back/hlsl/writer.rs @@ -2756,6 +2756,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } writeln!(self.out, ");")?; } + Statement::CooperativeStore { .. } => unimplemented!(), } Ok(()) @@ -4285,7 +4286,11 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } } // Not supported yet - Expression::RayQueryVertexPositions { .. } => unreachable!(), + Expression::RayQueryVertexPositions { .. } + | Expression::CooperativeLoad { .. } + | Expression::CooperativeMultiplyAdd { .. } => { + unreachable!() + } // Nothing to do here, since call expression already cached Expression::CallResult(_) | Expression::AtomicResult { .. } diff --git a/third_party/rust/naga/src/back/mod.rs b/third_party/rust/naga/src/back/mod.rs @@ -316,12 +316,10 @@ pub const fn binary_operation_str(op: crate::BinaryOperator) -> &'static str { } impl crate::TypeInner { - /// Returns true if this is a handle to a type rather than the type directly. + /// Returns true if a variable of this type is a handle. pub const fn is_handle(&self) -> bool { match *self { - crate::TypeInner::Image { .. } - | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure { .. } => true, + Self::Image { .. } | Self::Sampler { .. } | Self::AccelerationStructure { .. } => true, _ => false, } } diff --git a/third_party/rust/naga/src/back/msl/keywords.rs b/third_party/rust/naga/src/back/msl/keywords.rs @@ -359,6 +359,8 @@ const RESERVED: &[&str] = &[ super::writer::IMAGE_SIZE_EXTERNAL_FUNCTION, super::writer::ARGUMENT_BUFFER_WRAPPER_STRUCT, super::writer::EXTERNAL_TEXTURE_WRAPPER_STRUCT, + super::writer::COOPERATIVE_LOAD_FUNCTION, + super::writer::COOPERATIVE_MULTIPLY_ADD_FUNCTION, ]; // The set of concrete integer dot product function variants. diff --git a/third_party/rust/naga/src/back/msl/mod.rs b/third_party/rust/naga/src/back/msl/mod.rs @@ -227,8 +227,10 @@ pub enum Error { UnsupportedArrayOf(String), #[error("array of type '{0:?}' is not supported")] UnsupportedArrayOfType(Handle<crate::Type>), - #[error("ray tracing is not supported prior to MSL 2.3")] + #[error("ray tracing is not supported prior to MSL 2.4")] UnsupportedRayTracing, + #[error("cooperative matrix is not supported prior to MSL 2.3")] + UnsupportedCooperativeMatrix, #[error("overrides should not be present at this stage")] Override, #[error("bitcasting to {0:?} is not supported")] diff --git a/third_party/rust/naga/src/back/msl/writer.rs b/third_party/rust/naga/src/back/msl/writer.rs @@ -79,6 +79,8 @@ pub(crate) const ARGUMENT_BUFFER_WRAPPER_STRUCT: &str = "NagaArgumentBufferWrapp /// allowing them to be conveniently passed to user-defined or wrapper /// functions. The struct is declared in [`Writer::write_type_defs`]. pub(crate) const EXTERNAL_TEXTURE_WRAPPER_STRUCT: &str = "NagaExternalTextureWrapper"; +pub(crate) const COOPERATIVE_LOAD_FUNCTION: &str = "NagaCooperativeLoad"; +pub(crate) const COOPERATIVE_MULTIPLY_ADD_FUNCTION: &str = "NagaCooperativeMultiplyAdd"; /// Write the Metal name for a Naga numeric type: scalar, vector, or matrix. /// @@ -236,6 +238,21 @@ impl Display for TypeContext<'_> { rows, scalar, } => put_numeric_type(out, scalar, &[rows, columns]), + // Requires Metal-2.3 + crate::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role: _, + } => { + write!( + out, + "{NAMESPACE}::simdgroup_{}{}x{}", + scalar.to_msl_name(), + columns as u32, + rows as u32, + ) + } crate::TypeInner::Pointer { base, space } => { let sub = Self { handle: base, @@ -469,6 +486,19 @@ enum WrappedFunction { ImageQuerySize { class: crate::ImageClass, }, + CooperativeLoad { + space_name: &'static str, + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + scalar: crate::Scalar, + }, + CooperativeMultiplyAdd { + space_name: &'static str, + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + intermediate: crate::CooperativeSize, + scalar: crate::Scalar, + }, } pub struct Writer<W> { @@ -641,6 +671,7 @@ impl crate::Type { Ti::Scalar(_) | Ti::Vector { .. } | Ti::Matrix { .. } + | Ti::CooperativeMatrix { .. } | Ti::Atomic(_) | Ti::Pointer { .. } | Ti::ValuePointer { .. } => self.name.is_some(), @@ -2824,6 +2855,29 @@ impl<W: Write> Writer<W> { } write!(self.out, "}}")?; } + crate::Expression::CooperativeLoad { ref data, .. } => { + if context.lang_version < (2, 3) { + return Err(Error::UnsupportedCooperativeMatrix); + } + write!(self.out, "{COOPERATIVE_LOAD_FUNCTION}(")?; + write!(self.out, "&")?; + self.put_access_chain(data.pointer, context.policies.index, context)?; + write!(self.out, ", ")?; + self.put_expression(data.stride, context, true)?; + write!(self.out, ", {})", data.row_major)?; + } + crate::Expression::CooperativeMultiplyAdd { a, b, c } => { + if context.lang_version < (2, 3) { + return Err(Error::UnsupportedCooperativeMatrix); + } + write!(self.out, "{COOPERATIVE_MULTIPLY_ADD_FUNCTION}(")?; + self.put_expression(a, context, true)?; + write!(self.out, ", ")?; + self.put_expression(b, context, true)?; + write!(self.out, ", ")?; + self.put_expression(c, context, true)?; + write!(self.out, ")")?; + } } Ok(()) } @@ -3455,8 +3509,23 @@ impl<W: Write> Writer<W> { }) => { put_numeric_type(&mut self.out, scalar, &[rows, columns])?; } + TypeResolution::Value(crate::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role: _, + }) => { + write!( + self.out, + "{}::simdgroup_{}{}x{}", + NAMESPACE, + scalar.to_msl_name(), + columns as u32, + rows as u32, + )?; + } TypeResolution::Value(ref other) => { - log::warn!("Type {other:?} isn't a known local"); //TEMP! + log::warn!("Type {other:?} isn't a known local"); return Err(Error::FeatureNotImplemented("weird local type".to_string())); } } @@ -4194,6 +4263,24 @@ impl<W: Write> Writer<W> { } writeln!(self.out, ");")?; } + crate::Statement::CooperativeStore { target, ref data } => { + write!(self.out, "{level}simdgroup_store(")?; + self.put_expression(target, &context.expression, true)?; + write!(self.out, ", &")?; + self.put_access_chain( + data.pointer, + context.expression.policies.index, + &context.expression, + )?; + write!(self.out, ", ")?; + self.put_expression(data.stride, &context.expression, true)?; + if data.row_major { + let matrix_origin = "0"; + let transpose = true; + write!(self.out, ", {matrix_origin}, {transpose}")?; + } + writeln!(self.out, ");")?; + } } } @@ -6307,6 +6394,106 @@ template <typename A> Ok(()) } + fn write_wrapped_cooperative_load( + &mut self, + module: &crate::Module, + func_ctx: &back::FunctionCtx, + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + pointer: Handle<crate::Expression>, + ) -> BackendResult { + let ptr_ty = func_ctx.resolve_type(pointer, &module.types); + let space = ptr_ty.pointer_space().unwrap(); + let space_name = space.to_msl_name().unwrap_or_default(); + let scalar = ptr_ty + .pointer_base_type() + .unwrap() + .inner_with(&module.types) + .scalar() + .unwrap(); + let wrapped = WrappedFunction::CooperativeLoad { + space_name, + columns, + rows, + scalar, + }; + if !self.wrapped_functions.insert(wrapped) { + return Ok(()); + } + let scalar_name = scalar.to_msl_name(); + writeln!( + self.out, + "{NAMESPACE}::simdgroup_{scalar_name}{}x{} {COOPERATIVE_LOAD_FUNCTION}(const {space_name} {scalar_name}* ptr, int stride, bool is_row_major) {{", + columns as u32, rows as u32, + )?; + let l1 = back::Level(1); + writeln!( + self.out, + "{l1}{NAMESPACE}::simdgroup_{scalar_name}{}x{} m;", + columns as u32, rows as u32 + )?; + let matrix_origin = "0"; + writeln!( + self.out, + "{l1}simdgroup_load(m, ptr, stride, {matrix_origin}, is_row_major);" + )?; + writeln!(self.out, "{l1}return m;")?; + writeln!(self.out, "}}")?; + writeln!(self.out)?; + Ok(()) + } + + fn write_wrapped_cooperative_multiply_add( + &mut self, + module: &crate::Module, + func_ctx: &back::FunctionCtx, + space: crate::AddressSpace, + a: Handle<crate::Expression>, + b: Handle<crate::Expression>, + ) -> BackendResult { + let space_name = space.to_msl_name().unwrap_or_default(); + let (a_c, a_r, scalar) = match *func_ctx.resolve_type(a, &module.types) { + crate::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + .. + } => (columns, rows, scalar), + _ => unreachable!(), + }; + let (b_c, b_r) = match *func_ctx.resolve_type(b, &module.types) { + crate::TypeInner::CooperativeMatrix { columns, rows, .. } => (columns, rows), + _ => unreachable!(), + }; + let wrapped = WrappedFunction::CooperativeMultiplyAdd { + space_name, + columns: b_c, + rows: a_r, + intermediate: a_c, + scalar, + }; + if !self.wrapped_functions.insert(wrapped) { + return Ok(()); + } + let scalar_name = scalar.to_msl_name(); + writeln!( + self.out, + "{NAMESPACE}::simdgroup_{scalar_name}{}x{} {COOPERATIVE_MULTIPLY_ADD_FUNCTION}(const {space_name} {NAMESPACE}::simdgroup_{scalar_name}{}x{}& a, const {space_name} {NAMESPACE}::simdgroup_{scalar_name}{}x{}& b, const {space_name} {NAMESPACE}::simdgroup_{scalar_name}{}x{}& c) {{", + b_c as u32, a_r as u32, a_c as u32, a_r as u32, b_c as u32, b_r as u32, b_c as u32, a_r as u32, + )?; + let l1 = back::Level(1); + writeln!( + self.out, + "{l1}{NAMESPACE}::simdgroup_{scalar_name}{}x{} d;", + b_c as u32, a_r as u32 + )?; + writeln!(self.out, "{l1}simdgroup_multiply_accumulate(d,a,b,c);")?; + writeln!(self.out, "{l1}return d;")?; + writeln!(self.out, "}}")?; + writeln!(self.out)?; + Ok(()) + } + pub(super) fn write_wrapped_functions( &mut self, module: &crate::Module, @@ -6381,6 +6568,24 @@ template <typename A> crate::Expression::ImageQuery { image, query } => { self.write_wrapped_image_query(module, func_ctx, image, query)?; } + crate::Expression::CooperativeLoad { + columns, + rows, + role: _, + ref data, + } => { + self.write_wrapped_cooperative_load( + module, + func_ctx, + columns, + rows, + data.pointer, + )?; + } + crate::Expression::CooperativeMultiplyAdd { a, b, c: _ } => { + let space = crate::AddressSpace::Private; + self.write_wrapped_cooperative_multiply_add(module, func_ctx, space, a, b)?; + } _ => {} } } @@ -6572,7 +6777,6 @@ template <typename A> names: &self.names, handle, usage: fun_info[handle], - reference: true, }; let separator = diff --git a/third_party/rust/naga/src/back/pipeline_constants.rs b/third_party/rust/naga/src/back/pipeline_constants.rs @@ -18,7 +18,8 @@ use crate::{ Span, Statement, TypeInner, WithSpan, }; -#[cfg(no_std)] +// Possibly unused if not compiled with no_std +#[allow(unused_imports)] use num_traits::float::FloatCore as _; #[derive(Error, Debug, Clone)] @@ -658,6 +659,19 @@ fn adjust_expr(new_pos: &HandleVec<Expression, Handle<Expression>>, expr: &mut E } => { adjust(query); } + Expression::CooperativeLoad { ref mut data, .. } => { + adjust(&mut data.pointer); + adjust(&mut data.stride); + } + Expression::CooperativeMultiplyAdd { + ref mut a, + ref mut b, + ref mut c, + } => { + adjust(a); + adjust(b); + adjust(c); + } } } @@ -860,6 +874,14 @@ fn adjust_stmt(new_pos: &HandleVec<Expression, Handle<Expression>>, stmt: &mut S crate::RayQueryFunction::Terminate => {} } } + Statement::CooperativeStore { + ref mut target, + ref mut data, + } => { + adjust(target); + adjust(&mut data.pointer); + adjust(&mut data.stride); + } Statement::Break | Statement::Continue | Statement::Kill diff --git a/third_party/rust/naga/src/back/spv/block.rs b/third_party/rust/naga/src/back/spv/block.rs @@ -19,6 +19,7 @@ fn get_dimension(type_inner: &crate::TypeInner) -> Dimension { crate::TypeInner::Scalar(_) => Dimension::Scalar, crate::TypeInner::Vector { .. } => Dimension::Vector, crate::TypeInner::Matrix { .. } => Dimension::Matrix, + crate::TypeInner::CooperativeMatrix { .. } => Dimension::CooperativeMatrix, _ => unreachable!(), } } @@ -777,6 +778,7 @@ impl BlockContext<'_> { rows, scalar, } => { + //TODO: why not just rely on `Fadd` for matrices? self.write_matrix_matrix_column_op( block, id, @@ -792,6 +794,7 @@ impl BlockContext<'_> { self.cached[expr_handle] = id; return Ok(()); } + crate::TypeInner::CooperativeMatrix { .. } => spirv::Op::FAdd, _ => unimplemented!(), }, crate::BinaryOperator::Subtract => match *left_ty_inner { @@ -820,6 +823,7 @@ impl BlockContext<'_> { self.cached[expr_handle] = id; return Ok(()); } + crate::TypeInner::CooperativeMatrix { .. } => spirv::Op::FSub, _ => unimplemented!(), }, crate::BinaryOperator::Multiply => { @@ -853,10 +857,12 @@ impl BlockContext<'_> { (Dimension::Vector, Dimension::Matrix) => { spirv::Op::VectorTimesMatrix } - (Dimension::Matrix, Dimension::Scalar) => { + (Dimension::Matrix, Dimension::Scalar) + | (Dimension::CooperativeMatrix, Dimension::Scalar) => { spirv::Op::MatrixTimesScalar } - (Dimension::Scalar, Dimension::Matrix) => { + (Dimension::Scalar, Dimension::Matrix) + | (Dimension::Scalar, Dimension::CooperativeMatrix) => { reverse_operands = true; spirv::Op::MatrixTimesScalar } @@ -875,6 +881,12 @@ impl BlockContext<'_> { } (Dimension::Vector, Dimension::Vector) | (Dimension::Scalar, Dimension::Scalar) => spirv::Op::IMul, + (Dimension::CooperativeMatrix, Dimension::CooperativeMatrix) + //Note: technically can do `FMul` but IR doesn't have matrix per-component multiplication + | (Dimension::CooperativeMatrix, _) + | (_, Dimension::CooperativeMatrix) => { + unimplemented!() + } } } crate::BinaryOperator::Divide => match left_ty_inner.scalar_kind() { @@ -1828,6 +1840,69 @@ impl BlockContext<'_> { )?; self.write_ray_query_return_vertex_position(query, block, committed) } + crate::Expression::CooperativeLoad { ref data, .. } => { + self.writer.require_any( + "CooperativeMatrix", + &[spirv::Capability::CooperativeMatrixKHR], + )?; + let layout = if data.row_major { + spirv::CooperativeMatrixLayout::RowMajorKHR + } else { + spirv::CooperativeMatrixLayout::ColumnMajorKHR + }; + let layout_id = self.get_index_constant(layout as u32); + let stride_id = self.cached[data.stride]; + match self.write_access_chain(data.pointer, block, AccessTypeAdjustment::None)? { + ExpressionPointer::Ready { pointer_id } => { + let id = self.gen_id(); + block.body.push(Instruction::coop_load( + result_type_id, + id, + pointer_id, + layout_id, + stride_id, + )); + id + } + ExpressionPointer::Conditional { condition, access } => self + .write_conditional_indexed_load( + result_type_id, + condition, + block, + |id_gen, block| { + let pointer_id = access.result_id.unwrap(); + block.body.push(access); + let id = id_gen.next(); + block.body.push(Instruction::coop_load( + result_type_id, + id, + pointer_id, + layout_id, + stride_id, + )); + id + }, + ), + } + } + crate::Expression::CooperativeMultiplyAdd { a, b, c } => { + self.writer.require_any( + "CooperativeMatrix", + &[spirv::Capability::CooperativeMatrixKHR], + )?; + let a_id = self.cached[a]; + let b_id = self.cached[b]; + let c_id = self.cached[c]; + let id = self.gen_id(); + block.body.push(Instruction::coop_mul_add( + result_type_id, + id, + a_id, + b_id, + c_id, + )); + id + } }; self.cached[expr_handle] = id; @@ -3699,6 +3774,42 @@ impl BlockContext<'_> { } => { self.write_subgroup_gather(mode, argument, result, &mut block)?; } + Statement::CooperativeStore { target, ref data } => { + let target_id = self.cached[target]; + let layout = if data.row_major { + spirv::CooperativeMatrixLayout::RowMajorKHR + } else { + spirv::CooperativeMatrixLayout::ColumnMajorKHR + }; + let layout_id = self.get_index_constant(layout as u32); + let stride_id = self.cached[data.stride]; + match self.write_access_chain( + data.pointer, + &mut block, + AccessTypeAdjustment::None, + )? { + ExpressionPointer::Ready { pointer_id } => { + block.body.push(Instruction::coop_store( + target_id, pointer_id, layout_id, stride_id, + )); + } + ExpressionPointer::Conditional { condition, access } => { + let mut selection = Selection::start(&mut block, ()); + selection.if_true(self, condition, ()); + + // The in-bounds path. Perform the access and the store. + let pointer_id = access.result_id.unwrap(); + selection.block().body.push(access); + selection.block().body.push(Instruction::coop_store( + target_id, pointer_id, layout_id, stride_id, + )); + + // Finish the in-bounds block and start the merge block. This + // is the block we'll leave current on return. + selection.finish(self, ()); + } + }; + } } } diff --git a/third_party/rust/naga/src/back/spv/instructions.rs b/third_party/rust/naga/src/back/spv/instructions.rs @@ -291,6 +291,24 @@ impl super::Instruction { instruction } + pub(super) fn type_coop_matrix( + id: Word, + scalar_type_id: Word, + scope_id: Word, + row_count_id: Word, + column_count_id: Word, + matrix_use_id: Word, + ) -> Self { + let mut instruction = Self::new(Op::TypeCooperativeMatrixKHR); + instruction.set_result(id); + instruction.add_operand(scalar_type_id); + instruction.add_operand(scope_id); + instruction.add_operand(row_count_id); + instruction.add_operand(column_count_id); + instruction.add_operand(matrix_use_id); + instruction + } + #[allow(clippy::too_many_arguments)] pub(super) fn type_image( id: Word, @@ -1251,6 +1269,41 @@ impl super::Instruction { instruction } + + // Cooperative operations + pub(super) fn coop_load( + result_type_id: Word, + id: Word, + pointer_id: Word, + layout_id: Word, + stride_id: Word, + ) -> Self { + let mut instruction = Self::new(Op::CooperativeMatrixLoadKHR); + instruction.set_type(result_type_id); + instruction.set_result(id); + instruction.add_operand(pointer_id); + instruction.add_operand(layout_id); + instruction.add_operand(stride_id); + instruction + } + pub(super) fn coop_store(id: Word, pointer_id: Word, layout_id: Word, stride_id: Word) -> Self { + let mut instruction = Self::new(Op::CooperativeMatrixStoreKHR); + instruction.add_operand(pointer_id); + instruction.add_operand(id); + instruction.add_operand(layout_id); + instruction.add_operand(stride_id); + instruction + } + pub(super) fn coop_mul_add(result_type_id: Word, id: Word, a: Word, b: Word, c: Word) -> Self { + let mut instruction = Self::new(Op::CooperativeMatrixMulAddKHR); + instruction.set_type(result_type_id); + instruction.set_result(id); + instruction.add_operand(a); + instruction.add_operand(b); + instruction.add_operand(c); + + instruction + } } impl From<crate::StorageFormat> for spirv::ImageFormat { @@ -1313,3 +1366,13 @@ impl From<crate::ImageDimension> for spirv::Dim { } } } + +impl From<crate::CooperativeRole> for spirv::CooperativeMatrixUse { + fn from(role: crate::CooperativeRole) -> Self { + match role { + crate::CooperativeRole::A => Self::MatrixAKHR, + crate::CooperativeRole::B => Self::MatrixBKHR, + crate::CooperativeRole::C => Self::MatrixAccumulatorKHR, + } + } +} diff --git a/third_party/rust/naga/src/back/spv/mod.rs b/third_party/rust/naga/src/back/spv/mod.rs @@ -352,6 +352,36 @@ impl NumericType { } } +/// A cooperative type, for use in [`LocalType`]. +#[derive(Debug, PartialEq, Hash, Eq, Copy, Clone)] +enum CooperativeType { + Matrix { + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + scalar: crate::Scalar, + role: crate::CooperativeRole, + }, +} + +impl CooperativeType { + const fn from_inner(inner: &crate::TypeInner) -> Option<Self> { + match *inner { + crate::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role, + } => Some(Self::Matrix { + columns, + rows, + scalar, + role, + }), + _ => None, + } + } +} + /// A SPIR-V type constructed during code generation. /// /// This is the variant of [`LookupType`] used to represent types that might not @@ -401,6 +431,7 @@ impl NumericType { enum LocalType { /// A numeric type. Numeric(NumericType), + Cooperative(CooperativeType), Pointer { base: Word, class: spirv::StorageClass, @@ -474,6 +505,7 @@ enum Dimension { Scalar, Vector, Matrix, + CooperativeMatrix, } /// Key used to look up an operation which we have wrapped in a helper diff --git a/third_party/rust/naga/src/back/spv/writer.rs b/third_party/rust/naga/src/back/spv/writer.rs @@ -7,10 +7,11 @@ use spirv::Word; use super::{ block::DebugInfoInner, helpers::{contains_builtin, global_needs_wrapper, map_storage_class}, - Block, BlockContext, CachedConstant, CachedExpressions, DebugInfo, EntryPointContext, Error, - Function, FunctionArgument, GlobalVariable, IdGenerator, Instruction, LocalImageType, - LocalType, LocalVariable, LogicalLayout, LookupFunctionType, LookupType, NumericType, Options, - PhysicalLayout, PipelineOptions, ResultMember, Writer, WriterFlags, BITS_PER_BYTE, + Block, BlockContext, CachedConstant, CachedExpressions, CooperativeType, DebugInfo, + EntryPointContext, Error, Function, FunctionArgument, GlobalVariable, IdGenerator, Instruction, + LocalImageType, LocalType, LocalVariable, LogicalLayout, LookupFunctionType, LookupType, + NumericType, Options, PhysicalLayout, PipelineOptions, ResultMember, Writer, WriterFlags, + BITS_PER_BYTE, }; use crate::{ arena::{Handle, HandleVec, UniqueArena}, @@ -449,6 +450,9 @@ impl Writer { // these cases, so unwrap. LocalType::Numeric(NumericType::from_inner(inner).unwrap()) } + crate::TypeInner::CooperativeMatrix { .. } => { + LocalType::Cooperative(CooperativeType::from_inner(inner).unwrap()) + } crate::TypeInner::Pointer { base, space } => { let base_type_id = self.get_handle_type_id(base); LocalType::Pointer { @@ -1028,14 +1032,13 @@ impl Writer { } } - // Handle globals are pre-emitted and should be loaded automatically. - // - // Any that are binding arrays we skip as we cannot load the array, we must load the result after indexing. match ir_module.types[var.ty].inner { + // Any that are binding arrays we skip as we cannot load the array, we must load the result after indexing. crate::TypeInner::BindingArray { .. } => { gv.access_id = gv.var_id; } _ => { + // Handle globals are pre-emitted and should be loaded automatically. if var.space == crate::AddressSpace::Handle { let var_type_id = self.get_handle_type_id(var.ty); let id = self.id_gen.next(); @@ -1122,6 +1125,7 @@ impl Writer { } }), ); + context .function .variables @@ -1515,6 +1519,16 @@ impl Writer { self.require_any("16 bit floating-point", &[spirv::Capability::Float16])?; self.use_extension("SPV_KHR_16bit_storage"); } + // Cooperative types and ops + crate::TypeInner::CooperativeMatrix { .. } => { + self.require_any( + "cooperative matrix", + &[spirv::Capability::CooperativeMatrixKHR], + )?; + self.require_any("memory model", &[spirv::Capability::VulkanMemoryModel])?; + self.use_extension("SPV_KHR_cooperative_matrix"); + self.use_extension("SPV_KHR_vulkan_memory_model"); + } _ => {} } Ok(()) @@ -1541,12 +1555,38 @@ impl Writer { instruction.to_words(&mut self.logical_layout.declarations); } + fn write_cooperative_type_declaration_local(&mut self, id: Word, coop: CooperativeType) { + let instruction = match coop { + CooperativeType::Matrix { + columns, + rows, + scalar, + role, + } => { + let scalar_id = + self.get_localtype_id(LocalType::Numeric(NumericType::Scalar(scalar))); + let scope_id = self.get_index_constant(spirv::Scope::Subgroup as u32); + let columns_id = self.get_index_constant(columns as u32); + let rows_id = self.get_index_constant(rows as u32); + let role_id = + self.get_index_constant(spirv::CooperativeMatrixUse::from(role) as u32); + Instruction::type_coop_matrix(id, scalar_id, scope_id, rows_id, columns_id, role_id) + } + }; + + instruction.to_words(&mut self.logical_layout.declarations); + } + fn write_type_declaration_local(&mut self, id: Word, local_ty: LocalType) { let instruction = match local_ty { LocalType::Numeric(numeric) => { self.write_numeric_type_declaration_local(id, numeric); return; } + LocalType::Cooperative(coop) => { + self.write_cooperative_type_declaration_local(id, coop); + return; + } LocalType::Pointer { base, class } => Instruction::type_pointer(id, class, base), LocalType::Image(image) => { let local_type = LocalType::Numeric(NumericType::Scalar(image.sampled_type)); @@ -1663,6 +1703,7 @@ impl Writer { | crate::TypeInner::Atomic(_) | crate::TypeInner::Vector { .. } | crate::TypeInner::Matrix { .. } + | crate::TypeInner::CooperativeMatrix { .. } | crate::TypeInner::Pointer { .. } | crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Image { .. } @@ -2947,7 +2988,14 @@ impl Writer { } let addressing_model = spirv::AddressingModel::Logical; - let memory_model = spirv::MemoryModel::GLSL450; + let memory_model = if self + .capabilities_used + .contains(&spirv::Capability::VulkanMemoryModel) + { + spirv::MemoryModel::Vulkan + } else { + spirv::MemoryModel::GLSL450 + }; //self.check(addressing_model.required_capabilities())?; //self.check(memory_model.required_capabilities())?; diff --git a/third_party/rust/naga/src/back/wgsl/writer.rs b/third_party/rust/naga/src/back/wgsl/writer.rs @@ -1069,6 +1069,16 @@ impl<W: Write> Writer<W> { } writeln!(self.out, ");")?; } + Statement::CooperativeStore { target, ref data } => { + let suffix = if data.row_major { "T" } else { "" }; + write!(self.out, "{level}coopStore{suffix}(")?; + self.write_expr(module, target, func_ctx)?; + write!(self.out, ", ")?; + self.write_expr(module, data.pointer, func_ctx)?; + write!(self.out, ", ")?; + self.write_expr(module, data.stride, func_ctx)?; + writeln!(self.out, ");")? + } } Ok(()) @@ -1186,6 +1196,13 @@ impl<W: Write> Writer<W> { // If the plain form of the expression is not what we need, emit the // operator necessary to correct that. let plain = self.plain_form_indirection(expr, module, func_ctx); + log::trace!( + "expression {:?}={:?} is {:?}, expected {:?}", + expr, + func_ctx.expressions[expr], + plain, + requested, + ); match (requested, plain) { (Indirection::Ordinary, Indirection::Reference) => { write!(self.out, "(&")?; @@ -1785,6 +1802,43 @@ impl<W: Write> Writer<W> { | Expression::SubgroupBallotResult | Expression::SubgroupOperationResult { .. } | Expression::WorkGroupUniformLoadResult { .. } => {} + Expression::CooperativeLoad { + columns, + rows, + role, + ref data, + } => { + let suffix = if data.row_major { "T" } else { "" }; + let scalar = func_ctx.info[data.pointer] + .ty + .inner_with(&module.types) + .pointer_base_type() + .unwrap() + .inner_with(&module.types) + .scalar() + .unwrap(); + write!( + self.out, + "coopLoad{suffix}<coop_mat{}x{}<{},{:?}>>(", + columns as u32, + rows as u32, + scalar.try_to_wgsl().unwrap(), + role, + )?; + self.write_expr(module, data.pointer, func_ctx)?; + write!(self.out, ", ")?; + self.write_expr(module, data.stride, func_ctx)?; + write!(self.out, ")")?; + } + Expression::CooperativeMultiplyAdd { a, b, c } => { + write!(self.out, "coopMultiplyAdd(")?; + self.write_expr(module, a, func_ctx)?; + write!(self.out, ", ")?; + self.write_expr(module, b, func_ctx)?; + write!(self.out, ", ")?; + self.write_expr(module, c, func_ctx)?; + write!(self.out, ")")?; + } } Ok(()) diff --git a/third_party/rust/naga/src/common/wgsl/to_wgsl.rs b/third_party/rust/naga/src/common/wgsl/to_wgsl.rs @@ -310,15 +310,23 @@ impl TryToWgsl for crate::Scalar { } } -impl ToWgsl for crate::ImageDimension { +impl ToWgsl for crate::CooperativeRole { fn to_wgsl(self) -> &'static str { - use crate::ImageDimension as IDim; + match self { + Self::A => "A", + Self::B => "B", + Self::C => "C", + } + } +} +impl ToWgsl for crate::ImageDimension { + fn to_wgsl(self) -> &'static str { match self { - IDim::D1 => "1d", - IDim::D2 => "2d", - IDim::D3 => "3d", - IDim::Cube => "cube", + Self::D1 => "1d", + Self::D2 => "2d", + Self::D3 => "3d", + Self::Cube => "cube", } } } diff --git a/third_party/rust/naga/src/common/wgsl/types.rs b/third_party/rust/naga/src/common/wgsl/types.rs @@ -317,6 +317,21 @@ where ctx.write_scalar(scalar, out)?; out.write_str(">")?; } + TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role, + } => { + write!( + out, + "coop_mat{}x{}<{},{}>", + columns as u32, + rows as u32, + scalar.try_to_wgsl().unwrap_or_default(), + role.to_wgsl(), + )?; + } TypeInner::Pointer { base, space } => { let (address, maybe_access) = address_space_str(space); // Everything but `AddressSpace::Handle` gives us a `address` name, but diff --git a/third_party/rust/naga/src/compact/expressions.rs b/third_party/rust/naga/src/compact/expressions.rs @@ -253,6 +253,15 @@ impl ExpressionTracer<'_> { } => { self.expressions_used.insert(query); } + Ex::CooperativeLoad { ref data, .. } => { + self.expressions_used.insert(data.pointer); + self.expressions_used.insert(data.stride); + } + Ex::CooperativeMultiplyAdd { a, b, c } => { + self.expressions_used.insert(a); + self.expressions_used.insert(b); + self.expressions_used.insert(c); + } } } } @@ -419,6 +428,19 @@ impl ModuleMap { ref mut query, committed: _, } => adjust(query), + Ex::CooperativeLoad { ref mut data, .. } => { + adjust(&mut data.pointer); + adjust(&mut data.stride); + } + Ex::CooperativeMultiplyAdd { + ref mut a, + ref mut b, + ref mut c, + } => { + adjust(a); + adjust(b); + adjust(c); + } } } diff --git a/third_party/rust/naga/src/compact/statements.rs b/third_party/rust/naga/src/compact/statements.rs @@ -152,6 +152,11 @@ impl FunctionTracer<'_> { self.expressions_used.insert(argument); self.expressions_used.insert(result); } + St::CooperativeStore { target, ref data } => { + self.expressions_used.insert(target); + self.expressions_used.insert(data.pointer); + self.expressions_used.insert(data.stride); + } // Trivial statements. St::Break @@ -371,6 +376,14 @@ impl FunctionMap { adjust(argument); adjust(result); } + St::CooperativeStore { + ref mut target, + ref mut data, + } => { + adjust(target); + adjust(&mut data.pointer); + adjust(&mut data.stride); + } // Trivial statements. St::Break diff --git a/third_party/rust/naga/src/compact/types.rs b/third_party/rust/naga/src/compact/types.rs @@ -16,6 +16,7 @@ impl TypeTracer<'_> { Ti::Scalar { .. } | Ti::Vector { .. } | Ti::Matrix { .. } + | Ti::CooperativeMatrix { .. } | Ti::Atomic { .. } | Ti::ValuePointer { .. } | Ti::Image { .. } @@ -66,6 +67,7 @@ impl ModuleMap { Ti::Scalar(_) | Ti::Vector { .. } | Ti::Matrix { .. } + | Ti::CooperativeMatrix { .. } | Ti::Atomic(_) | Ti::ValuePointer { .. } | Ti::Image { .. } diff --git a/third_party/rust/naga/src/front/spv/mod.rs b/third_party/rust/naga/src/front/spv/mod.rs @@ -1623,6 +1623,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> { } } S::WorkGroupUniformLoad { .. } => unreachable!(), + S::CooperativeStore { .. } => unreachable!(), } i += 1; } diff --git a/third_party/rust/naga/src/front/wgsl/error.rs b/third_party/rust/naga/src/front/wgsl/error.rs @@ -416,6 +416,9 @@ pub(crate) enum Error<'a> { TypeTooLarge { span: Span, }, + UnderspecifiedCooperativeMatrix, + InvalidCooperativeLoadType(Span), + UnsupportedCooperativeScalar(Span), } impl From<ConflictingDiagnosticRuleError> for Error<'_> { @@ -1400,6 +1403,21 @@ impl<'a> Error<'a> { crate::valid::MAX_TYPE_SIZE )], }, + Error::UnderspecifiedCooperativeMatrix => ParseError { + message: "cooperative matrix constructor is underspecified".into(), + labels: vec![], + notes: vec![format!("must be F32")], + }, + Error::InvalidCooperativeLoadType(span) => ParseError { + message: "cooperative load should have a generic type for coop_mat".into(), + labels: vec![(span, "type needs the coop_mat<...>".into())], + notes: vec![format!("must be a valid cooperative type")], + }, + Error::UnsupportedCooperativeScalar(span) => ParseError { + message: "cooperative scalar type is not supported".into(), + labels: vec![(span, "type needs the scalar type specified".into())], + notes: vec![format!("must be F32")], + }, } } } diff --git a/third_party/rust/naga/src/front/wgsl/lower/construction.rs b/third_party/rust/naga/src/front/wgsl/lower/construction.rs @@ -638,6 +638,29 @@ impl<'source> Lowerer<'source, '_> { }; Constructor::Type(ty) } + ast::ConstructorType::PartialCooperativeMatrix { .. } => { + return Err(Box::new(Error::UnderspecifiedCooperativeMatrix)); + } + ast::ConstructorType::CooperativeMatrix { + rows, + columns, + ty, + ty_span, + role, + } => { + let ty = self.resolve_ast_type(ty, &mut ctx.as_const())?; + let scalar = match ctx.module.types[ty].inner { + crate::TypeInner::Scalar(s) => s, + _ => return Err(Box::new(Error::UnsupportedCooperativeScalar(ty_span))), + }; + let ty = ctx.ensure_type_exists(crate::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role, + }); + Constructor::Type(ty) + } ast::ConstructorType::PartialArray => Constructor::PartialArray, ast::ConstructorType::Array { base, size } => { let base = self.resolve_ast_type(base, &mut ctx.as_const())?; diff --git a/third_party/rust/naga/src/front/wgsl/lower/conversion.rs b/third_party/rust/naga/src/front/wgsl/lower/conversion.rs @@ -350,6 +350,7 @@ impl crate::TypeInner { Ti::Scalar(scalar) | Ti::Vector { scalar, .. } | Ti::Matrix { scalar, .. } => { Some(scalar) } + Ti::CooperativeMatrix { .. } => None, Ti::Array { base, .. } => types[base].inner.automatically_convertible_scalar(types), Ti::Atomic(_) | Ti::Pointer { .. } @@ -375,6 +376,7 @@ impl crate::TypeInner { Ti::Scalar(scalar) | Ti::Vector { scalar, .. } | Ti::Matrix { scalar, .. } => { Some(scalar) } + Ti::CooperativeMatrix { .. } => None, Ti::Atomic(_) => None, Ti::Pointer { base, .. } | Ti::Array { base, .. } => { types[base].inner.automatically_convertible_scalar(types) diff --git a/third_party/rust/naga/src/front/wgsl/lower/mod.rs b/third_party/rust/naga/src/front/wgsl/lower/mod.rs @@ -1040,6 +1040,13 @@ impl<T> Typed<T> { Self::Plain(expr) => Typed::Plain(f(expr)?), }) } + + fn ref_or<E>(self, error: E) -> core::result::Result<T, E> { + match self { + Self::Reference(v) => Ok(v), + Self::Plain(_) => Err(error), + } + } } /// A single vector component or swizzle. @@ -2021,6 +2028,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { stmt.span, function, arguments, + None, &mut ctx.as_expression(block, &mut emitter), true, )?; @@ -2106,12 +2114,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { let value_span = ctx.ast_expressions.get_span(value); let target = self .expression_for_reference(value, &mut ctx.as_expression(block, &mut emitter))?; - let target_handle = match target { - Typed::Reference(handle) => handle, - Typed::Plain(_) => { - return Err(Box::new(Error::BadIncrDecrReferenceType(value_span))) - } - }; + let target_handle = target.ref_or(Error::BadIncrDecrReferenceType(value_span))?; let mut ectx = ctx.as_expression(block, &mut emitter); let scalar = match *resolve_inner!(ectx, target_handle) { @@ -2267,7 +2270,8 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { let expr = match *global { LoweredGlobalDecl::Var(handle) => { let expr = ir::Expression::GlobalVariable(handle); - match ctx.module.global_variables[handle].space { + let v = &ctx.module.global_variables[handle]; + match v.space { ir::AddressSpace::Handle => Typed::Plain(expr), _ => Typed::Reference(expr), } @@ -2347,9 +2351,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { ast::Expression::Call { ref function, ref arguments, + result_ty, } => { let handle = self - .call(span, function, arguments, ctx, false)? + .call(span, function, arguments, result_ty, ctx, false)? .ok_or(Error::FunctionReturnsVoid(function.span))?; return Ok(Typed::Plain(handle)); } @@ -2690,6 +2695,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { span: Span, function: &ast::Ident<'source>, arguments: &[Handle<ast::Expression<'source>>], + result_ty: Option<(Handle<ast::Type<'source>>, Span)>, ctx: &mut ExpressionContext<'source, '_, '_>, is_statement: bool, ) -> Result<'source, Option<Handle<ir::Expression>>> { @@ -3361,7 +3367,6 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { ); return Ok(Some(result)); } - "quadSwapY" => { let mut args = ctx.prepare_args(arguments, 1, span); @@ -3385,7 +3390,6 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { ); return Ok(Some(result)); } - "quadSwapDiagonal" => { let mut args = ctx.prepare_args(arguments, 1, span); @@ -3409,6 +3413,101 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { ); return Ok(Some(result)); } + "coopLoad" | "coopLoadT" => { + let row_major = function.name.ends_with("T"); + let mut args = ctx.prepare_args(arguments, 1, span); + let pointer = self.expression(args.next()?, ctx)?; + let (matrix_ty, matrix_span) = result_ty.expect("generic argument"); + let (columns, rows, role) = match ctx.types[matrix_ty] { + ast::Type::CooperativeMatrix { + columns, + rows, + role, + .. + } => (columns, rows, role), + _ => { + return Err(Box::new(Error::InvalidCooperativeLoadType( + matrix_span, + ))) + } + }; + let stride = if args.total_args > 1 { + self.expression(args.next()?, ctx)? + } else { + // Infer the stride from the matrix type + let stride = if row_major { + columns as u32 + } else { + rows as u32 + }; + ctx.append_expression( + ir::Expression::Literal(ir::Literal::U32(stride)), + Span::UNDEFINED, + )? + }; + args.finish()?; + + crate::Expression::CooperativeLoad { + columns, + rows, + role, + data: crate::CooperativeData { + pointer, + stride, + row_major, + }, + } + } + "coopStore" | "coopStoreT" => { + let row_major = function.name.ends_with("T"); + + let mut args = ctx.prepare_args(arguments, 2, span); + let target = self.expression(args.next()?, ctx)?; + let pointer = self.expression(args.next()?, ctx)?; + let stride = if args.total_args > 2 { + self.expression(args.next()?, ctx)? + } else { + // Infer the stride from the matrix type + let stride = match *resolve_inner!(ctx, target) { + ir::TypeInner::CooperativeMatrix { columns, rows, .. } => { + if row_major { + columns as u32 + } else { + rows as u32 + } + } + _ => 0, + }; + ctx.append_expression( + ir::Expression::Literal(ir::Literal::U32(stride)), + Span::UNDEFINED, + )? + }; + args.finish()?; + + let rctx = ctx.runtime_expression_ctx(span)?; + rctx.block.push( + crate::Statement::CooperativeStore { + target, + data: crate::CooperativeData { + pointer, + stride, + row_major, + }, + }, + span, + ); + return Ok(None); + } + "coopMultiplyAdd" => { + let mut args = ctx.prepare_args(arguments, 3, span); + let a = self.expression(args.next()?, ctx)?; + let b = self.expression(args.next()?, ctx)?; + let c = self.expression(args.next()?, ctx)?; + args.finish()?; + + ir::Expression::CooperativeMultiplyAdd { a, b, c } + } _ => { return Err(Box::new(Error::UnknownIdent(function.span, function.name))) } @@ -4234,6 +4333,25 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { _ => return Err(Box::new(Error::BadMatrixScalarKind(ty_span, scalar))), } } + ast::Type::CooperativeMatrix { + columns, + rows, + ty, + ty_span, + role, + } => { + let ty = self.resolve_ast_type(ty, ctx)?; + let scalar = match ctx.module.types[ty].inner { + ir::TypeInner::Scalar(s) => s, + _ => return Err(Box::new(Error::UnsupportedCooperativeScalar(ty_span))), + }; + ir::TypeInner::CooperativeMatrix { + columns, + rows, + scalar, + role, + } + } ast::Type::Atomic(scalar) => scalar.to_inner_atomic(), ast::Type::Pointer { base, space } => { let base = self.resolve_ast_type(base, ctx)?; diff --git a/third_party/rust/naga/src/front/wgsl/parse/ast.rs b/third_party/rust/naga/src/front/wgsl/parse/ast.rs @@ -238,6 +238,13 @@ pub enum Type<'a> { ty: Handle<Type<'a>>, ty_span: Span, }, + CooperativeMatrix { + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + ty: Handle<Type<'a>>, + ty_span: Span, + role: crate::CooperativeRole, + }, Atomic(Scalar), Pointer { base: Handle<Type<'a>>, @@ -388,6 +395,21 @@ pub enum ConstructorType<'a> { ty_span: Span, }, + /// A cooperative matrix construction base `coop_mat8x8(...)`. + PartialCooperativeMatrix { + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + }, + + /// A full cooperative matrix construction `coop_mat8x8<f32,A>(...)`. + CooperativeMatrix { + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + ty: Handle<Type<'a>>, + ty_span: Span, + role: crate::CooperativeRole, + }, + /// An array whose component type and size are inferred from the arguments: /// `array(3,4,5)`. PartialArray, @@ -468,6 +490,7 @@ pub enum Expression<'a> { Call { function: Ident<'a>, arguments: Vec<Handle<Expression<'a>>>, + result_ty: Option<(Handle<Type<'a>>, Span)>, }, Index { base: Handle<Expression<'a>>, diff --git a/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs b/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs @@ -17,6 +17,7 @@ pub struct EnableExtensions { /// Whether `enable f16;` was written earlier in the shader module. f16: bool, clip_distances: bool, + wgpu_cooperative_matrix: bool, } impl EnableExtensions { @@ -28,6 +29,7 @@ impl EnableExtensions { f16: false, dual_source_blending: false, clip_distances: false, + wgpu_cooperative_matrix: false, } } @@ -42,6 +44,7 @@ impl EnableExtensions { ImplementedEnableExtension::DualSourceBlending => &mut self.dual_source_blending, ImplementedEnableExtension::F16 => &mut self.f16, ImplementedEnableExtension::ClipDistances => &mut self.clip_distances, + ImplementedEnableExtension::WgpuCooperativeMatrix => &mut self.wgpu_cooperative_matrix, }; *field = true; } @@ -57,6 +60,7 @@ impl EnableExtensions { ImplementedEnableExtension::DualSourceBlending => self.dual_source_blending, ImplementedEnableExtension::F16 => self.f16, ImplementedEnableExtension::ClipDistances => self.clip_distances, + ImplementedEnableExtension::WgpuCooperativeMatrix => self.wgpu_cooperative_matrix, } } } @@ -89,6 +93,7 @@ impl EnableExtension { const MESH_SHADER: &'static str = "wgpu_mesh_shader"; const RAY_QUERY: &'static str = "wgpu_ray_query"; const RAY_QUERY_VERTEX_RETURN: &'static str = "wgpu_ray_query_vertex_return"; + const COOPERATIVE_MATRIX: &'static str = "wgpu_cooperative_matrix"; const SUBGROUPS: &'static str = "subgroups"; const PRIMITIVE_INDEX: &'static str = "primitive_index"; @@ -105,6 +110,9 @@ impl EnableExtension { Self::RAY_QUERY_VERTEX_RETURN => { Self::Implemented(ImplementedEnableExtension::WgpuRayQueryVertexReturn) } + Self::COOPERATIVE_MATRIX => { + Self::Implemented(ImplementedEnableExtension::WgpuCooperativeMatrix) + } Self::SUBGROUPS => Self::Unimplemented(UnimplementedEnableExtension::Subgroups), Self::PRIMITIVE_INDEX => { Self::Unimplemented(UnimplementedEnableExtension::PrimitiveIndex) @@ -122,6 +130,7 @@ impl EnableExtension { ImplementedEnableExtension::WgpuRayQueryVertexReturn => { Self::RAY_QUERY_VERTEX_RETURN } + ImplementedEnableExtension::WgpuCooperativeMatrix => Self::COOPERATIVE_MATRIX, ImplementedEnableExtension::DualSourceBlending => Self::DUAL_SOURCE_BLENDING, ImplementedEnableExtension::F16 => Self::F16, ImplementedEnableExtension::ClipDistances => Self::CLIP_DISTANCES, @@ -161,6 +170,8 @@ pub enum ImplementedEnableExtension { WgpuRayQuery, /// Enables the `wgpu_ray_query_vertex_return` extension, native only. WgpuRayQueryVertexReturn, + /// Enables the `wgpu_cooperative_matrix` extension, native only. + WgpuCooperativeMatrix, } /// A variant of [`EnableExtension::Unimplemented`]. diff --git a/third_party/rust/naga/src/front/wgsl/parse/lexer.rs b/third_party/rust/naga/src/front/wgsl/parse/lexer.rs @@ -584,6 +584,18 @@ impl<'a> Lexer<'a> { }) } + pub(in crate::front::wgsl) fn next_cooperative_role( + &mut self, + ) -> Result<'a, crate::CooperativeRole> { + let (ident, span) = self.next_ident_with_span()?; + match ident { + "A" => Ok(crate::CooperativeRole::A), + "B" => Ok(crate::CooperativeRole::B), + "C" => Ok(crate::CooperativeRole::C), + _ => Err(Box::new(Error::UnknownAccess(span))), + } + } + pub(in crate::front::wgsl) fn open_arguments(&mut self) -> Result<'a, ()> { self.expect(Token::Paren('(')) } diff --git a/third_party/rust/naga/src/front/wgsl/parse/mod.rs b/third_party/rust/naga/src/front/wgsl/parse/mod.rs @@ -673,6 +673,14 @@ impl Parser { ty_span: Span::UNDEFINED, })) } + "coop_mat8x8" => ast::ConstructorType::PartialCooperativeMatrix { + columns: crate::CooperativeSize::Eight, + rows: crate::CooperativeSize::Eight, + }, + "coop_mat16x16" => ast::ConstructorType::PartialCooperativeMatrix { + columns: crate::CooperativeSize::Sixteen, + rows: crate::CooperativeSize::Sixteen, + }, "array" => ast::ConstructorType::PartialArray, "atomic" | "binding_array" @@ -716,6 +724,19 @@ impl Parser { ty_span, })) } + ( + Token::Paren('<'), + ast::ConstructorType::PartialCooperativeMatrix { columns, rows }, + ) => { + let (ty, ty_span, role) = self.cooperative_scalar_and_role(lexer, ctx)?; + Ok(Some(ast::ConstructorType::CooperativeMatrix { + columns, + rows, + ty, + ty_span, + role, + })) + } (Token::Paren('<'), ast::ConstructorType::PartialArray) => { lexer.expect_generic_paren('<')?; let base = self.type_decl(lexer, ctx)?; @@ -798,6 +819,11 @@ impl Parser { } // everything else must be handled later, since they can be hidden by user-defined functions. _ => { + let result_ty = if lexer.peek().0 == Token::Paren('<') { + Some(self.singular_generic(lexer, ctx)?) + } else { + None + }; let arguments = self.arguments(lexer, ctx)?; ctx.unresolved.insert(ast::Dependency { ident: name, @@ -809,6 +835,7 @@ impl Parser { span: name_span, }, arguments, + result_ty, } } }; @@ -957,7 +984,7 @@ impl Parser { } else if let Token::Paren('(') = lexer.peek().0 { self.pop_rule_span(lexer); return self.function_call(lexer, word, span, ctx); - } else if word == "bitcast" { + } else if ["bitcast", "coopLoad"].contains(&word) { self.pop_rule_span(lexer); return self.function_call(lexer, word, span, ctx); } else { @@ -1452,6 +1479,22 @@ impl Parser { Ok((ty, span)) } + /// Parses `<T,R>`, returning (T, span of T, R) + fn cooperative_scalar_and_role<'a>( + &mut self, + lexer: &mut Lexer<'a>, + ctx: &mut ExpressionContext<'a, '_, '_>, + ) -> Result<'a, (Handle<ast::Type<'a>>, Span, crate::CooperativeRole)> { + lexer.expect_generic_paren('<')?; + let start = lexer.start_byte_offset(); + let ty = self.type_decl(lexer, ctx)?; + let ty_span = lexer.span_from(start); + lexer.expect(Token::Separator(','))?; + let role = lexer.next_cooperative_role()?; + lexer.expect_generic_paren('>')?; + Ok((ty, ty_span, role)) + } + fn matrix_with_type<'a>( &mut self, lexer: &mut Lexer<'a>, @@ -1468,6 +1511,23 @@ impl Parser { }) } + fn cooperative_matrix_with_type<'a>( + &mut self, + lexer: &mut Lexer<'a>, + ctx: &mut ExpressionContext<'a, '_, '_>, + columns: crate::CooperativeSize, + rows: crate::CooperativeSize, + ) -> Result<'a, ast::Type<'a>> { + let (ty, ty_span, role) = self.cooperative_scalar_and_role(lexer, ctx)?; + Ok(ast::Type::CooperativeMatrix { + columns, + rows, + ty, + ty_span, + role, + }) + } + fn type_decl_impl<'a>( &mut self, lexer: &mut Lexer<'a>, @@ -1699,6 +1759,18 @@ impl Parser { ty: ctx.new_scalar(Scalar::F16), ty_span: Span::UNDEFINED, }, + "coop_mat8x8" => self.cooperative_matrix_with_type( + lexer, + ctx, + crate::CooperativeSize::Eight, + crate::CooperativeSize::Eight, + )?, + "coop_mat16x16" => self.cooperative_matrix_with_type( + lexer, + ctx, + crate::CooperativeSize::Sixteen, + crate::CooperativeSize::Sixteen, + )?, "atomic" => { let scalar = lexer.next_scalar_generic()?; ast::Type::Atomic(scalar) diff --git a/third_party/rust/naga/src/ir/mod.rs b/third_party/rust/naga/src/ir/mod.rs @@ -495,6 +495,17 @@ impl From<VectorSize> for u32 { } } +/// Number of components in a cooperative vector. +#[repr(u8)] +#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] +#[cfg_attr(feature = "serialize", derive(Serialize))] +#[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +pub enum CooperativeSize { + Eight = 8, + Sixteen = 16, +} + /// Primitive type for a scalar. #[repr(u8)] #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] @@ -522,6 +533,18 @@ pub enum ScalarKind { AbstractFloat, } +/// Role of a cooperative variable in the equation "A * B + C" +#[repr(u8)] +#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] +#[cfg_attr(feature = "serialize", derive(Serialize))] +#[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +pub enum CooperativeRole { + A, + B, + C, +} + /// Characteristics of a scalar type. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize))] @@ -770,6 +793,14 @@ pub enum TypeInner { rows: VectorSize, scalar: Scalar, }, + /// Matrix that is cooperatively processed by all the threads + /// in an opaque mapping. + CooperativeMatrix { + columns: CooperativeSize, + rows: CooperativeSize, + scalar: Scalar, + role: CooperativeRole, + }, /// Atomic scalar. Atomic(Scalar), /// Pointer to another type. @@ -1468,6 +1499,16 @@ bitflags::bitflags! { } } +#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] +#[cfg_attr(feature = "serialize", derive(Serialize))] +#[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +pub struct CooperativeData { + pub pointer: Handle<Expression>, + pub stride: Handle<Expression>, + pub row_major: bool, +} + /// An expression that can be evaluated to obtain a value. /// /// This is a Single Static Assignment (SSA) scheme similar to SPIR-V. @@ -1812,6 +1853,20 @@ pub enum Expression { /// [`SubgroupCollectiveOperation`]: Statement::SubgroupCollectiveOperation /// [`SubgroupGather`]: Statement::SubgroupGather SubgroupOperationResult { ty: Handle<Type> }, + + /// Load a cooperative primitive from memory. + CooperativeLoad { + columns: CooperativeSize, + rows: CooperativeSize, + role: CooperativeRole, + data: CooperativeData, + }, + /// Compute `a * b + c` + CooperativeMultiplyAdd { + a: Handle<Expression>, + b: Handle<Expression>, + c: Handle<Expression>, + }, } /// The value of the switch case. @@ -2253,6 +2308,11 @@ pub enum Statement { /// [`SubgroupOperationResult`]: Expression::SubgroupOperationResult result: Handle<Expression>, }, + /// Store a cooperative primitive into memory. + CooperativeStore { + target: Handle<Expression>, + data: CooperativeData, + }, } /// A function argument. diff --git a/third_party/rust/naga/src/proc/constant_evaluator.rs b/third_party/rust/naga/src/proc/constant_evaluator.rs @@ -970,6 +970,8 @@ pub enum ConstantEvaluatorError { "Expected reject and accept args. to be scalars of vectors of the same type, got something else", )] SelectAcceptRejectTypeMismatch, + #[error("Cooperative operations can't be constant")] + CooperativeOperation, } impl<'a> ConstantEvaluator<'a> { @@ -1362,6 +1364,9 @@ impl<'a> ConstantEvaluator<'a> { Expression::SubgroupOperationResult { .. } => { Err(ConstantEvaluatorError::SubgroupExpression) } + Expression::CooperativeLoad { .. } | Expression::CooperativeMultiplyAdd { .. } => { + Err(ConstantEvaluatorError::CooperativeOperation) + } } } diff --git a/third_party/rust/naga/src/proc/layouter.rs b/third_party/rust/naga/src/proc/layouter.rs @@ -86,6 +86,12 @@ impl From<crate::VectorSize> for Alignment { } } +impl From<crate::CooperativeSize> for Alignment { + fn from(size: crate::CooperativeSize) -> Self { + Self(unsafe { NonZeroU32::new_unchecked(size as u32) }) + } +} + /// Size and alignment information for a type. #[derive(Clone, Copy, Debug, Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -213,6 +219,19 @@ impl Layouter { alignment: Alignment::from(rows) * alignment, } } + Ti::CooperativeMatrix { + columns: _, + rows, + scalar, + role: _, + } => { + let alignment = Alignment::new(scalar.width as u32) + .ok_or(LayoutErrorInner::NonPowerOfTwoWidth.with(ty_handle))?; + TypeLayout { + size, + alignment: Alignment::from(rows) * alignment, + } + } Ti::Pointer { .. } | Ti::ValuePointer { .. } => TypeLayout { size, alignment: Alignment::ONE, diff --git a/third_party/rust/naga/src/proc/terminator.rs b/third_party/rust/naga/src/proc/terminator.rs @@ -43,7 +43,8 @@ pub fn ensure_block_returns(block: &mut crate::Block) { | S::SubgroupCollectiveOperation { .. } | S::SubgroupGather { .. } | S::ControlBarrier(_) - | S::MemoryBarrier(_)), + | S::MemoryBarrier(_) + | S::CooperativeStore { .. }), ) | None => block.push(S::Return { value: None }, Default::default()), } diff --git a/third_party/rust/naga/src/proc/type_methods.rs b/third_party/rust/naga/src/proc/type_methods.rs @@ -141,6 +141,7 @@ impl crate::TypeInner { match *self { Ti::Scalar(scalar) | Ti::Vector { scalar, .. } => Some(scalar), Ti::Matrix { scalar, .. } => Some(scalar), + Ti::CooperativeMatrix { scalar, .. } => Some(scalar), _ => None, } } @@ -208,8 +209,8 @@ impl crate::TypeInner { pub fn is_atomic_pointer(&self, types: &crate::UniqueArena<crate::Type>) -> bool { match *self { - crate::TypeInner::Pointer { base, .. } => match types[base].inner { - crate::TypeInner::Atomic { .. } => true, + Self::Pointer { base, .. } => match types[base].inner { + Self::Atomic { .. } => true, _ => false, }, _ => false, @@ -228,6 +229,12 @@ impl crate::TypeInner { rows, scalar, } => Some(super::Alignment::from(rows) * scalar.width as u32 * columns as u32), + Self::CooperativeMatrix { + columns, + rows, + scalar, + role: _, + } => Some(columns as u32 * rows as u32 * scalar.width as u32), Self::Pointer { .. } | Self::ValuePointer { .. } => Some(POINTER_SPAN), Self::Array { base: _, @@ -387,6 +394,7 @@ impl crate::TypeInner { crate::TypeInner::Scalar(scalar) => Some((None, scalar)), crate::TypeInner::Vector { size, scalar } => Some((Some(size), scalar)), crate::TypeInner::Matrix { .. } + | crate::TypeInner::CooperativeMatrix { .. } | crate::TypeInner::Atomic(_) | crate::TypeInner::Pointer { .. } | crate::TypeInner::ValuePointer { .. } @@ -411,7 +419,8 @@ impl crate::TypeInner { | crate::TypeInner::Matrix { scalar, .. } | crate::TypeInner::Atomic(scalar) => scalar.is_abstract(), crate::TypeInner::Array { base, .. } => types[base].inner.is_abstract(types), - crate::TypeInner::ValuePointer { .. } + crate::TypeInner::CooperativeMatrix { .. } + | crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Pointer { .. } | crate::TypeInner::Struct { .. } | crate::TypeInner::Image { .. } diff --git a/third_party/rust/naga/src/proc/typifier.rs b/third_party/rust/naga/src/proc/typifier.rs @@ -143,6 +143,17 @@ impl Clone for TypeResolution { columns, scalar, }, + Ti::CooperativeMatrix { + columns, + rows, + scalar, + role, + } => Ti::CooperativeMatrix { + columns, + rows, + scalar, + role, + }, Ti::Pointer { base, space } => Ti::Pointer { base, space }, Ti::ValuePointer { size, @@ -476,7 +487,7 @@ impl<'a> ResolveContext<'a> { None => Ti::Scalar(scalar), }), ref other => { - log::error!("Pointer type {other:?}"); + log::error!("Pointer {pointer:?} type {other:?}"); return Err(ResolveError::InvalidPointer(pointer)); } }, @@ -587,6 +598,20 @@ impl<'a> ResolveContext<'a> { (&Ti::Scalar { .. }, _) => res_right.clone(), (_, &Ti::Scalar { .. }) => res_left.clone(), (&Ti::Vector { .. }, &Ti::Vector { .. }) => res_left.clone(), + ( + &Ti::CooperativeMatrix { + columns: _, + rows, + scalar, + role, + }, + &Ti::CooperativeMatrix { columns, .. }, + ) => TypeResolution::Value(Ti::CooperativeMatrix { + columns, + rows, + scalar, + role, + }), (tl, tr) => { return Err(ResolveError::IncompatibleOperands(format!( "{tl:?} * {tr:?}" @@ -776,6 +801,25 @@ impl<'a> ResolveContext<'a> { scalar: crate::Scalar::U32, size: crate::VectorSize::Quad, }), + crate::Expression::CooperativeLoad { + columns, + rows, + role, + ref data, + } => { + let scalar = past(data.pointer)? + .inner_with(types) + .pointer_base_type() + .and_then(|tr| tr.inner_with(types).scalar()) + .ok_or(ResolveError::InvalidPointer(data.pointer))?; + TypeResolution::Value(Ti::CooperativeMatrix { + columns, + rows, + scalar, + role, + }) + } + crate::Expression::CooperativeMultiplyAdd { a: _, b: _, c } => past(c)?.clone(), }) } } diff --git a/third_party/rust/naga/src/valid/analyzer.rs b/third_party/rust/naga/src/valid/analyzer.rs @@ -29,6 +29,7 @@ bitflags::bitflags! { const WORK_GROUP_BARRIER = 0x1; const DERIVATIVE = if DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE { 0 } else { 0x2 }; const IMPLICIT_LEVEL = if DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE { 0 } else { 0x4 }; + const COOP_OPS = 0x8; } } @@ -843,6 +844,14 @@ impl FunctionInfo { non_uniform_result: self.add_ref(query), requirements: UniformityRequirements::empty(), }, + E::CooperativeLoad { ref data, .. } => Uniformity { + non_uniform_result: self.add_ref(data.pointer).or(self.add_ref(data.stride)), + requirements: UniformityRequirements::COOP_OPS, + }, + E::CooperativeMultiplyAdd { a, b, c } => Uniformity { + non_uniform_result: self.add_ref(a).or(self.add_ref(b).or(self.add_ref(c))), + requirements: UniformityRequirements::COOP_OPS, + }, }; let ty = resolve_context.resolve(expression, |h| Ok(&self[h].ty))?; @@ -1172,6 +1181,16 @@ impl FunctionInfo { } FunctionUniformity::new() } + S::CooperativeStore { target, ref data } => FunctionUniformity { + result: Uniformity { + non_uniform_result: self + .add_ref(target) + .or(self.add_ref_impl(data.pointer, GlobalUse::WRITE)) + .or(self.add_ref(data.stride)), + requirements: UniformityRequirements::COOP_OPS, + }, + exit: ExitFlags::empty(), + }, }; disruptor = disruptor.or(uniformity.exit_disruptor()); diff --git a/third_party/rust/naga/src/valid/expression.rs b/third_party/rust/naga/src/valid/expression.rs @@ -141,6 +141,8 @@ pub enum ExpressionError { Literal(#[from] LiteralError), #[error("{0:?} is not supported for Width {2} {1:?} arguments yet, see https://github.com/gfx-rs/wgpu/issues/5276")] UnsupportedWidth(crate::MathFunction, crate::ScalarKind, crate::Bytes), + #[error("Invalid operand for cooperative op")] + InvalidCooperativeOperand(Handle<crate::Expression>), } #[derive(Clone, Debug, thiserror::Error)] @@ -788,7 +790,9 @@ impl super::Validator { Sk::Uint | Sk::Sint | Sk::Float => left_inner == right_inner, Sk::Bool | Sk::AbstractInt | Sk::AbstractFloat => false, }, - Ti::Matrix { .. } => left_inner == right_inner, + Ti::Matrix { .. } | Ti::CooperativeMatrix { .. } => { + left_inner == right_inner + } _ => false, }, Bo::Divide | Bo::Modulo => match *left_inner { @@ -818,7 +822,7 @@ impl super::Validator { scalar: scalar2, .. }, ) => scalar1 == scalar2, - // Scalar/matrix. + // Scalar * matrix. ( &Ti::Scalar(Sc { kind: Sk::Float, .. @@ -831,7 +835,7 @@ impl super::Validator { kind: Sk::Float, .. }), ) => true, - // Vector/vector. + // Vector * vector. ( &Ti::Vector { size: size1, @@ -864,9 +868,15 @@ impl super::Validator { }, &Ti::Matrix { rows, .. }, ) => size == rows, + // Matrix * matrix. (&Ti::Matrix { columns, .. }, &Ti::Matrix { rows, .. }) => { columns == rows } + // Scalar * coop matrix. + (&Ti::Scalar(s1), &Ti::CooperativeMatrix { scalar: s2, .. }) + | (&Ti::CooperativeMatrix { scalar: s1, .. }, &Ti::Scalar(s2)) => { + s1 == s2 + } _ => false, }; let left_width = left_inner.scalar_width().unwrap_or(0); @@ -1230,6 +1240,33 @@ impl super::Validator { } }, E::SubgroupBallotResult | E::SubgroupOperationResult { .. } => self.subgroup_stages, + E::CooperativeLoad { ref data, .. } => { + if resolver[data.pointer] + .pointer_base_type() + .and_then(|tr| tr.inner_with(&module.types).scalar()) + .is_none() + { + return Err(ExpressionError::InvalidPointerType(data.pointer)); + } + ShaderStages::COMPUTE + } + E::CooperativeMultiplyAdd { a, b, c } => { + let roles = [ + crate::CooperativeRole::A, + crate::CooperativeRole::B, + crate::CooperativeRole::C, + ]; + for (operand, expected_role) in [a, b, c].into_iter().zip(roles) { + match resolver[operand] { + Ti::CooperativeMatrix { role, .. } if role == expected_role => {} + ref other => { + log::error!("{expected_role:?} operand type: {other:?}"); + return Err(ExpressionError::InvalidCooperativeOperand(a)); + } + } + } + ShaderStages::COMPUTE + } }; Ok(stages) } diff --git a/third_party/rust/naga/src/valid/function.rs b/third_party/rust/naga/src/valid/function.rs @@ -1,6 +1,5 @@ use alloc::{format, string::String}; -use super::validate_atomic_compare_exchange_struct; use super::{ analyzer::{UniformityDisruptor, UniformityRequirements}, ExpressionError, FunctionInfo, ModuleInfo, @@ -213,6 +212,10 @@ pub enum FunctionError { WorkgroupUniformLoadInvalidPointer(Handle<crate::Expression>), #[error("Subgroup operation is invalid")] InvalidSubgroup(#[from] SubgroupError), + #[error("Invalid target type for a cooperative store")] + InvalidCooperativeStoreTarget(Handle<crate::Expression>), + #[error("Cooperative load/store data pointer has invalid type")] + InvalidCooperativeDataPointer(Handle<crate::Expression>), #[error("Emit statement should not cover \"result\" expressions like {0:?}")] EmitResult(Handle<crate::Expression>), #[error("Expression not visited by the appropriate statement")] @@ -584,7 +587,7 @@ impl super::Validator { .with_span_handle(result, context.expressions) .into_other()); }; - if !validate_atomic_compare_exchange_struct( + if !super::validate_atomic_compare_exchange_struct( context.types, members, |ty: &crate::TypeInner| *ty == crate::TypeInner::Scalar(pointer_scalar), @@ -804,7 +807,9 @@ impl super::Validator { | Ex::As { .. } | Ex::ArrayLength(_) | Ex::RayQueryGetIntersection { .. } - | Ex::RayQueryVertexPositions { .. } => { + | Ex::RayQueryVertexPositions { .. } + | Ex::CooperativeLoad { .. } + | Ex::CooperativeMultiplyAdd { .. } => { self.emit_expression(handle, context)? } Ex::CallResult(_) @@ -1626,6 +1631,37 @@ impl super::Validator { } self.validate_subgroup_gather(mode, argument, result, context)?; } + S::CooperativeStore { target, ref data } => { + stages &= super::ShaderStages::COMPUTE; + + let target_scalar = + match *context.resolve_type_inner(target, &self.valid_expression_set)? { + Ti::CooperativeMatrix { scalar, .. } => scalar, + ref other => { + log::error!("Target operand type: {other:?}"); + return Err(FunctionError::InvalidCooperativeStoreTarget(target) + .with_span_handle(target, context.expressions)); + } + }; + + let ptr_ty = context.resolve_pointer_type(data.pointer); + let ptr_scalar = ptr_ty + .pointer_base_type() + .and_then(|tr| tr.inner_with(context.types).scalar()); + if ptr_scalar != Some(target_scalar) { + return Err(FunctionError::InvalidCooperativeDataPointer(data.pointer) + .with_span_handle(data.pointer, context.expressions)); + } + + let ptr_space = ptr_ty.pointer_space().unwrap_or(AddressSpace::Handle); + if !ptr_space.access().contains(crate::StorageAccess::STORE) { + return Err(FunctionError::InvalidStorePointer(data.pointer) + .with_span_static( + context.expressions.get_span(data.pointer), + "writing to this location is not permitted", + )); + } + } } } Ok(BlockInfo { stages }) diff --git a/third_party/rust/naga/src/valid/handles.rs b/third_party/rust/naga/src/valid/handles.rs @@ -394,6 +394,7 @@ impl super::Validator { crate::TypeInner::Scalar { .. } | crate::TypeInner::Vector { .. } | crate::TypeInner::Matrix { .. } + | crate::TypeInner::CooperativeMatrix { .. } | crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Atomic { .. } | crate::TypeInner::Image { .. } @@ -662,6 +663,12 @@ impl super::Validator { } => { handle.check_dep(query)?; } + crate::Expression::CooperativeLoad { ref data, .. } => { + handle.check_dep(data.pointer)?.check_dep(data.stride)?; + } + crate::Expression::CooperativeMultiplyAdd { a, b, c } => { + handle.check_dep(a)?.check_dep(b)?.check_dep(c)?; + } } Ok(()) } @@ -850,6 +857,12 @@ impl super::Validator { validate_expr(result)?; Ok(()) } + crate::Statement::CooperativeStore { target, ref data } => { + validate_expr(target)?; + validate_expr(data.pointer)?; + validate_expr(data.stride)?; + Ok(()) + } crate::Statement::Break | crate::Statement::Continue | crate::Statement::Kill diff --git a/third_party/rust/naga/src/valid/mod.rs b/third_party/rust/naga/src/valid/mod.rs @@ -200,6 +200,8 @@ bitflags::bitflags! { const STORAGE_TEXTURE_BINDING_ARRAY_NON_UNIFORM_INDEXING = 1 << 34; /// Support for non-uniform indexing of binding arrays of storage buffers. const STORAGE_BUFFER_BINDING_ARRAY_NON_UNIFORM_INDEXING = 1 << 35; + /// Support for cooperative matrix types and operations + const COOPERATIVE_MATRIX = 1 << 36; } } @@ -471,6 +473,7 @@ impl crate::TypeInner { Self::Scalar { .. } | Self::Vector { .. } | Self::Matrix { .. } + | Self::CooperativeMatrix { .. } | Self::Array { size: crate::ArraySize::Constant(_), .. diff --git a/third_party/rust/naga/src/valid/type.rs b/third_party/rust/naga/src/valid/type.rs @@ -418,6 +418,30 @@ impl super::Validator { type_info.immediates_compatibility = immediates_compatibility; type_info } + Ti::CooperativeMatrix { + columns: _, + rows: _, + scalar, + role: _, + } => { + self.require_type_capability(Capabilities::COOPERATIVE_MATRIX)?; + // Allow f16 (width 2) and f32 (width 4) for cooperative matrices + if scalar.kind != crate::ScalarKind::Float + || (scalar.width != 2 && scalar.width != 4) + { + return Err(TypeError::MatrixElementNotFloat); + } + TypeInfo::new( + TypeFlags::DATA + | TypeFlags::SIZED + | TypeFlags::COPY + | TypeFlags::HOST_SHAREABLE + | TypeFlags::ARGUMENT + | TypeFlags::CONSTRUCTIBLE + | TypeFlags::CREATION_RESOLVED, + Alignment::from_width(scalar.width), + ) + } Ti::Atomic(scalar) => { match scalar { crate::Scalar { diff --git a/third_party/rust/spirv/.cargo-checksum.json b/third_party/rust/spirv/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"29fbbbc568f51d6ab5154843bdd673427f083c459db8c6d366ec8f2078c39431","README.md":"d0a33acc70ea5212e5fc6b5d5c88db60b38753b2591f67ebf06644aa13d6e631","autogen_spirv.rs":"236bd685f9eb20b9a82a6c0fef1553a6365b24a7848ae2b681df3c1528edc080","lib.rs":"334f71db6c449cbea3c6f7485abf9c8b91be968e532758ead3a7a834f1284440","release.toml":"a9c4eb6eaa1b3b8eb7ff742ec4963be32ec1ec7664c8a52218cc74898bad3ec4"},"package":"eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"} -\ No newline at end of file +{"files":{"Cargo.toml":"56c1a468e1b53c107b7688ec1a02eb13a72997b7c67361baf8c369e1c81f390a","README.md":"ae75ebf3b873d209b91810269a033afb4957f5d14d13c5a383750bfd9552eaf2","autogen_spirv.rs":"102b7890842c4f8469f8cf917960df6be9326278df7b7b8e47d7f7e22c0a423a","lib.rs":"9cd2a46900230bd3e92576044a3654a26015ec273d1505aab85cdcdd0cebcfe6","release.toml":"a9c4eb6eaa1b3b8eb7ff742ec4963be32ec1ec7664c8a52218cc74898bad3ec4"},"package":null} +\ No newline at end of file diff --git a/third_party/rust/spirv/Cargo.toml b/third_party/rust/spirv/Cargo.toml @@ -12,8 +12,14 @@ [package] edition = "2018" name = "spirv" -version = "0.3.0+sdk-1.3.268.0" +version = "0.3.0+sdk-1.4.309.0" authors = ["Lei Zhang <antiagainst@gmail.com>"] +build = false +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false description = "Rust definition of SPIR-V structs and enums" documentation = "https://docs.rs/spirv" readme = "README.md" @@ -26,17 +32,6 @@ keywords = [ license = "Apache-2.0" repository = "https://github.com/gfx-rs/rspirv" -[lib] -path = "lib.rs" - -[dependencies.bitflags] -version = "2.0" - -[dependencies.serde] -version = "1" -features = ["derive"] -optional = true - [features] deserialize = [ "serde", @@ -46,3 +41,16 @@ serialize = [ "serde", "bitflags/serde", ] + +[lib] +name = "spirv" +path = "lib.rs" + +[dependencies] +bitflags = "2.0" + +[dependencies.serde] +version = "1" +features = ["derive"] +optional = true +default-features = false diff --git a/third_party/rust/spirv/README.md b/third_party/rust/spirv/README.md @@ -21,15 +21,6 @@ First add to your `Cargo.toml`: spirv = "0.3.0" ``` -Version -------- - -Note that the major and minor version of this create is tracking the SPIR-V spec, -while the patch number is used for bugfixes for the crate itself. So version -`1.4.2` is tracking SPIR-V 1.4 but not necessarily revision 2. Major client APIs -like Vulkan/OpenCL pin to a specific major and minor version, regardless of the -revision. - Examples -------- diff --git a/third_party/rust/spirv/autogen_spirv.rs b/third_party/rust/spirv/autogen_spirv.rs @@ -6,17 +6,18 @@ pub type Word = u32; pub const MAGIC_NUMBER: u32 = 0x07230203; pub const MAJOR_VERSION: u8 = 1u8; pub const MINOR_VERSION: u8 = 6u8; -pub const REVISION: u8 = 1u8; -bitflags! { # [doc = "SPIR-V operand kind: [ImageOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_operands_a_image_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct ImageOperands : u32 { const NONE = 0u32 ; const BIAS = 1u32 ; const LOD = 2u32 ; const GRAD = 4u32 ; const CONST_OFFSET = 8u32 ; const OFFSET = 16u32 ; const CONST_OFFSETS = 32u32 ; const SAMPLE = 64u32 ; const MIN_LOD = 128u32 ; const MAKE_TEXEL_AVAILABLE = 256u32 ; const MAKE_TEXEL_AVAILABLE_KHR = 256u32 ; const MAKE_TEXEL_VISIBLE = 512u32 ; const MAKE_TEXEL_VISIBLE_KHR = 512u32 ; const NON_PRIVATE_TEXEL = 1024u32 ; const NON_PRIVATE_TEXEL_KHR = 1024u32 ; const VOLATILE_TEXEL = 2048u32 ; const VOLATILE_TEXEL_KHR = 2048u32 ; const SIGN_EXTEND = 4096u32 ; const ZERO_EXTEND = 8192u32 ; const NONTEMPORAL = 16384u32 ; const OFFSETS = 65536u32 ; } } -bitflags! { # [doc = "SPIR-V operand kind: [FPFastMathMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_fast_math_mode_a_fp_fast_math_mode)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FPFastMathMode : u32 { const NONE = 0u32 ; const NOT_NAN = 1u32 ; const NOT_INF = 2u32 ; const NSZ = 4u32 ; const ALLOW_RECIP = 8u32 ; const FAST = 16u32 ; const ALLOW_CONTRACT_FAST_INTEL = 65536u32 ; const ALLOW_REASSOC_INTEL = 131072u32 ; } } +pub const REVISION: u8 = 4u8; +bitflags! { # [doc = "SPIR-V operand kind: [ImageOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_operands_a_image_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct ImageOperands : u32 { const NONE = 0u32 ; const BIAS = 1u32 ; const LOD = 2u32 ; const GRAD = 4u32 ; const CONST_OFFSET = 8u32 ; const OFFSET = 16u32 ; const CONST_OFFSETS = 32u32 ; const SAMPLE = 64u32 ; const MIN_LOD = 128u32 ; const MAKE_TEXEL_AVAILABLE = 256u32 ; const MAKE_TEXEL_VISIBLE = 512u32 ; const NON_PRIVATE_TEXEL = 1024u32 ; const VOLATILE_TEXEL = 2048u32 ; const SIGN_EXTEND = 4096u32 ; const ZERO_EXTEND = 8192u32 ; const NONTEMPORAL = 16384u32 ; const OFFSETS = 65536u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [FPFastMathMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_fast_math_mode_a_fp_fast_math_mode)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FPFastMathMode : u32 { const NONE = 0u32 ; const NOT_NAN = 1u32 ; const NOT_INF = 2u32 ; const NSZ = 4u32 ; const ALLOW_RECIP = 8u32 ; const FAST = 16u32 ; const ALLOW_CONTRACT = 65536u32 ; const ALLOW_REASSOC = 131072u32 ; const ALLOW_TRANSFORM = 262144u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [SelectionControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_selection_control_a_selection_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct SelectionControl : u32 { const NONE = 0u32 ; const FLATTEN = 1u32 ; const DONT_FLATTEN = 2u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [LoopControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_loop_control_a_loop_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct LoopControl : u32 { const NONE = 0u32 ; const UNROLL = 1u32 ; const DONT_UNROLL = 2u32 ; const DEPENDENCY_INFINITE = 4u32 ; const DEPENDENCY_LENGTH = 8u32 ; const MIN_ITERATIONS = 16u32 ; const MAX_ITERATIONS = 32u32 ; const ITERATION_MULTIPLE = 64u32 ; const PEEL_COUNT = 128u32 ; const PARTIAL_COUNT = 256u32 ; const INITIATION_INTERVAL_INTEL = 65536u32 ; const MAX_CONCURRENCY_INTEL = 131072u32 ; const DEPENDENCY_ARRAY_INTEL = 262144u32 ; const PIPELINE_ENABLE_INTEL = 524288u32 ; const LOOP_COALESCE_INTEL = 1048576u32 ; const MAX_INTERLEAVING_INTEL = 2097152u32 ; const SPECULATED_ITERATIONS_INTEL = 4194304u32 ; const NO_FUSION_INTEL = 8388608u32 ; const LOOP_COUNT_INTEL = 16777216u32 ; const MAX_REINVOCATION_DELAY_INTEL = 33554432u32 ; } } -bitflags! { # [doc = "SPIR-V operand kind: [FunctionControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_function_control_a_function_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FunctionControl : u32 { const NONE = 0u32 ; const INLINE = 1u32 ; const DONT_INLINE = 2u32 ; const PURE = 4u32 ; const CONST = 8u32 ; const OPT_NONE_INTEL = 65536u32 ; } } -bitflags! { # [doc = "SPIR-V operand kind: [MemorySemantics](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_semantics_a_memory_semantics)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemorySemantics : u32 { const RELAXED = 0u32 ; const NONE = 0u32 ; const ACQUIRE = 2u32 ; const RELEASE = 4u32 ; const ACQUIRE_RELEASE = 8u32 ; const SEQUENTIALLY_CONSISTENT = 16u32 ; const UNIFORM_MEMORY = 64u32 ; const SUBGROUP_MEMORY = 128u32 ; const WORKGROUP_MEMORY = 256u32 ; const CROSS_WORKGROUP_MEMORY = 512u32 ; const ATOMIC_COUNTER_MEMORY = 1024u32 ; const IMAGE_MEMORY = 2048u32 ; const OUTPUT_MEMORY = 4096u32 ; const OUTPUT_MEMORY_KHR = 4096u32 ; const MAKE_AVAILABLE = 8192u32 ; const MAKE_AVAILABLE_KHR = 8192u32 ; const MAKE_VISIBLE = 16384u32 ; const MAKE_VISIBLE_KHR = 16384u32 ; const VOLATILE = 32768u32 ; } } -bitflags! { # [doc = "SPIR-V operand kind: [MemoryAccess](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_access_a_memory_access)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemoryAccess : u32 { const NONE = 0u32 ; const VOLATILE = 1u32 ; const ALIGNED = 2u32 ; const NONTEMPORAL = 4u32 ; const MAKE_POINTER_AVAILABLE = 8u32 ; const MAKE_POINTER_AVAILABLE_KHR = 8u32 ; const MAKE_POINTER_VISIBLE = 16u32 ; const MAKE_POINTER_VISIBLE_KHR = 16u32 ; const NON_PRIVATE_POINTER = 32u32 ; const NON_PRIVATE_POINTER_KHR = 32u32 ; const ALIAS_SCOPE_INTEL_MASK = 65536u32 ; const NO_ALIAS_INTEL_MASK = 131072u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [FunctionControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_function_control_a_function_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FunctionControl : u32 { const NONE = 0u32 ; const INLINE = 1u32 ; const DONT_INLINE = 2u32 ; const PURE = 4u32 ; const CONST = 8u32 ; const OPT_NONE_EXT = 65536u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [MemorySemantics](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_semantics_a_memory_semantics)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemorySemantics : u32 { const RELAXED = 0u32 ; const ACQUIRE = 2u32 ; const RELEASE = 4u32 ; const ACQUIRE_RELEASE = 8u32 ; const SEQUENTIALLY_CONSISTENT = 16u32 ; const UNIFORM_MEMORY = 64u32 ; const SUBGROUP_MEMORY = 128u32 ; const WORKGROUP_MEMORY = 256u32 ; const CROSS_WORKGROUP_MEMORY = 512u32 ; const ATOMIC_COUNTER_MEMORY = 1024u32 ; const IMAGE_MEMORY = 2048u32 ; const OUTPUT_MEMORY = 4096u32 ; const MAKE_AVAILABLE = 8192u32 ; const MAKE_VISIBLE = 16384u32 ; const VOLATILE = 32768u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [MemoryAccess](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_access_a_memory_access)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemoryAccess : u32 { const NONE = 0u32 ; const VOLATILE = 1u32 ; const ALIGNED = 2u32 ; const NONTEMPORAL = 4u32 ; const MAKE_POINTER_AVAILABLE = 8u32 ; const MAKE_POINTER_VISIBLE = 16u32 ; const NON_PRIVATE_POINTER = 32u32 ; const ALIAS_SCOPE_INTEL_MASK = 65536u32 ; const NO_ALIAS_INTEL_MASK = 131072u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [KernelProfilingInfo](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_kernel_profiling_info_a_kernel_profiling_info)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct KernelProfilingInfo : u32 { const NONE = 0u32 ; const CMD_EXEC_TIME = 1u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [RayFlags](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_ray_flags_a_ray_flags)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct RayFlags : u32 { const NONE_KHR = 0u32 ; const OPAQUE_KHR = 1u32 ; const NO_OPAQUE_KHR = 2u32 ; const TERMINATE_ON_FIRST_HIT_KHR = 4u32 ; const SKIP_CLOSEST_HIT_SHADER_KHR = 8u32 ; const CULL_BACK_FACING_TRIANGLES_KHR = 16u32 ; const CULL_FRONT_FACING_TRIANGLES_KHR = 32u32 ; const CULL_OPAQUE_KHR = 64u32 ; const CULL_NO_OPAQUE_KHR = 128u32 ; const SKIP_TRIANGLES_KHR = 256u32 ; const SKIP_AAB_BS_KHR = 512u32 ; const FORCE_OPACITY_MICROMAP2_STATE_EXT = 1024u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [FragmentShadingRate](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fragment_shading_rate_a_fragment_shading_rate)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FragmentShadingRate : u32 { const VERTICAL2_PIXELS = 1u32 ; const VERTICAL4_PIXELS = 2u32 ; const HORIZONTAL2_PIXELS = 4u32 ; const HORIZONTAL4_PIXELS = 8u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [RawAccessChainOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_raw_access_chain_operands_a_raw_access_chain_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct RawAccessChainOperands : u32 { const NONE = 0u32 ; const ROBUSTNESS_PER_COMPONENT_NV = 1u32 ; const ROBUSTNESS_PER_ELEMENT_NV = 2u32 ; } } #[doc = "SPIR-V operand kind: [SourceLanguage](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_source_language_a_source_language)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -36,11 +37,13 @@ pub enum SourceLanguage { NZSL = 9u32, WGSL = 10u32, Slang = 11u32, + Zig = 12u32, + Rust = 13u32, } impl SourceLanguage { pub fn from_u32(n: u32) -> Option<Self> { Some(match n { - 0u32..=11u32 => unsafe { core::mem::transmute::<u32, SourceLanguage>(n) }, + 0u32..=13u32 => unsafe { core::mem::transmute::<u32, SourceLanguage>(n) }, _ => return None, }) } @@ -50,21 +53,23 @@ impl SourceLanguage {} impl core::str::FromStr for SourceLanguage { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Unknown" => Ok(Self::Unknown), - "ESSL" => Ok(Self::ESSL), - "GLSL" => Ok(Self::GLSL), - "OpenCL_C" => Ok(Self::OpenCL_C), - "OpenCL_CPP" => Ok(Self::OpenCL_CPP), - "HLSL" => Ok(Self::HLSL), - "CPP_for_OpenCL" => Ok(Self::CPP_for_OpenCL), - "SYCL" => Ok(Self::SYCL), - "HERO_C" => Ok(Self::HERO_C), - "NZSL" => Ok(Self::NZSL), - "WGSL" => Ok(Self::WGSL), - "Slang" => Ok(Self::Slang), - _ => Err(()), - } + Ok(match s { + "Unknown" => Self::Unknown, + "ESSL" => Self::ESSL, + "GLSL" => Self::GLSL, + "OpenCL_C" => Self::OpenCL_C, + "OpenCL_CPP" => Self::OpenCL_CPP, + "HLSL" => Self::HLSL, + "CPP_for_OpenCL" => Self::CPP_for_OpenCL, + "SYCL" => Self::SYCL, + "HERO_C" => Self::HERO_C, + "NZSL" => Self::NZSL, + "WGSL" => Self::WGSL, + "Slang" => Self::Slang, + "Zig" => Self::Zig, + "Rust" => Self::Rust, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [ExecutionModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_model_a_execution_model)"] @@ -83,12 +88,12 @@ pub enum ExecutionModel { Kernel = 6u32, TaskNV = 5267u32, MeshNV = 5268u32, - RayGenerationNV = 5313u32, - IntersectionNV = 5314u32, - AnyHitNV = 5315u32, - ClosestHitNV = 5316u32, - MissNV = 5317u32, - CallableNV = 5318u32, + RayGenerationKHR = 5313u32, + IntersectionKHR = 5314u32, + AnyHitKHR = 5315u32, + ClosestHitKHR = 5316u32, + MissKHR = 5317u32, + CallableKHR = 5318u32, TaskEXT = 5364u32, MeshEXT = 5365u32, } @@ -105,42 +110,42 @@ impl ExecutionModel { } #[allow(non_upper_case_globals)] impl ExecutionModel { - pub const RayGenerationKHR: Self = Self::RayGenerationNV; - pub const IntersectionKHR: Self = Self::IntersectionNV; - pub const AnyHitKHR: Self = Self::AnyHitNV; - pub const ClosestHitKHR: Self = Self::ClosestHitNV; - pub const MissKHR: Self = Self::MissNV; - pub const CallableKHR: Self = Self::CallableNV; + pub const RayGenerationNV: Self = Self::RayGenerationKHR; + pub const IntersectionNV: Self = Self::IntersectionKHR; + pub const AnyHitNV: Self = Self::AnyHitKHR; + pub const ClosestHitNV: Self = Self::ClosestHitKHR; + pub const MissNV: Self = Self::MissKHR; + pub const CallableNV: Self = Self::CallableKHR; } impl core::str::FromStr for ExecutionModel { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Vertex" => Ok(Self::Vertex), - "TessellationControl" => Ok(Self::TessellationControl), - "TessellationEvaluation" => Ok(Self::TessellationEvaluation), - "Geometry" => Ok(Self::Geometry), - "Fragment" => Ok(Self::Fragment), - "GLCompute" => Ok(Self::GLCompute), - "Kernel" => Ok(Self::Kernel), - "TaskNV" => Ok(Self::TaskNV), - "MeshNV" => Ok(Self::MeshNV), - "RayGenerationNV" => Ok(Self::RayGenerationNV), - "RayGenerationKHR" => Ok(Self::RayGenerationNV), - "IntersectionNV" => Ok(Self::IntersectionNV), - "IntersectionKHR" => Ok(Self::IntersectionNV), - "AnyHitNV" => Ok(Self::AnyHitNV), - "AnyHitKHR" => Ok(Self::AnyHitNV), - "ClosestHitNV" => Ok(Self::ClosestHitNV), - "ClosestHitKHR" => Ok(Self::ClosestHitNV), - "MissNV" => Ok(Self::MissNV), - "MissKHR" => Ok(Self::MissNV), - "CallableNV" => Ok(Self::CallableNV), - "CallableKHR" => Ok(Self::CallableNV), - "TaskEXT" => Ok(Self::TaskEXT), - "MeshEXT" => Ok(Self::MeshEXT), - _ => Err(()), - } + Ok(match s { + "Vertex" => Self::Vertex, + "TessellationControl" => Self::TessellationControl, + "TessellationEvaluation" => Self::TessellationEvaluation, + "Geometry" => Self::Geometry, + "Fragment" => Self::Fragment, + "GLCompute" => Self::GLCompute, + "Kernel" => Self::Kernel, + "TaskNV" => Self::TaskNV, + "MeshNV" => Self::MeshNV, + "RayGenerationKHR" => Self::RayGenerationKHR, + "RayGenerationNV" => Self::RayGenerationKHR, + "IntersectionKHR" => Self::IntersectionKHR, + "IntersectionNV" => Self::IntersectionKHR, + "AnyHitKHR" => Self::AnyHitKHR, + "AnyHitNV" => Self::AnyHitKHR, + "ClosestHitKHR" => Self::ClosestHitKHR, + "ClosestHitNV" => Self::ClosestHitKHR, + "MissKHR" => Self::MissKHR, + "MissNV" => Self::MissKHR, + "CallableKHR" => Self::CallableKHR, + "CallableNV" => Self::CallableKHR, + "TaskEXT" => Self::TaskEXT, + "MeshEXT" => Self::MeshEXT, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [AddressingModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_addressing_model_a_addressing_model)"] @@ -171,14 +176,14 @@ impl AddressingModel { impl core::str::FromStr for AddressingModel { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Logical" => Ok(Self::Logical), - "Physical32" => Ok(Self::Physical32), - "Physical64" => Ok(Self::Physical64), - "PhysicalStorageBuffer64" => Ok(Self::PhysicalStorageBuffer64), - "PhysicalStorageBuffer64EXT" => Ok(Self::PhysicalStorageBuffer64), - _ => Err(()), - } + Ok(match s { + "Logical" => Self::Logical, + "Physical32" => Self::Physical32, + "Physical64" => Self::Physical64, + "PhysicalStorageBuffer64" => Self::PhysicalStorageBuffer64, + "PhysicalStorageBuffer64EXT" => Self::PhysicalStorageBuffer64, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [MemoryModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_model_a_memory_model)"] @@ -208,14 +213,14 @@ impl MemoryModel { impl core::str::FromStr for MemoryModel { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Simple" => Ok(Self::Simple), - "GLSL450" => Ok(Self::GLSL450), - "OpenCL" => Ok(Self::OpenCL), - "Vulkan" => Ok(Self::Vulkan), - "VulkanKHR" => Ok(Self::Vulkan), - _ => Err(()), - } + Ok(match s { + "Simple" => Self::Simple, + "GLSL450" => Self::GLSL450, + "OpenCL" => Self::OpenCL, + "Vulkan" => Self::Vulkan, + "VulkanKHR" => Self::Vulkan, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [ExecutionMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_mode_a_execution_mode)"] @@ -276,6 +281,7 @@ pub enum ExecutionMode { EarlyAndLateFragmentTestsAMD = 5017u32, StencilRefReplacingEXT = 5027u32, CoalescingAMDX = 5069u32, + IsApiEntryAMDX = 5070u32, MaxNodeRecursionAMDX = 5071u32, StaticNumWorkgroupsAMDX = 5072u32, ShaderIndexAMDX = 5073u32, @@ -286,11 +292,14 @@ pub enum ExecutionMode { StencilRefUnchangedBackAMD = 5082u32, StencilRefGreaterBackAMD = 5083u32, StencilRefLessBackAMD = 5084u32, - OutputLinesNV = 5269u32, - OutputPrimitivesNV = 5270u32, - DerivativeGroupQuadsNV = 5289u32, - DerivativeGroupLinearNV = 5290u32, - OutputTrianglesNV = 5298u32, + QuadDerivativesKHR = 5088u32, + RequireFullQuadsKHR = 5089u32, + SharesInputWithAMDX = 5102u32, + OutputLinesEXT = 5269u32, + OutputPrimitivesEXT = 5270u32, + DerivativeGroupQuadsKHR = 5289u32, + DerivativeGroupLinearKHR = 5290u32, + OutputTrianglesEXT = 5298u32, PixelInterlockOrderedEXT = 5366u32, PixelInterlockUnorderedEXT = 5367u32, SampleInterlockOrderedEXT = 5368u32, @@ -307,9 +316,14 @@ pub enum ExecutionMode { NoGlobalOffsetINTEL = 5895u32, NumSIMDWorkitemsINTEL = 5896u32, SchedulerTargetFmaxMhzINTEL = 5903u32, + MaximallyReconvergesKHR = 6023u32, + FPFastMathDefault = 6028u32, StreamingInterfaceINTEL = 6154u32, RegisterMapInterfaceINTEL = 6160u32, NamedBarrierCountINTEL = 6417u32, + MaximumRegistersINTEL = 6461u32, + MaximumRegistersIdINTEL = 6462u32, + NamedMaximumRegistersINTEL = 6463u32, } impl ExecutionMode { pub fn from_u32(n: u32) -> Option<Self> { @@ -323,10 +337,11 @@ impl ExecutionMode { 4459u32..=4463u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5017u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5017u32) }, 5027u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5027u32) }, - 5069u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5069u32) }, - 5071u32..=5073u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, + 5069u32..=5073u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5077u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5077u32) }, 5079u32..=5084u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, + 5088u32..=5089u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, + 5102u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5102u32) }, 5269u32..=5270u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5289u32..=5290u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5298u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5298u32) }, @@ -335,113 +350,129 @@ impl ExecutionMode { 5620u32..=5623u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5893u32..=5896u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, 5903u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5903u32) }, + 6023u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6023u32) }, + 6028u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6028u32) }, 6154u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6154u32) }, 6160u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6160u32) }, 6417u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6417u32) }, + 6461u32..=6463u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) }, _ => return None, }) } } #[allow(non_upper_case_globals)] impl ExecutionMode { - pub const OutputLinesEXT: Self = Self::OutputLinesNV; - pub const OutputPrimitivesEXT: Self = Self::OutputPrimitivesNV; - pub const OutputTrianglesEXT: Self = Self::OutputTrianglesNV; + pub const OutputLinesNV: Self = Self::OutputLinesEXT; + pub const OutputPrimitivesNV: Self = Self::OutputPrimitivesEXT; + pub const DerivativeGroupQuadsNV: Self = Self::DerivativeGroupQuadsKHR; + pub const DerivativeGroupLinearNV: Self = Self::DerivativeGroupLinearKHR; + pub const OutputTrianglesNV: Self = Self::OutputTrianglesEXT; } impl core::str::FromStr for ExecutionMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Invocations" => Ok(Self::Invocations), - "SpacingEqual" => Ok(Self::SpacingEqual), - "SpacingFractionalEven" => Ok(Self::SpacingFractionalEven), - "SpacingFractionalOdd" => Ok(Self::SpacingFractionalOdd), - "VertexOrderCw" => Ok(Self::VertexOrderCw), - "VertexOrderCcw" => Ok(Self::VertexOrderCcw), - "PixelCenterInteger" => Ok(Self::PixelCenterInteger), - "OriginUpperLeft" => Ok(Self::OriginUpperLeft), - "OriginLowerLeft" => Ok(Self::OriginLowerLeft), - "EarlyFragmentTests" => Ok(Self::EarlyFragmentTests), - "PointMode" => Ok(Self::PointMode), - "Xfb" => Ok(Self::Xfb), - "DepthReplacing" => Ok(Self::DepthReplacing), - "DepthGreater" => Ok(Self::DepthGreater), - "DepthLess" => Ok(Self::DepthLess), - "DepthUnchanged" => Ok(Self::DepthUnchanged), - "LocalSize" => Ok(Self::LocalSize), - "LocalSizeHint" => Ok(Self::LocalSizeHint), - "InputPoints" => Ok(Self::InputPoints), - "InputLines" => Ok(Self::InputLines), - "InputLinesAdjacency" => Ok(Self::InputLinesAdjacency), - "Triangles" => Ok(Self::Triangles), - "InputTrianglesAdjacency" => Ok(Self::InputTrianglesAdjacency), - "Quads" => Ok(Self::Quads), - "Isolines" => Ok(Self::Isolines), - "OutputVertices" => Ok(Self::OutputVertices), - "OutputPoints" => Ok(Self::OutputPoints), - "OutputLineStrip" => Ok(Self::OutputLineStrip), - "OutputTriangleStrip" => Ok(Self::OutputTriangleStrip), - "VecTypeHint" => Ok(Self::VecTypeHint), - "ContractionOff" => Ok(Self::ContractionOff), - "Initializer" => Ok(Self::Initializer), - "Finalizer" => Ok(Self::Finalizer), - "SubgroupSize" => Ok(Self::SubgroupSize), - "SubgroupsPerWorkgroup" => Ok(Self::SubgroupsPerWorkgroup), - "SubgroupsPerWorkgroupId" => Ok(Self::SubgroupsPerWorkgroupId), - "LocalSizeId" => Ok(Self::LocalSizeId), - "LocalSizeHintId" => Ok(Self::LocalSizeHintId), - "NonCoherentColorAttachmentReadEXT" => Ok(Self::NonCoherentColorAttachmentReadEXT), - "NonCoherentDepthAttachmentReadEXT" => Ok(Self::NonCoherentDepthAttachmentReadEXT), - "NonCoherentStencilAttachmentReadEXT" => Ok(Self::NonCoherentStencilAttachmentReadEXT), - "SubgroupUniformControlFlowKHR" => Ok(Self::SubgroupUniformControlFlowKHR), - "PostDepthCoverage" => Ok(Self::PostDepthCoverage), - "DenormPreserve" => Ok(Self::DenormPreserve), - "DenormFlushToZero" => Ok(Self::DenormFlushToZero), - "SignedZeroInfNanPreserve" => Ok(Self::SignedZeroInfNanPreserve), - "RoundingModeRTE" => Ok(Self::RoundingModeRTE), - "RoundingModeRTZ" => Ok(Self::RoundingModeRTZ), - "EarlyAndLateFragmentTestsAMD" => Ok(Self::EarlyAndLateFragmentTestsAMD), - "StencilRefReplacingEXT" => Ok(Self::StencilRefReplacingEXT), - "CoalescingAMDX" => Ok(Self::CoalescingAMDX), - "MaxNodeRecursionAMDX" => Ok(Self::MaxNodeRecursionAMDX), - "StaticNumWorkgroupsAMDX" => Ok(Self::StaticNumWorkgroupsAMDX), - "ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX), - "MaxNumWorkgroupsAMDX" => Ok(Self::MaxNumWorkgroupsAMDX), - "StencilRefUnchangedFrontAMD" => Ok(Self::StencilRefUnchangedFrontAMD), - "StencilRefGreaterFrontAMD" => Ok(Self::StencilRefGreaterFrontAMD), - "StencilRefLessFrontAMD" => Ok(Self::StencilRefLessFrontAMD), - "StencilRefUnchangedBackAMD" => Ok(Self::StencilRefUnchangedBackAMD), - "StencilRefGreaterBackAMD" => Ok(Self::StencilRefGreaterBackAMD), - "StencilRefLessBackAMD" => Ok(Self::StencilRefLessBackAMD), - "OutputLinesNV" => Ok(Self::OutputLinesNV), - "OutputLinesEXT" => Ok(Self::OutputLinesNV), - "OutputPrimitivesNV" => Ok(Self::OutputPrimitivesNV), - "OutputPrimitivesEXT" => Ok(Self::OutputPrimitivesNV), - "DerivativeGroupQuadsNV" => Ok(Self::DerivativeGroupQuadsNV), - "DerivativeGroupLinearNV" => Ok(Self::DerivativeGroupLinearNV), - "OutputTrianglesNV" => Ok(Self::OutputTrianglesNV), - "OutputTrianglesEXT" => Ok(Self::OutputTrianglesNV), - "PixelInterlockOrderedEXT" => Ok(Self::PixelInterlockOrderedEXT), - "PixelInterlockUnorderedEXT" => Ok(Self::PixelInterlockUnorderedEXT), - "SampleInterlockOrderedEXT" => Ok(Self::SampleInterlockOrderedEXT), - "SampleInterlockUnorderedEXT" => Ok(Self::SampleInterlockUnorderedEXT), - "ShadingRateInterlockOrderedEXT" => Ok(Self::ShadingRateInterlockOrderedEXT), - "ShadingRateInterlockUnorderedEXT" => Ok(Self::ShadingRateInterlockUnorderedEXT), - "SharedLocalMemorySizeINTEL" => Ok(Self::SharedLocalMemorySizeINTEL), - "RoundingModeRTPINTEL" => Ok(Self::RoundingModeRTPINTEL), - "RoundingModeRTNINTEL" => Ok(Self::RoundingModeRTNINTEL), - "FloatingPointModeALTINTEL" => Ok(Self::FloatingPointModeALTINTEL), - "FloatingPointModeIEEEINTEL" => Ok(Self::FloatingPointModeIEEEINTEL), - "MaxWorkgroupSizeINTEL" => Ok(Self::MaxWorkgroupSizeINTEL), - "MaxWorkDimINTEL" => Ok(Self::MaxWorkDimINTEL), - "NoGlobalOffsetINTEL" => Ok(Self::NoGlobalOffsetINTEL), - "NumSIMDWorkitemsINTEL" => Ok(Self::NumSIMDWorkitemsINTEL), - "SchedulerTargetFmaxMhzINTEL" => Ok(Self::SchedulerTargetFmaxMhzINTEL), - "StreamingInterfaceINTEL" => Ok(Self::StreamingInterfaceINTEL), - "RegisterMapInterfaceINTEL" => Ok(Self::RegisterMapInterfaceINTEL), - "NamedBarrierCountINTEL" => Ok(Self::NamedBarrierCountINTEL), - _ => Err(()), - } + Ok(match s { + "Invocations" => Self::Invocations, + "SpacingEqual" => Self::SpacingEqual, + "SpacingFractionalEven" => Self::SpacingFractionalEven, + "SpacingFractionalOdd" => Self::SpacingFractionalOdd, + "VertexOrderCw" => Self::VertexOrderCw, + "VertexOrderCcw" => Self::VertexOrderCcw, + "PixelCenterInteger" => Self::PixelCenterInteger, + "OriginUpperLeft" => Self::OriginUpperLeft, + "OriginLowerLeft" => Self::OriginLowerLeft, + "EarlyFragmentTests" => Self::EarlyFragmentTests, + "PointMode" => Self::PointMode, + "Xfb" => Self::Xfb, + "DepthReplacing" => Self::DepthReplacing, + "DepthGreater" => Self::DepthGreater, + "DepthLess" => Self::DepthLess, + "DepthUnchanged" => Self::DepthUnchanged, + "LocalSize" => Self::LocalSize, + "LocalSizeHint" => Self::LocalSizeHint, + "InputPoints" => Self::InputPoints, + "InputLines" => Self::InputLines, + "InputLinesAdjacency" => Self::InputLinesAdjacency, + "Triangles" => Self::Triangles, + "InputTrianglesAdjacency" => Self::InputTrianglesAdjacency, + "Quads" => Self::Quads, + "Isolines" => Self::Isolines, + "OutputVertices" => Self::OutputVertices, + "OutputPoints" => Self::OutputPoints, + "OutputLineStrip" => Self::OutputLineStrip, + "OutputTriangleStrip" => Self::OutputTriangleStrip, + "VecTypeHint" => Self::VecTypeHint, + "ContractionOff" => Self::ContractionOff, + "Initializer" => Self::Initializer, + "Finalizer" => Self::Finalizer, + "SubgroupSize" => Self::SubgroupSize, + "SubgroupsPerWorkgroup" => Self::SubgroupsPerWorkgroup, + "SubgroupsPerWorkgroupId" => Self::SubgroupsPerWorkgroupId, + "LocalSizeId" => Self::LocalSizeId, + "LocalSizeHintId" => Self::LocalSizeHintId, + "NonCoherentColorAttachmentReadEXT" => Self::NonCoherentColorAttachmentReadEXT, + "NonCoherentDepthAttachmentReadEXT" => Self::NonCoherentDepthAttachmentReadEXT, + "NonCoherentStencilAttachmentReadEXT" => Self::NonCoherentStencilAttachmentReadEXT, + "SubgroupUniformControlFlowKHR" => Self::SubgroupUniformControlFlowKHR, + "PostDepthCoverage" => Self::PostDepthCoverage, + "DenormPreserve" => Self::DenormPreserve, + "DenormFlushToZero" => Self::DenormFlushToZero, + "SignedZeroInfNanPreserve" => Self::SignedZeroInfNanPreserve, + "RoundingModeRTE" => Self::RoundingModeRTE, + "RoundingModeRTZ" => Self::RoundingModeRTZ, + "EarlyAndLateFragmentTestsAMD" => Self::EarlyAndLateFragmentTestsAMD, + "StencilRefReplacingEXT" => Self::StencilRefReplacingEXT, + "CoalescingAMDX" => Self::CoalescingAMDX, + "IsApiEntryAMDX" => Self::IsApiEntryAMDX, + "MaxNodeRecursionAMDX" => Self::MaxNodeRecursionAMDX, + "StaticNumWorkgroupsAMDX" => Self::StaticNumWorkgroupsAMDX, + "ShaderIndexAMDX" => Self::ShaderIndexAMDX, + "MaxNumWorkgroupsAMDX" => Self::MaxNumWorkgroupsAMDX, + "StencilRefUnchangedFrontAMD" => Self::StencilRefUnchangedFrontAMD, + "StencilRefGreaterFrontAMD" => Self::StencilRefGreaterFrontAMD, + "StencilRefLessFrontAMD" => Self::StencilRefLessFrontAMD, + "StencilRefUnchangedBackAMD" => Self::StencilRefUnchangedBackAMD, + "StencilRefGreaterBackAMD" => Self::StencilRefGreaterBackAMD, + "StencilRefLessBackAMD" => Self::StencilRefLessBackAMD, + "QuadDerivativesKHR" => Self::QuadDerivativesKHR, + "RequireFullQuadsKHR" => Self::RequireFullQuadsKHR, + "SharesInputWithAMDX" => Self::SharesInputWithAMDX, + "OutputLinesEXT" => Self::OutputLinesEXT, + "OutputLinesNV" => Self::OutputLinesEXT, + "OutputPrimitivesEXT" => Self::OutputPrimitivesEXT, + "OutputPrimitivesNV" => Self::OutputPrimitivesEXT, + "DerivativeGroupQuadsKHR" => Self::DerivativeGroupQuadsKHR, + "DerivativeGroupQuadsNV" => Self::DerivativeGroupQuadsKHR, + "DerivativeGroupLinearKHR" => Self::DerivativeGroupLinearKHR, + "DerivativeGroupLinearNV" => Self::DerivativeGroupLinearKHR, + "OutputTrianglesEXT" => Self::OutputTrianglesEXT, + "OutputTrianglesNV" => Self::OutputTrianglesEXT, + "PixelInterlockOrderedEXT" => Self::PixelInterlockOrderedEXT, + "PixelInterlockUnorderedEXT" => Self::PixelInterlockUnorderedEXT, + "SampleInterlockOrderedEXT" => Self::SampleInterlockOrderedEXT, + "SampleInterlockUnorderedEXT" => Self::SampleInterlockUnorderedEXT, + "ShadingRateInterlockOrderedEXT" => Self::ShadingRateInterlockOrderedEXT, + "ShadingRateInterlockUnorderedEXT" => Self::ShadingRateInterlockUnorderedEXT, + "SharedLocalMemorySizeINTEL" => Self::SharedLocalMemorySizeINTEL, + "RoundingModeRTPINTEL" => Self::RoundingModeRTPINTEL, + "RoundingModeRTNINTEL" => Self::RoundingModeRTNINTEL, + "FloatingPointModeALTINTEL" => Self::FloatingPointModeALTINTEL, + "FloatingPointModeIEEEINTEL" => Self::FloatingPointModeIEEEINTEL, + "MaxWorkgroupSizeINTEL" => Self::MaxWorkgroupSizeINTEL, + "MaxWorkDimINTEL" => Self::MaxWorkDimINTEL, + "NoGlobalOffsetINTEL" => Self::NoGlobalOffsetINTEL, + "NumSIMDWorkitemsINTEL" => Self::NumSIMDWorkitemsINTEL, + "SchedulerTargetFmaxMhzINTEL" => Self::SchedulerTargetFmaxMhzINTEL, + "MaximallyReconvergesKHR" => Self::MaximallyReconvergesKHR, + "FPFastMathDefault" => Self::FPFastMathDefault, + "StreamingInterfaceINTEL" => Self::StreamingInterfaceINTEL, + "RegisterMapInterfaceINTEL" => Self::RegisterMapInterfaceINTEL, + "NamedBarrierCountINTEL" => Self::NamedBarrierCountINTEL, + "MaximumRegistersINTEL" => Self::MaximumRegistersINTEL, + "MaximumRegistersIdINTEL" => Self::MaximumRegistersIdINTEL, + "NamedMaximumRegistersINTEL" => Self::NamedMaximumRegistersINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [StorageClass](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_storage_class_a_storage_class)"] @@ -466,13 +497,12 @@ pub enum StorageClass { StorageBuffer = 12u32, TileImageEXT = 4172u32, NodePayloadAMDX = 5068u32, - NodeOutputPayloadAMDX = 5076u32, - CallableDataNV = 5328u32, - IncomingCallableDataNV = 5329u32, - RayPayloadNV = 5338u32, - HitAttributeNV = 5339u32, - IncomingRayPayloadNV = 5342u32, - ShaderRecordBufferNV = 5343u32, + CallableDataKHR = 5328u32, + IncomingCallableDataKHR = 5329u32, + RayPayloadKHR = 5338u32, + HitAttributeKHR = 5339u32, + IncomingRayPayloadKHR = 5342u32, + ShaderRecordBufferKHR = 5343u32, PhysicalStorageBuffer = 5349u32, HitObjectAttributeNV = 5385u32, TaskPayloadWorkgroupEXT = 5402u32, @@ -486,7 +516,6 @@ impl StorageClass { 0u32..=12u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) }, 4172u32 => unsafe { core::mem::transmute::<u32, StorageClass>(4172u32) }, 5068u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5068u32) }, - 5076u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5076u32) }, 5328u32..=5329u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) }, 5338u32..=5339u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) }, 5342u32..=5343u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) }, @@ -501,55 +530,54 @@ impl StorageClass { } #[allow(non_upper_case_globals)] impl StorageClass { - pub const CallableDataKHR: Self = Self::CallableDataNV; - pub const IncomingCallableDataKHR: Self = Self::IncomingCallableDataNV; - pub const RayPayloadKHR: Self = Self::RayPayloadNV; - pub const HitAttributeKHR: Self = Self::HitAttributeNV; - pub const IncomingRayPayloadKHR: Self = Self::IncomingRayPayloadNV; - pub const ShaderRecordBufferKHR: Self = Self::ShaderRecordBufferNV; + pub const CallableDataNV: Self = Self::CallableDataKHR; + pub const IncomingCallableDataNV: Self = Self::IncomingCallableDataKHR; + pub const RayPayloadNV: Self = Self::RayPayloadKHR; + pub const HitAttributeNV: Self = Self::HitAttributeKHR; + pub const IncomingRayPayloadNV: Self = Self::IncomingRayPayloadKHR; + pub const ShaderRecordBufferNV: Self = Self::ShaderRecordBufferKHR; pub const PhysicalStorageBufferEXT: Self = Self::PhysicalStorageBuffer; } impl core::str::FromStr for StorageClass { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "UniformConstant" => Ok(Self::UniformConstant), - "Input" => Ok(Self::Input), - "Uniform" => Ok(Self::Uniform), - "Output" => Ok(Self::Output), - "Workgroup" => Ok(Self::Workgroup), - "CrossWorkgroup" => Ok(Self::CrossWorkgroup), - "Private" => Ok(Self::Private), - "Function" => Ok(Self::Function), - "Generic" => Ok(Self::Generic), - "PushConstant" => Ok(Self::PushConstant), - "AtomicCounter" => Ok(Self::AtomicCounter), - "Image" => Ok(Self::Image), - "StorageBuffer" => Ok(Self::StorageBuffer), - "TileImageEXT" => Ok(Self::TileImageEXT), - "NodePayloadAMDX" => Ok(Self::NodePayloadAMDX), - "NodeOutputPayloadAMDX" => Ok(Self::NodeOutputPayloadAMDX), - "CallableDataNV" => Ok(Self::CallableDataNV), - "CallableDataKHR" => Ok(Self::CallableDataNV), - "IncomingCallableDataNV" => Ok(Self::IncomingCallableDataNV), - "IncomingCallableDataKHR" => Ok(Self::IncomingCallableDataNV), - "RayPayloadNV" => Ok(Self::RayPayloadNV), - "RayPayloadKHR" => Ok(Self::RayPayloadNV), - "HitAttributeNV" => Ok(Self::HitAttributeNV), - "HitAttributeKHR" => Ok(Self::HitAttributeNV), - "IncomingRayPayloadNV" => Ok(Self::IncomingRayPayloadNV), - "IncomingRayPayloadKHR" => Ok(Self::IncomingRayPayloadNV), - "ShaderRecordBufferNV" => Ok(Self::ShaderRecordBufferNV), - "ShaderRecordBufferKHR" => Ok(Self::ShaderRecordBufferNV), - "PhysicalStorageBuffer" => Ok(Self::PhysicalStorageBuffer), - "PhysicalStorageBufferEXT" => Ok(Self::PhysicalStorageBuffer), - "HitObjectAttributeNV" => Ok(Self::HitObjectAttributeNV), - "TaskPayloadWorkgroupEXT" => Ok(Self::TaskPayloadWorkgroupEXT), - "CodeSectionINTEL" => Ok(Self::CodeSectionINTEL), - "DeviceOnlyINTEL" => Ok(Self::DeviceOnlyINTEL), - "HostOnlyINTEL" => Ok(Self::HostOnlyINTEL), - _ => Err(()), - } + Ok(match s { + "UniformConstant" => Self::UniformConstant, + "Input" => Self::Input, + "Uniform" => Self::Uniform, + "Output" => Self::Output, + "Workgroup" => Self::Workgroup, + "CrossWorkgroup" => Self::CrossWorkgroup, + "Private" => Self::Private, + "Function" => Self::Function, + "Generic" => Self::Generic, + "PushConstant" => Self::PushConstant, + "AtomicCounter" => Self::AtomicCounter, + "Image" => Self::Image, + "StorageBuffer" => Self::StorageBuffer, + "TileImageEXT" => Self::TileImageEXT, + "NodePayloadAMDX" => Self::NodePayloadAMDX, + "CallableDataKHR" => Self::CallableDataKHR, + "CallableDataNV" => Self::CallableDataKHR, + "IncomingCallableDataKHR" => Self::IncomingCallableDataKHR, + "IncomingCallableDataNV" => Self::IncomingCallableDataKHR, + "RayPayloadKHR" => Self::RayPayloadKHR, + "RayPayloadNV" => Self::RayPayloadKHR, + "HitAttributeKHR" => Self::HitAttributeKHR, + "HitAttributeNV" => Self::HitAttributeKHR, + "IncomingRayPayloadKHR" => Self::IncomingRayPayloadKHR, + "IncomingRayPayloadNV" => Self::IncomingRayPayloadKHR, + "ShaderRecordBufferKHR" => Self::ShaderRecordBufferKHR, + "ShaderRecordBufferNV" => Self::ShaderRecordBufferKHR, + "PhysicalStorageBuffer" => Self::PhysicalStorageBuffer, + "PhysicalStorageBufferEXT" => Self::PhysicalStorageBuffer, + "HitObjectAttributeNV" => Self::HitObjectAttributeNV, + "TaskPayloadWorkgroupEXT" => Self::TaskPayloadWorkgroupEXT, + "CodeSectionINTEL" => Self::CodeSectionINTEL, + "DeviceOnlyINTEL" => Self::DeviceOnlyINTEL, + "HostOnlyINTEL" => Self::HostOnlyINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [Dim](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_dim_a_dim)"] @@ -582,17 +610,17 @@ impl Dim {} impl core::str::FromStr for Dim { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Dim1D" => Ok(Self::Dim1D), - "Dim2D" => Ok(Self::Dim2D), - "Dim3D" => Ok(Self::Dim3D), - "DimCube" => Ok(Self::DimCube), - "DimRect" => Ok(Self::DimRect), - "DimBuffer" => Ok(Self::DimBuffer), - "DimSubpassData" => Ok(Self::DimSubpassData), - "DimTileImageDataEXT" => Ok(Self::DimTileImageDataEXT), - _ => Err(()), - } + Ok(match s { + "Dim1D" => Self::Dim1D, + "Dim2D" => Self::Dim2D, + "Dim3D" => Self::Dim3D, + "DimCube" => Self::DimCube, + "DimRect" => Self::DimRect, + "DimBuffer" => Self::DimBuffer, + "DimSubpassData" => Self::DimSubpassData, + "DimTileImageDataEXT" => Self::DimTileImageDataEXT, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [SamplerAddressingMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_sampler_addressing_mode_a_sampler_addressing_mode)"] @@ -621,14 +649,14 @@ impl SamplerAddressingMode {} impl core::str::FromStr for SamplerAddressingMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "None" => Ok(Self::None), - "ClampToEdge" => Ok(Self::ClampToEdge), - "Clamp" => Ok(Self::Clamp), - "Repeat" => Ok(Self::Repeat), - "RepeatMirrored" => Ok(Self::RepeatMirrored), - _ => Err(()), - } + Ok(match s { + "None" => Self::None, + "ClampToEdge" => Self::ClampToEdge, + "Clamp" => Self::Clamp, + "Repeat" => Self::Repeat, + "RepeatMirrored" => Self::RepeatMirrored, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [SamplerFilterMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_sampler_filter_mode_a_sampler_filter_mode)"] @@ -654,11 +682,11 @@ impl SamplerFilterMode {} impl core::str::FromStr for SamplerFilterMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Nearest" => Ok(Self::Nearest), - "Linear" => Ok(Self::Linear), - _ => Err(()), - } + Ok(match s { + "Nearest" => Self::Nearest, + "Linear" => Self::Linear, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [ImageFormat](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_format_a_image_format)"] @@ -724,51 +752,51 @@ impl ImageFormat {} impl core::str::FromStr for ImageFormat { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Unknown" => Ok(Self::Unknown), - "Rgba32f" => Ok(Self::Rgba32f), - "Rgba16f" => Ok(Self::Rgba16f), - "R32f" => Ok(Self::R32f), - "Rgba8" => Ok(Self::Rgba8), - "Rgba8Snorm" => Ok(Self::Rgba8Snorm), - "Rg32f" => Ok(Self::Rg32f), - "Rg16f" => Ok(Self::Rg16f), - "R11fG11fB10f" => Ok(Self::R11fG11fB10f), - "R16f" => Ok(Self::R16f), - "Rgba16" => Ok(Self::Rgba16), - "Rgb10A2" => Ok(Self::Rgb10A2), - "Rg16" => Ok(Self::Rg16), - "Rg8" => Ok(Self::Rg8), - "R16" => Ok(Self::R16), - "R8" => Ok(Self::R8), - "Rgba16Snorm" => Ok(Self::Rgba16Snorm), - "Rg16Snorm" => Ok(Self::Rg16Snorm), - "Rg8Snorm" => Ok(Self::Rg8Snorm), - "R16Snorm" => Ok(Self::R16Snorm), - "R8Snorm" => Ok(Self::R8Snorm), - "Rgba32i" => Ok(Self::Rgba32i), - "Rgba16i" => Ok(Self::Rgba16i), - "Rgba8i" => Ok(Self::Rgba8i), - "R32i" => Ok(Self::R32i), - "Rg32i" => Ok(Self::Rg32i), - "Rg16i" => Ok(Self::Rg16i), - "Rg8i" => Ok(Self::Rg8i), - "R16i" => Ok(Self::R16i), - "R8i" => Ok(Self::R8i), - "Rgba32ui" => Ok(Self::Rgba32ui), - "Rgba16ui" => Ok(Self::Rgba16ui), - "Rgba8ui" => Ok(Self::Rgba8ui), - "R32ui" => Ok(Self::R32ui), - "Rgb10a2ui" => Ok(Self::Rgb10a2ui), - "Rg32ui" => Ok(Self::Rg32ui), - "Rg16ui" => Ok(Self::Rg16ui), - "Rg8ui" => Ok(Self::Rg8ui), - "R16ui" => Ok(Self::R16ui), - "R8ui" => Ok(Self::R8ui), - "R64ui" => Ok(Self::R64ui), - "R64i" => Ok(Self::R64i), - _ => Err(()), - } + Ok(match s { + "Unknown" => Self::Unknown, + "Rgba32f" => Self::Rgba32f, + "Rgba16f" => Self::Rgba16f, + "R32f" => Self::R32f, + "Rgba8" => Self::Rgba8, + "Rgba8Snorm" => Self::Rgba8Snorm, + "Rg32f" => Self::Rg32f, + "Rg16f" => Self::Rg16f, + "R11fG11fB10f" => Self::R11fG11fB10f, + "R16f" => Self::R16f, + "Rgba16" => Self::Rgba16, + "Rgb10A2" => Self::Rgb10A2, + "Rg16" => Self::Rg16, + "Rg8" => Self::Rg8, + "R16" => Self::R16, + "R8" => Self::R8, + "Rgba16Snorm" => Self::Rgba16Snorm, + "Rg16Snorm" => Self::Rg16Snorm, + "Rg8Snorm" => Self::Rg8Snorm, + "R16Snorm" => Self::R16Snorm, + "R8Snorm" => Self::R8Snorm, + "Rgba32i" => Self::Rgba32i, + "Rgba16i" => Self::Rgba16i, + "Rgba8i" => Self::Rgba8i, + "R32i" => Self::R32i, + "Rg32i" => Self::Rg32i, + "Rg16i" => Self::Rg16i, + "Rg8i" => Self::Rg8i, + "R16i" => Self::R16i, + "R8i" => Self::R8i, + "Rgba32ui" => Self::Rgba32ui, + "Rgba16ui" => Self::Rgba16ui, + "Rgba8ui" => Self::Rgba8ui, + "R32ui" => Self::R32ui, + "Rgb10a2ui" => Self::Rgb10a2ui, + "Rg32ui" => Self::Rg32ui, + "Rg16ui" => Self::Rg16ui, + "Rg8ui" => Self::Rg8ui, + "R16ui" => Self::R16ui, + "R8ui" => Self::R8ui, + "R64ui" => Self::R64ui, + "R64i" => Self::R64i, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [ImageChannelOrder](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_channel_order_a_image_channel_order)"] @@ -812,29 +840,29 @@ impl ImageChannelOrder {} impl core::str::FromStr for ImageChannelOrder { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "R" => Ok(Self::R), - "A" => Ok(Self::A), - "RG" => Ok(Self::RG), - "RA" => Ok(Self::RA), - "RGB" => Ok(Self::RGB), - "RGBA" => Ok(Self::RGBA), - "BGRA" => Ok(Self::BGRA), - "ARGB" => Ok(Self::ARGB), - "Intensity" => Ok(Self::Intensity), - "Luminance" => Ok(Self::Luminance), - "Rx" => Ok(Self::Rx), - "RGx" => Ok(Self::RGx), - "RGBx" => Ok(Self::RGBx), - "Depth" => Ok(Self::Depth), - "DepthStencil" => Ok(Self::DepthStencil), - "sRGB" => Ok(Self::sRGB), - "sRGBx" => Ok(Self::sRGBx), - "sRGBA" => Ok(Self::sRGBA), - "sBGRA" => Ok(Self::sBGRA), - "ABGR" => Ok(Self::ABGR), - _ => Err(()), - } + Ok(match s { + "R" => Self::R, + "A" => Self::A, + "RG" => Self::RG, + "RA" => Self::RA, + "RGB" => Self::RGB, + "RGBA" => Self::RGBA, + "BGRA" => Self::BGRA, + "ARGB" => Self::ARGB, + "Intensity" => Self::Intensity, + "Luminance" => Self::Luminance, + "Rx" => Self::Rx, + "RGx" => Self::RGx, + "RGBx" => Self::RGBx, + "Depth" => Self::Depth, + "DepthStencil" => Self::DepthStencil, + "sRGB" => Self::sRGB, + "sRGBx" => Self::sRGBx, + "sRGBA" => Self::sRGBA, + "sBGRA" => Self::sBGRA, + "ABGR" => Self::ABGR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [ImageChannelDataType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_channel_data_type_a_image_channel_data_type)"] @@ -863,12 +891,13 @@ pub enum ImageChannelDataType { UnormInt101010_2 = 16u32, UnsignedIntRaw10EXT = 19u32, UnsignedIntRaw12EXT = 20u32, + UnormInt2_101010EXT = 21u32, } impl ImageChannelDataType { pub fn from_u32(n: u32) -> Option<Self> { Some(match n { 0u32..=16u32 => unsafe { core::mem::transmute::<u32, ImageChannelDataType>(n) }, - 19u32..=20u32 => unsafe { core::mem::transmute::<u32, ImageChannelDataType>(n) }, + 19u32..=21u32 => unsafe { core::mem::transmute::<u32, ImageChannelDataType>(n) }, _ => return None, }) } @@ -878,28 +907,29 @@ impl ImageChannelDataType {} impl core::str::FromStr for ImageChannelDataType { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "SnormInt8" => Ok(Self::SnormInt8), - "SnormInt16" => Ok(Self::SnormInt16), - "UnormInt8" => Ok(Self::UnormInt8), - "UnormInt16" => Ok(Self::UnormInt16), - "UnormShort565" => Ok(Self::UnormShort565), - "UnormShort555" => Ok(Self::UnormShort555), - "UnormInt101010" => Ok(Self::UnormInt101010), - "SignedInt8" => Ok(Self::SignedInt8), - "SignedInt16" => Ok(Self::SignedInt16), - "SignedInt32" => Ok(Self::SignedInt32), - "UnsignedInt8" => Ok(Self::UnsignedInt8), - "UnsignedInt16" => Ok(Self::UnsignedInt16), - "UnsignedInt32" => Ok(Self::UnsignedInt32), - "HalfFloat" => Ok(Self::HalfFloat), - "Float" => Ok(Self::Float), - "UnormInt24" => Ok(Self::UnormInt24), - "UnormInt101010_2" => Ok(Self::UnormInt101010_2), - "UnsignedIntRaw10EXT" => Ok(Self::UnsignedIntRaw10EXT), - "UnsignedIntRaw12EXT" => Ok(Self::UnsignedIntRaw12EXT), - _ => Err(()), - } + Ok(match s { + "SnormInt8" => Self::SnormInt8, + "SnormInt16" => Self::SnormInt16, + "UnormInt8" => Self::UnormInt8, + "UnormInt16" => Self::UnormInt16, + "UnormShort565" => Self::UnormShort565, + "UnormShort555" => Self::UnormShort555, + "UnormInt101010" => Self::UnormInt101010, + "SignedInt8" => Self::SignedInt8, + "SignedInt16" => Self::SignedInt16, + "SignedInt32" => Self::SignedInt32, + "UnsignedInt8" => Self::UnsignedInt8, + "UnsignedInt16" => Self::UnsignedInt16, + "UnsignedInt32" => Self::UnsignedInt32, + "HalfFloat" => Self::HalfFloat, + "Float" => Self::Float, + "UnormInt24" => Self::UnormInt24, + "UnormInt101010_2" => Self::UnormInt101010_2, + "UnsignedIntRaw10EXT" => Self::UnsignedIntRaw10EXT, + "UnsignedIntRaw12EXT" => Self::UnsignedIntRaw12EXT, + "UnormInt2_101010EXT" => Self::UnormInt2_101010EXT, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [FPRoundingMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_rounding_mode_a_fp_rounding_mode)"] @@ -927,13 +957,13 @@ impl FPRoundingMode {} impl core::str::FromStr for FPRoundingMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "RTE" => Ok(Self::RTE), - "RTZ" => Ok(Self::RTZ), - "RTP" => Ok(Self::RTP), - "RTN" => Ok(Self::RTN), - _ => Err(()), - } + Ok(match s { + "RTE" => Self::RTE, + "RTZ" => Self::RTZ, + "RTP" => Self::RTP, + "RTN" => Self::RTN, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [FPDenormMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_denorm_mode_a_fp_denorm_mode)"] @@ -959,11 +989,11 @@ impl FPDenormMode {} impl core::str::FromStr for FPDenormMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Preserve" => Ok(Self::Preserve), - "FlushToZero" => Ok(Self::FlushToZero), - _ => Err(()), - } + Ok(match s { + "Preserve" => Self::Preserve, + "FlushToZero" => Self::FlushToZero, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [QuantizationModes](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_quantization_modes_a_quantization_modes)"] @@ -995,17 +1025,17 @@ impl QuantizationModes {} impl core::str::FromStr for QuantizationModes { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "TRN" => Ok(Self::TRN), - "TRN_ZERO" => Ok(Self::TRN_ZERO), - "RND" => Ok(Self::RND), - "RND_ZERO" => Ok(Self::RND_ZERO), - "RND_INF" => Ok(Self::RND_INF), - "RND_MIN_INF" => Ok(Self::RND_MIN_INF), - "RND_CONV" => Ok(Self::RND_CONV), - "RND_CONV_ODD" => Ok(Self::RND_CONV_ODD), - _ => Err(()), - } + Ok(match s { + "TRN" => Self::TRN, + "TRN_ZERO" => Self::TRN_ZERO, + "RND" => Self::RND, + "RND_ZERO" => Self::RND_ZERO, + "RND_INF" => Self::RND_INF, + "RND_MIN_INF" => Self::RND_MIN_INF, + "RND_CONV" => Self::RND_CONV, + "RND_CONV_ODD" => Self::RND_CONV_ODD, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [FPOperationMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_operation_mode_a_fp_operation_mode)"] @@ -1031,11 +1061,11 @@ impl FPOperationMode {} impl core::str::FromStr for FPOperationMode { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "IEEE" => Ok(Self::IEEE), - "ALT" => Ok(Self::ALT), - _ => Err(()), - } + Ok(match s { + "IEEE" => Self::IEEE, + "ALT" => Self::ALT, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [OverflowModes](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_overflow_modes_a_overflow_modes)"] @@ -1063,13 +1093,13 @@ impl OverflowModes {} impl core::str::FromStr for OverflowModes { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "WRAP" => Ok(Self::WRAP), - "SAT" => Ok(Self::SAT), - "SAT_ZERO" => Ok(Self::SAT_ZERO), - "SAT_SYM" => Ok(Self::SAT_SYM), - _ => Err(()), - } + Ok(match s { + "WRAP" => Self::WRAP, + "SAT" => Self::SAT, + "SAT_ZERO" => Self::SAT_ZERO, + "SAT_SYM" => Self::SAT_SYM, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [LinkageType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_linkage_type_a_linkage_type)"] @@ -1096,12 +1126,12 @@ impl LinkageType {} impl core::str::FromStr for LinkageType { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Export" => Ok(Self::Export), - "Import" => Ok(Self::Import), - "LinkOnceODR" => Ok(Self::LinkOnceODR), - _ => Err(()), - } + Ok(match s { + "Export" => Self::Export, + "Import" => Self::Import, + "LinkOnceODR" => Self::LinkOnceODR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [AccessQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_access_qualifier_a_access_qualifier)"] @@ -1128,12 +1158,12 @@ impl AccessQualifier {} impl core::str::FromStr for AccessQualifier { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "ReadOnly" => Ok(Self::ReadOnly), - "WriteOnly" => Ok(Self::WriteOnly), - "ReadWrite" => Ok(Self::ReadWrite), - _ => Err(()), - } + Ok(match s { + "ReadOnly" => Self::ReadOnly, + "WriteOnly" => Self::WriteOnly, + "ReadWrite" => Self::ReadWrite, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [HostAccessQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_host_access_qualifier_a_host_access_qualifier)"] @@ -1161,13 +1191,13 @@ impl HostAccessQualifier {} impl core::str::FromStr for HostAccessQualifier { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "NoneINTEL" => Ok(Self::NoneINTEL), - "ReadINTEL" => Ok(Self::ReadINTEL), - "WriteINTEL" => Ok(Self::WriteINTEL), - "ReadWriteINTEL" => Ok(Self::ReadWriteINTEL), - _ => Err(()), - } + Ok(match s { + "NoneINTEL" => Self::NoneINTEL, + "ReadINTEL" => Self::ReadINTEL, + "WriteINTEL" => Self::WriteINTEL, + "ReadWriteINTEL" => Self::ReadWriteINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [FunctionParameterAttribute](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_function_parameter_attribute_a_function_parameter_attribute)"] @@ -1201,18 +1231,18 @@ impl FunctionParameterAttribute {} impl core::str::FromStr for FunctionParameterAttribute { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Zext" => Ok(Self::Zext), - "Sext" => Ok(Self::Sext), - "ByVal" => Ok(Self::ByVal), - "Sret" => Ok(Self::Sret), - "NoAlias" => Ok(Self::NoAlias), - "NoCapture" => Ok(Self::NoCapture), - "NoWrite" => Ok(Self::NoWrite), - "NoReadWrite" => Ok(Self::NoReadWrite), - "RuntimeAlignedINTEL" => Ok(Self::RuntimeAlignedINTEL), - _ => Err(()), - } + Ok(match s { + "Zext" => Self::Zext, + "Sext" => Self::Sext, + "ByVal" => Self::ByVal, + "Sret" => Self::Sret, + "NoAlias" => Self::NoAlias, + "NoCapture" => Self::NoCapture, + "NoWrite" => Self::NoWrite, + "NoReadWrite" => Self::NoReadWrite, + "RuntimeAlignedINTEL" => Self::RuntimeAlignedINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [Decoration](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_decoration_a_decoration)"] @@ -1273,16 +1303,21 @@ pub enum Decoration { NoUnsignedWrap = 4470u32, WeightTextureQCOM = 4487u32, BlockMatchTextureQCOM = 4488u32, + BlockMatchSamplerQCOM = 4499u32, ExplicitInterpAMD = 4999u32, NodeSharesPayloadLimitsWithAMDX = 5019u32, NodeMaxPayloadsAMDX = 5020u32, TrackFinishWritingAMDX = 5078u32, PayloadNodeNameAMDX = 5091u32, + PayloadNodeBaseIndexAMDX = 5098u32, + PayloadNodeSparseArrayAMDX = 5099u32, + PayloadNodeArraySizeAMDX = 5100u32, + PayloadDispatchIndirectAMDX = 5105u32, OverrideCoverageNV = 5248u32, PassthroughNV = 5250u32, ViewportRelativeNV = 5252u32, SecondaryViewportRelativeNV = 5256u32, - PerPrimitiveNV = 5271u32, + PerPrimitiveEXT = 5271u32, PerViewNV = 5272u32, PerTaskNV = 5273u32, PerVertexKHR = 5285u32, @@ -1320,6 +1355,9 @@ pub enum Decoration { MergeINTEL = 5834u32, BankBitsINTEL = 5835u32, ForcePow2DepthINTEL = 5836u32, + StridesizeINTEL = 5883u32, + WordsizeINTEL = 5884u32, + TrueDualPortINTEL = 5885u32, BurstCoalesceINTEL = 5899u32, CacheSizeINTEL = 5900u32, DontStaticallyCoalesceINTEL = 5901u32, @@ -1338,9 +1376,7 @@ pub enum Decoration { SingleElementVectorINTEL = 6085u32, VectorComputeCallableFunctionINTEL = 6087u32, MediaBlockIOINTEL = 6140u32, - InitModeINTEL = 6147u32, - ImplementInRegisterMapINTEL = 6148u32, - HostAccessINTEL = 6168u32, + StallFreeINTEL = 6151u32, FPMaxErrorDecorationINTEL = 6170u32, LatencyControlLabelINTEL = 6172u32, LatencyControlConstraintINTEL = 6173u32, @@ -1353,6 +1389,9 @@ pub enum Decoration { MMHostInterfaceMaxBurstINTEL = 6181u32, MMHostInterfaceWaitRequestINTEL = 6182u32, StableKernelArgumentINTEL = 6183u32, + HostAccessINTEL = 6188u32, + InitModeINTEL = 6190u32, + ImplementInRegisterMapINTEL = 6191u32, CacheControlLoadINTEL = 6442u32, CacheControlStoreINTEL = 6443u32, } @@ -1363,10 +1402,13 @@ impl Decoration { 13u32..=47u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 4469u32..=4470u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 4487u32..=4488u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, + 4499u32 => unsafe { core::mem::transmute::<u32, Decoration>(4499u32) }, 4999u32 => unsafe { core::mem::transmute::<u32, Decoration>(4999u32) }, 5019u32..=5020u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 5078u32 => unsafe { core::mem::transmute::<u32, Decoration>(5078u32) }, 5091u32 => unsafe { core::mem::transmute::<u32, Decoration>(5091u32) }, + 5098u32..=5100u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, + 5105u32 => unsafe { core::mem::transmute::<u32, Decoration>(5105u32) }, 5248u32 => unsafe { core::mem::transmute::<u32, Decoration>(5248u32) }, 5250u32 => unsafe { core::mem::transmute::<u32, Decoration>(5250u32) }, 5252u32 => unsafe { core::mem::transmute::<u32, Decoration>(5252u32) }, @@ -1384,6 +1426,7 @@ impl Decoration { 5634u32..=5636u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 5822u32..=5823u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 5825u32..=5836u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, + 5883u32..=5885u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 5899u32..=5902u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 5905u32 => unsafe { core::mem::transmute::<u32, Decoration>(5905u32) }, 5907u32 => unsafe { core::mem::transmute::<u32, Decoration>(5907u32) }, @@ -1396,11 +1439,12 @@ impl Decoration { 6085u32 => unsafe { core::mem::transmute::<u32, Decoration>(6085u32) }, 6087u32 => unsafe { core::mem::transmute::<u32, Decoration>(6087u32) }, 6140u32 => unsafe { core::mem::transmute::<u32, Decoration>(6140u32) }, - 6147u32..=6148u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, - 6168u32 => unsafe { core::mem::transmute::<u32, Decoration>(6168u32) }, + 6151u32 => unsafe { core::mem::transmute::<u32, Decoration>(6151u32) }, 6170u32 => unsafe { core::mem::transmute::<u32, Decoration>(6170u32) }, 6172u32..=6173u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 6175u32..=6183u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, + 6188u32 => unsafe { core::mem::transmute::<u32, Decoration>(6188u32) }, + 6190u32..=6191u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, 6442u32..=6443u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) }, _ => return None, }) @@ -1408,7 +1452,7 @@ impl Decoration { } #[allow(non_upper_case_globals)] impl Decoration { - pub const PerPrimitiveEXT: Self = Self::PerPrimitiveNV; + pub const PerPrimitiveNV: Self = Self::PerPrimitiveEXT; pub const PerVertexNV: Self = Self::PerVertexKHR; pub const NonUniformEXT: Self = Self::NonUniform; pub const RestrictPointerEXT: Self = Self::RestrictPointer; @@ -1419,149 +1463,158 @@ impl Decoration { impl core::str::FromStr for Decoration { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "RelaxedPrecision" => Ok(Self::RelaxedPrecision), - "SpecId" => Ok(Self::SpecId), - "Block" => Ok(Self::Block), - "BufferBlock" => Ok(Self::BufferBlock), - "RowMajor" => Ok(Self::RowMajor), - "ColMajor" => Ok(Self::ColMajor), - "ArrayStride" => Ok(Self::ArrayStride), - "MatrixStride" => Ok(Self::MatrixStride), - "GLSLShared" => Ok(Self::GLSLShared), - "GLSLPacked" => Ok(Self::GLSLPacked), - "CPacked" => Ok(Self::CPacked), - "BuiltIn" => Ok(Self::BuiltIn), - "NoPerspective" => Ok(Self::NoPerspective), - "Flat" => Ok(Self::Flat), - "Patch" => Ok(Self::Patch), - "Centroid" => Ok(Self::Centroid), - "Sample" => Ok(Self::Sample), - "Invariant" => Ok(Self::Invariant), - "Restrict" => Ok(Self::Restrict), - "Aliased" => Ok(Self::Aliased), - "Volatile" => Ok(Self::Volatile), - "Constant" => Ok(Self::Constant), - "Coherent" => Ok(Self::Coherent), - "NonWritable" => Ok(Self::NonWritable), - "NonReadable" => Ok(Self::NonReadable), - "Uniform" => Ok(Self::Uniform), - "UniformId" => Ok(Self::UniformId), - "SaturatedConversion" => Ok(Self::SaturatedConversion), - "Stream" => Ok(Self::Stream), - "Location" => Ok(Self::Location), - "Component" => Ok(Self::Component), - "Index" => Ok(Self::Index), - "Binding" => Ok(Self::Binding), - "DescriptorSet" => Ok(Self::DescriptorSet), - "Offset" => Ok(Self::Offset), - "XfbBuffer" => Ok(Self::XfbBuffer), - "XfbStride" => Ok(Self::XfbStride), - "FuncParamAttr" => Ok(Self::FuncParamAttr), - "FPRoundingMode" => Ok(Self::FPRoundingMode), - "FPFastMathMode" => Ok(Self::FPFastMathMode), - "LinkageAttributes" => Ok(Self::LinkageAttributes), - "NoContraction" => Ok(Self::NoContraction), - "InputAttachmentIndex" => Ok(Self::InputAttachmentIndex), - "Alignment" => Ok(Self::Alignment), - "MaxByteOffset" => Ok(Self::MaxByteOffset), - "AlignmentId" => Ok(Self::AlignmentId), - "MaxByteOffsetId" => Ok(Self::MaxByteOffsetId), - "NoSignedWrap" => Ok(Self::NoSignedWrap), - "NoUnsignedWrap" => Ok(Self::NoUnsignedWrap), - "WeightTextureQCOM" => Ok(Self::WeightTextureQCOM), - "BlockMatchTextureQCOM" => Ok(Self::BlockMatchTextureQCOM), - "ExplicitInterpAMD" => Ok(Self::ExplicitInterpAMD), - "NodeSharesPayloadLimitsWithAMDX" => Ok(Self::NodeSharesPayloadLimitsWithAMDX), - "NodeMaxPayloadsAMDX" => Ok(Self::NodeMaxPayloadsAMDX), - "TrackFinishWritingAMDX" => Ok(Self::TrackFinishWritingAMDX), - "PayloadNodeNameAMDX" => Ok(Self::PayloadNodeNameAMDX), - "OverrideCoverageNV" => Ok(Self::OverrideCoverageNV), - "PassthroughNV" => Ok(Self::PassthroughNV), - "ViewportRelativeNV" => Ok(Self::ViewportRelativeNV), - "SecondaryViewportRelativeNV" => Ok(Self::SecondaryViewportRelativeNV), - "PerPrimitiveNV" => Ok(Self::PerPrimitiveNV), - "PerPrimitiveEXT" => Ok(Self::PerPrimitiveNV), - "PerViewNV" => Ok(Self::PerViewNV), - "PerTaskNV" => Ok(Self::PerTaskNV), - "PerVertexKHR" => Ok(Self::PerVertexKHR), - "PerVertexNV" => Ok(Self::PerVertexKHR), - "NonUniform" => Ok(Self::NonUniform), - "NonUniformEXT" => Ok(Self::NonUniform), - "RestrictPointer" => Ok(Self::RestrictPointer), - "RestrictPointerEXT" => Ok(Self::RestrictPointer), - "AliasedPointer" => Ok(Self::AliasedPointer), - "AliasedPointerEXT" => Ok(Self::AliasedPointer), - "HitObjectShaderRecordBufferNV" => Ok(Self::HitObjectShaderRecordBufferNV), - "BindlessSamplerNV" => Ok(Self::BindlessSamplerNV), - "BindlessImageNV" => Ok(Self::BindlessImageNV), - "BoundSamplerNV" => Ok(Self::BoundSamplerNV), - "BoundImageNV" => Ok(Self::BoundImageNV), - "SIMTCallINTEL" => Ok(Self::SIMTCallINTEL), - "ReferencedIndirectlyINTEL" => Ok(Self::ReferencedIndirectlyINTEL), - "ClobberINTEL" => Ok(Self::ClobberINTEL), - "SideEffectsINTEL" => Ok(Self::SideEffectsINTEL), - "VectorComputeVariableINTEL" => Ok(Self::VectorComputeVariableINTEL), - "FuncParamIOKindINTEL" => Ok(Self::FuncParamIOKindINTEL), - "VectorComputeFunctionINTEL" => Ok(Self::VectorComputeFunctionINTEL), - "StackCallINTEL" => Ok(Self::StackCallINTEL), - "GlobalVariableOffsetINTEL" => Ok(Self::GlobalVariableOffsetINTEL), - "CounterBuffer" => Ok(Self::CounterBuffer), - "HlslCounterBufferGOOGLE" => Ok(Self::CounterBuffer), - "UserSemantic" => Ok(Self::UserSemantic), - "HlslSemanticGOOGLE" => Ok(Self::UserSemantic), - "UserTypeGOOGLE" => Ok(Self::UserTypeGOOGLE), - "FunctionRoundingModeINTEL" => Ok(Self::FunctionRoundingModeINTEL), - "FunctionDenormModeINTEL" => Ok(Self::FunctionDenormModeINTEL), - "RegisterINTEL" => Ok(Self::RegisterINTEL), - "MemoryINTEL" => Ok(Self::MemoryINTEL), - "NumbanksINTEL" => Ok(Self::NumbanksINTEL), - "BankwidthINTEL" => Ok(Self::BankwidthINTEL), - "MaxPrivateCopiesINTEL" => Ok(Self::MaxPrivateCopiesINTEL), - "SinglepumpINTEL" => Ok(Self::SinglepumpINTEL), - "DoublepumpINTEL" => Ok(Self::DoublepumpINTEL), - "MaxReplicatesINTEL" => Ok(Self::MaxReplicatesINTEL), - "SimpleDualPortINTEL" => Ok(Self::SimpleDualPortINTEL), - "MergeINTEL" => Ok(Self::MergeINTEL), - "BankBitsINTEL" => Ok(Self::BankBitsINTEL), - "ForcePow2DepthINTEL" => Ok(Self::ForcePow2DepthINTEL), - "BurstCoalesceINTEL" => Ok(Self::BurstCoalesceINTEL), - "CacheSizeINTEL" => Ok(Self::CacheSizeINTEL), - "DontStaticallyCoalesceINTEL" => Ok(Self::DontStaticallyCoalesceINTEL), - "PrefetchINTEL" => Ok(Self::PrefetchINTEL), - "StallEnableINTEL" => Ok(Self::StallEnableINTEL), - "FuseLoopsInFunctionINTEL" => Ok(Self::FuseLoopsInFunctionINTEL), - "MathOpDSPModeINTEL" => Ok(Self::MathOpDSPModeINTEL), - "AliasScopeINTEL" => Ok(Self::AliasScopeINTEL), - "NoAliasINTEL" => Ok(Self::NoAliasINTEL), - "InitiationIntervalINTEL" => Ok(Self::InitiationIntervalINTEL), - "MaxConcurrencyINTEL" => Ok(Self::MaxConcurrencyINTEL), - "PipelineEnableINTEL" => Ok(Self::PipelineEnableINTEL), - "BufferLocationINTEL" => Ok(Self::BufferLocationINTEL), - "IOPipeStorageINTEL" => Ok(Self::IOPipeStorageINTEL), - "FunctionFloatingPointModeINTEL" => Ok(Self::FunctionFloatingPointModeINTEL), - "SingleElementVectorINTEL" => Ok(Self::SingleElementVectorINTEL), - "VectorComputeCallableFunctionINTEL" => Ok(Self::VectorComputeCallableFunctionINTEL), - "MediaBlockIOINTEL" => Ok(Self::MediaBlockIOINTEL), - "InitModeINTEL" => Ok(Self::InitModeINTEL), - "ImplementInRegisterMapINTEL" => Ok(Self::ImplementInRegisterMapINTEL), - "HostAccessINTEL" => Ok(Self::HostAccessINTEL), - "FPMaxErrorDecorationINTEL" => Ok(Self::FPMaxErrorDecorationINTEL), - "LatencyControlLabelINTEL" => Ok(Self::LatencyControlLabelINTEL), - "LatencyControlConstraintINTEL" => Ok(Self::LatencyControlConstraintINTEL), - "ConduitKernelArgumentINTEL" => Ok(Self::ConduitKernelArgumentINTEL), - "RegisterMapKernelArgumentINTEL" => Ok(Self::RegisterMapKernelArgumentINTEL), - "MMHostInterfaceAddressWidthINTEL" => Ok(Self::MMHostInterfaceAddressWidthINTEL), - "MMHostInterfaceDataWidthINTEL" => Ok(Self::MMHostInterfaceDataWidthINTEL), - "MMHostInterfaceLatencyINTEL" => Ok(Self::MMHostInterfaceLatencyINTEL), - "MMHostInterfaceReadWriteModeINTEL" => Ok(Self::MMHostInterfaceReadWriteModeINTEL), - "MMHostInterfaceMaxBurstINTEL" => Ok(Self::MMHostInterfaceMaxBurstINTEL), - "MMHostInterfaceWaitRequestINTEL" => Ok(Self::MMHostInterfaceWaitRequestINTEL), - "StableKernelArgumentINTEL" => Ok(Self::StableKernelArgumentINTEL), - "CacheControlLoadINTEL" => Ok(Self::CacheControlLoadINTEL), - "CacheControlStoreINTEL" => Ok(Self::CacheControlStoreINTEL), - _ => Err(()), - } + Ok(match s { + "RelaxedPrecision" => Self::RelaxedPrecision, + "SpecId" => Self::SpecId, + "Block" => Self::Block, + "BufferBlock" => Self::BufferBlock, + "RowMajor" => Self::RowMajor, + "ColMajor" => Self::ColMajor, + "ArrayStride" => Self::ArrayStride, + "MatrixStride" => Self::MatrixStride, + "GLSLShared" => Self::GLSLShared, + "GLSLPacked" => Self::GLSLPacked, + "CPacked" => Self::CPacked, + "BuiltIn" => Self::BuiltIn, + "NoPerspective" => Self::NoPerspective, + "Flat" => Self::Flat, + "Patch" => Self::Patch, + "Centroid" => Self::Centroid, + "Sample" => Self::Sample, + "Invariant" => Self::Invariant, + "Restrict" => Self::Restrict, + "Aliased" => Self::Aliased, + "Volatile" => Self::Volatile, + "Constant" => Self::Constant, + "Coherent" => Self::Coherent, + "NonWritable" => Self::NonWritable, + "NonReadable" => Self::NonReadable, + "Uniform" => Self::Uniform, + "UniformId" => Self::UniformId, + "SaturatedConversion" => Self::SaturatedConversion, + "Stream" => Self::Stream, + "Location" => Self::Location, + "Component" => Self::Component, + "Index" => Self::Index, + "Binding" => Self::Binding, + "DescriptorSet" => Self::DescriptorSet, + "Offset" => Self::Offset, + "XfbBuffer" => Self::XfbBuffer, + "XfbStride" => Self::XfbStride, + "FuncParamAttr" => Self::FuncParamAttr, + "FPRoundingMode" => Self::FPRoundingMode, + "FPFastMathMode" => Self::FPFastMathMode, + "LinkageAttributes" => Self::LinkageAttributes, + "NoContraction" => Self::NoContraction, + "InputAttachmentIndex" => Self::InputAttachmentIndex, + "Alignment" => Self::Alignment, + "MaxByteOffset" => Self::MaxByteOffset, + "AlignmentId" => Self::AlignmentId, + "MaxByteOffsetId" => Self::MaxByteOffsetId, + "NoSignedWrap" => Self::NoSignedWrap, + "NoUnsignedWrap" => Self::NoUnsignedWrap, + "WeightTextureQCOM" => Self::WeightTextureQCOM, + "BlockMatchTextureQCOM" => Self::BlockMatchTextureQCOM, + "BlockMatchSamplerQCOM" => Self::BlockMatchSamplerQCOM, + "ExplicitInterpAMD" => Self::ExplicitInterpAMD, + "NodeSharesPayloadLimitsWithAMDX" => Self::NodeSharesPayloadLimitsWithAMDX, + "NodeMaxPayloadsAMDX" => Self::NodeMaxPayloadsAMDX, + "TrackFinishWritingAMDX" => Self::TrackFinishWritingAMDX, + "PayloadNodeNameAMDX" => Self::PayloadNodeNameAMDX, + "PayloadNodeBaseIndexAMDX" => Self::PayloadNodeBaseIndexAMDX, + "PayloadNodeSparseArrayAMDX" => Self::PayloadNodeSparseArrayAMDX, + "PayloadNodeArraySizeAMDX" => Self::PayloadNodeArraySizeAMDX, + "PayloadDispatchIndirectAMDX" => Self::PayloadDispatchIndirectAMDX, + "OverrideCoverageNV" => Self::OverrideCoverageNV, + "PassthroughNV" => Self::PassthroughNV, + "ViewportRelativeNV" => Self::ViewportRelativeNV, + "SecondaryViewportRelativeNV" => Self::SecondaryViewportRelativeNV, + "PerPrimitiveEXT" => Self::PerPrimitiveEXT, + "PerPrimitiveNV" => Self::PerPrimitiveEXT, + "PerViewNV" => Self::PerViewNV, + "PerTaskNV" => Self::PerTaskNV, + "PerVertexKHR" => Self::PerVertexKHR, + "PerVertexNV" => Self::PerVertexKHR, + "NonUniform" => Self::NonUniform, + "NonUniformEXT" => Self::NonUniform, + "RestrictPointer" => Self::RestrictPointer, + "RestrictPointerEXT" => Self::RestrictPointer, + "AliasedPointer" => Self::AliasedPointer, + "AliasedPointerEXT" => Self::AliasedPointer, + "HitObjectShaderRecordBufferNV" => Self::HitObjectShaderRecordBufferNV, + "BindlessSamplerNV" => Self::BindlessSamplerNV, + "BindlessImageNV" => Self::BindlessImageNV, + "BoundSamplerNV" => Self::BoundSamplerNV, + "BoundImageNV" => Self::BoundImageNV, + "SIMTCallINTEL" => Self::SIMTCallINTEL, + "ReferencedIndirectlyINTEL" => Self::ReferencedIndirectlyINTEL, + "ClobberINTEL" => Self::ClobberINTEL, + "SideEffectsINTEL" => Self::SideEffectsINTEL, + "VectorComputeVariableINTEL" => Self::VectorComputeVariableINTEL, + "FuncParamIOKindINTEL" => Self::FuncParamIOKindINTEL, + "VectorComputeFunctionINTEL" => Self::VectorComputeFunctionINTEL, + "StackCallINTEL" => Self::StackCallINTEL, + "GlobalVariableOffsetINTEL" => Self::GlobalVariableOffsetINTEL, + "CounterBuffer" => Self::CounterBuffer, + "HlslCounterBufferGOOGLE" => Self::CounterBuffer, + "UserSemantic" => Self::UserSemantic, + "HlslSemanticGOOGLE" => Self::UserSemantic, + "UserTypeGOOGLE" => Self::UserTypeGOOGLE, + "FunctionRoundingModeINTEL" => Self::FunctionRoundingModeINTEL, + "FunctionDenormModeINTEL" => Self::FunctionDenormModeINTEL, + "RegisterINTEL" => Self::RegisterINTEL, + "MemoryINTEL" => Self::MemoryINTEL, + "NumbanksINTEL" => Self::NumbanksINTEL, + "BankwidthINTEL" => Self::BankwidthINTEL, + "MaxPrivateCopiesINTEL" => Self::MaxPrivateCopiesINTEL, + "SinglepumpINTEL" => Self::SinglepumpINTEL, + "DoublepumpINTEL" => Self::DoublepumpINTEL, + "MaxReplicatesINTEL" => Self::MaxReplicatesINTEL, + "SimpleDualPortINTEL" => Self::SimpleDualPortINTEL, + "MergeINTEL" => Self::MergeINTEL, + "BankBitsINTEL" => Self::BankBitsINTEL, + "ForcePow2DepthINTEL" => Self::ForcePow2DepthINTEL, + "StridesizeINTEL" => Self::StridesizeINTEL, + "WordsizeINTEL" => Self::WordsizeINTEL, + "TrueDualPortINTEL" => Self::TrueDualPortINTEL, + "BurstCoalesceINTEL" => Self::BurstCoalesceINTEL, + "CacheSizeINTEL" => Self::CacheSizeINTEL, + "DontStaticallyCoalesceINTEL" => Self::DontStaticallyCoalesceINTEL, + "PrefetchINTEL" => Self::PrefetchINTEL, + "StallEnableINTEL" => Self::StallEnableINTEL, + "FuseLoopsInFunctionINTEL" => Self::FuseLoopsInFunctionINTEL, + "MathOpDSPModeINTEL" => Self::MathOpDSPModeINTEL, + "AliasScopeINTEL" => Self::AliasScopeINTEL, + "NoAliasINTEL" => Self::NoAliasINTEL, + "InitiationIntervalINTEL" => Self::InitiationIntervalINTEL, + "MaxConcurrencyINTEL" => Self::MaxConcurrencyINTEL, + "PipelineEnableINTEL" => Self::PipelineEnableINTEL, + "BufferLocationINTEL" => Self::BufferLocationINTEL, + "IOPipeStorageINTEL" => Self::IOPipeStorageINTEL, + "FunctionFloatingPointModeINTEL" => Self::FunctionFloatingPointModeINTEL, + "SingleElementVectorINTEL" => Self::SingleElementVectorINTEL, + "VectorComputeCallableFunctionINTEL" => Self::VectorComputeCallableFunctionINTEL, + "MediaBlockIOINTEL" => Self::MediaBlockIOINTEL, + "StallFreeINTEL" => Self::StallFreeINTEL, + "FPMaxErrorDecorationINTEL" => Self::FPMaxErrorDecorationINTEL, + "LatencyControlLabelINTEL" => Self::LatencyControlLabelINTEL, + "LatencyControlConstraintINTEL" => Self::LatencyControlConstraintINTEL, + "ConduitKernelArgumentINTEL" => Self::ConduitKernelArgumentINTEL, + "RegisterMapKernelArgumentINTEL" => Self::RegisterMapKernelArgumentINTEL, + "MMHostInterfaceAddressWidthINTEL" => Self::MMHostInterfaceAddressWidthINTEL, + "MMHostInterfaceDataWidthINTEL" => Self::MMHostInterfaceDataWidthINTEL, + "MMHostInterfaceLatencyINTEL" => Self::MMHostInterfaceLatencyINTEL, + "MMHostInterfaceReadWriteModeINTEL" => Self::MMHostInterfaceReadWriteModeINTEL, + "MMHostInterfaceMaxBurstINTEL" => Self::MMHostInterfaceMaxBurstINTEL, + "MMHostInterfaceWaitRequestINTEL" => Self::MMHostInterfaceWaitRequestINTEL, + "StableKernelArgumentINTEL" => Self::StableKernelArgumentINTEL, + "HostAccessINTEL" => Self::HostAccessINTEL, + "InitModeINTEL" => Self::InitModeINTEL, + "ImplementInRegisterMapINTEL" => Self::ImplementInRegisterMapINTEL, + "CacheControlLoadINTEL" => Self::CacheControlLoadINTEL, + "CacheControlStoreINTEL" => Self::CacheControlStoreINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [BuiltIn](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_built_in_a_built_in)"] @@ -1637,7 +1690,7 @@ pub enum BuiltIn { BaryCoordSmoothSampleAMD = 4997u32, BaryCoordPullModelAMD = 4998u32, FragStencilRefEXT = 5014u32, - CoalescedInputCountAMDX = 5021u32, + RemainingRecursionLevelsAMDX = 5021u32, ShaderIndexAMDX = 5073u32, ViewportMaskNV = 5253u32, SecondaryPositionNV = 5257u32, @@ -1661,31 +1714,38 @@ pub enum BuiltIn { PrimitiveLineIndicesEXT = 5295u32, PrimitiveTriangleIndicesEXT = 5296u32, CullPrimitiveEXT = 5299u32, - LaunchIdNV = 5319u32, - LaunchSizeNV = 5320u32, - WorldRayOriginNV = 5321u32, - WorldRayDirectionNV = 5322u32, - ObjectRayOriginNV = 5323u32, - ObjectRayDirectionNV = 5324u32, - RayTminNV = 5325u32, - RayTmaxNV = 5326u32, - InstanceCustomIndexNV = 5327u32, - ObjectToWorldNV = 5330u32, - WorldToObjectNV = 5331u32, + LaunchIdKHR = 5319u32, + LaunchSizeKHR = 5320u32, + WorldRayOriginKHR = 5321u32, + WorldRayDirectionKHR = 5322u32, + ObjectRayOriginKHR = 5323u32, + ObjectRayDirectionKHR = 5324u32, + RayTminKHR = 5325u32, + RayTmaxKHR = 5326u32, + InstanceCustomIndexKHR = 5327u32, + ObjectToWorldKHR = 5330u32, + WorldToObjectKHR = 5331u32, HitTNV = 5332u32, - HitKindNV = 5333u32, + HitKindKHR = 5333u32, CurrentRayTimeNV = 5334u32, HitTriangleVertexPositionsKHR = 5335u32, HitMicroTriangleVertexPositionsNV = 5337u32, HitMicroTriangleVertexBarycentricsNV = 5344u32, - IncomingRayFlagsNV = 5351u32, + IncomingRayFlagsKHR = 5351u32, RayGeometryIndexKHR = 5352u32, + HitIsSphereNV = 5359u32, + HitIsLSSNV = 5360u32, + HitSpherePositionNV = 5361u32, WarpsPerSMNV = 5374u32, SMCountNV = 5375u32, WarpIDNV = 5376u32, SMIDNV = 5377u32, + HitLSSPositionsNV = 5396u32, HitKindFrontFacingMicroTriangleNV = 5405u32, HitKindBackFacingMicroTriangleNV = 5406u32, + HitSphereRadiusNV = 5420u32, + HitLSSRadiiNV = 5421u32, + ClusterIDNV = 5436u32, CullMaskKHR = 6021u32, } impl BuiltIn { @@ -1719,8 +1779,12 @@ impl BuiltIn { 5337u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5337u32) }, 5344u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5344u32) }, 5351u32..=5352u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) }, + 5359u32..=5361u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) }, 5374u32..=5377u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) }, + 5396u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5396u32) }, 5405u32..=5406u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) }, + 5420u32..=5421u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) }, + 5436u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5436u32) }, 6021u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(6021u32) }, _ => return None, }) @@ -1737,166 +1801,171 @@ impl BuiltIn { pub const BaryCoordNoPerspNV: Self = Self::BaryCoordNoPerspKHR; pub const FragmentSizeNV: Self = Self::FragSizeEXT; pub const InvocationsPerPixelNV: Self = Self::FragInvocationCountEXT; - pub const LaunchIdKHR: Self = Self::LaunchIdNV; - pub const LaunchSizeKHR: Self = Self::LaunchSizeNV; - pub const WorldRayOriginKHR: Self = Self::WorldRayOriginNV; - pub const WorldRayDirectionKHR: Self = Self::WorldRayDirectionNV; - pub const ObjectRayOriginKHR: Self = Self::ObjectRayOriginNV; - pub const ObjectRayDirectionKHR: Self = Self::ObjectRayDirectionNV; - pub const RayTminKHR: Self = Self::RayTminNV; - pub const RayTmaxKHR: Self = Self::RayTmaxNV; - pub const InstanceCustomIndexKHR: Self = Self::InstanceCustomIndexNV; - pub const ObjectToWorldKHR: Self = Self::ObjectToWorldNV; - pub const WorldToObjectKHR: Self = Self::WorldToObjectNV; - pub const HitKindKHR: Self = Self::HitKindNV; - pub const IncomingRayFlagsKHR: Self = Self::IncomingRayFlagsNV; + pub const LaunchIdNV: Self = Self::LaunchIdKHR; + pub const LaunchSizeNV: Self = Self::LaunchSizeKHR; + pub const WorldRayOriginNV: Self = Self::WorldRayOriginKHR; + pub const WorldRayDirectionNV: Self = Self::WorldRayDirectionKHR; + pub const ObjectRayOriginNV: Self = Self::ObjectRayOriginKHR; + pub const ObjectRayDirectionNV: Self = Self::ObjectRayDirectionKHR; + pub const RayTminNV: Self = Self::RayTminKHR; + pub const RayTmaxNV: Self = Self::RayTmaxKHR; + pub const InstanceCustomIndexNV: Self = Self::InstanceCustomIndexKHR; + pub const ObjectToWorldNV: Self = Self::ObjectToWorldKHR; + pub const WorldToObjectNV: Self = Self::WorldToObjectKHR; + pub const HitKindNV: Self = Self::HitKindKHR; + pub const IncomingRayFlagsNV: Self = Self::IncomingRayFlagsKHR; } impl core::str::FromStr for BuiltIn { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Position" => Ok(Self::Position), - "PointSize" => Ok(Self::PointSize), - "ClipDistance" => Ok(Self::ClipDistance), - "CullDistance" => Ok(Self::CullDistance), - "VertexId" => Ok(Self::VertexId), - "InstanceId" => Ok(Self::InstanceId), - "PrimitiveId" => Ok(Self::PrimitiveId), - "InvocationId" => Ok(Self::InvocationId), - "Layer" => Ok(Self::Layer), - "ViewportIndex" => Ok(Self::ViewportIndex), - "TessLevelOuter" => Ok(Self::TessLevelOuter), - "TessLevelInner" => Ok(Self::TessLevelInner), - "TessCoord" => Ok(Self::TessCoord), - "PatchVertices" => Ok(Self::PatchVertices), - "FragCoord" => Ok(Self::FragCoord), - "PointCoord" => Ok(Self::PointCoord), - "FrontFacing" => Ok(Self::FrontFacing), - "SampleId" => Ok(Self::SampleId), - "SamplePosition" => Ok(Self::SamplePosition), - "SampleMask" => Ok(Self::SampleMask), - "FragDepth" => Ok(Self::FragDepth), - "HelperInvocation" => Ok(Self::HelperInvocation), - "NumWorkgroups" => Ok(Self::NumWorkgroups), - "WorkgroupSize" => Ok(Self::WorkgroupSize), - "WorkgroupId" => Ok(Self::WorkgroupId), - "LocalInvocationId" => Ok(Self::LocalInvocationId), - "GlobalInvocationId" => Ok(Self::GlobalInvocationId), - "LocalInvocationIndex" => Ok(Self::LocalInvocationIndex), - "WorkDim" => Ok(Self::WorkDim), - "GlobalSize" => Ok(Self::GlobalSize), - "EnqueuedWorkgroupSize" => Ok(Self::EnqueuedWorkgroupSize), - "GlobalOffset" => Ok(Self::GlobalOffset), - "GlobalLinearId" => Ok(Self::GlobalLinearId), - "SubgroupSize" => Ok(Self::SubgroupSize), - "SubgroupMaxSize" => Ok(Self::SubgroupMaxSize), - "NumSubgroups" => Ok(Self::NumSubgroups), - "NumEnqueuedSubgroups" => Ok(Self::NumEnqueuedSubgroups), - "SubgroupId" => Ok(Self::SubgroupId), - "SubgroupLocalInvocationId" => Ok(Self::SubgroupLocalInvocationId), - "VertexIndex" => Ok(Self::VertexIndex), - "InstanceIndex" => Ok(Self::InstanceIndex), - "CoreIDARM" => Ok(Self::CoreIDARM), - "CoreCountARM" => Ok(Self::CoreCountARM), - "CoreMaxIDARM" => Ok(Self::CoreMaxIDARM), - "WarpIDARM" => Ok(Self::WarpIDARM), - "WarpMaxIDARM" => Ok(Self::WarpMaxIDARM), - "SubgroupEqMask" => Ok(Self::SubgroupEqMask), - "SubgroupEqMaskKHR" => Ok(Self::SubgroupEqMask), - "SubgroupGeMask" => Ok(Self::SubgroupGeMask), - "SubgroupGeMaskKHR" => Ok(Self::SubgroupGeMask), - "SubgroupGtMask" => Ok(Self::SubgroupGtMask), - "SubgroupGtMaskKHR" => Ok(Self::SubgroupGtMask), - "SubgroupLeMask" => Ok(Self::SubgroupLeMask), - "SubgroupLeMaskKHR" => Ok(Self::SubgroupLeMask), - "SubgroupLtMask" => Ok(Self::SubgroupLtMask), - "SubgroupLtMaskKHR" => Ok(Self::SubgroupLtMask), - "BaseVertex" => Ok(Self::BaseVertex), - "BaseInstance" => Ok(Self::BaseInstance), - "DrawIndex" => Ok(Self::DrawIndex), - "PrimitiveShadingRateKHR" => Ok(Self::PrimitiveShadingRateKHR), - "DeviceIndex" => Ok(Self::DeviceIndex), - "ViewIndex" => Ok(Self::ViewIndex), - "ShadingRateKHR" => Ok(Self::ShadingRateKHR), - "BaryCoordNoPerspAMD" => Ok(Self::BaryCoordNoPerspAMD), - "BaryCoordNoPerspCentroidAMD" => Ok(Self::BaryCoordNoPerspCentroidAMD), - "BaryCoordNoPerspSampleAMD" => Ok(Self::BaryCoordNoPerspSampleAMD), - "BaryCoordSmoothAMD" => Ok(Self::BaryCoordSmoothAMD), - "BaryCoordSmoothCentroidAMD" => Ok(Self::BaryCoordSmoothCentroidAMD), - "BaryCoordSmoothSampleAMD" => Ok(Self::BaryCoordSmoothSampleAMD), - "BaryCoordPullModelAMD" => Ok(Self::BaryCoordPullModelAMD), - "FragStencilRefEXT" => Ok(Self::FragStencilRefEXT), - "CoalescedInputCountAMDX" => Ok(Self::CoalescedInputCountAMDX), - "ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX), - "ViewportMaskNV" => Ok(Self::ViewportMaskNV), - "SecondaryPositionNV" => Ok(Self::SecondaryPositionNV), - "SecondaryViewportMaskNV" => Ok(Self::SecondaryViewportMaskNV), - "PositionPerViewNV" => Ok(Self::PositionPerViewNV), - "ViewportMaskPerViewNV" => Ok(Self::ViewportMaskPerViewNV), - "FullyCoveredEXT" => Ok(Self::FullyCoveredEXT), - "TaskCountNV" => Ok(Self::TaskCountNV), - "PrimitiveCountNV" => Ok(Self::PrimitiveCountNV), - "PrimitiveIndicesNV" => Ok(Self::PrimitiveIndicesNV), - "ClipDistancePerViewNV" => Ok(Self::ClipDistancePerViewNV), - "CullDistancePerViewNV" => Ok(Self::CullDistancePerViewNV), - "LayerPerViewNV" => Ok(Self::LayerPerViewNV), - "MeshViewCountNV" => Ok(Self::MeshViewCountNV), - "MeshViewIndicesNV" => Ok(Self::MeshViewIndicesNV), - "BaryCoordKHR" => Ok(Self::BaryCoordKHR), - "BaryCoordNV" => Ok(Self::BaryCoordKHR), - "BaryCoordNoPerspKHR" => Ok(Self::BaryCoordNoPerspKHR), - "BaryCoordNoPerspNV" => Ok(Self::BaryCoordNoPerspKHR), - "FragSizeEXT" => Ok(Self::FragSizeEXT), - "FragmentSizeNV" => Ok(Self::FragSizeEXT), - "FragInvocationCountEXT" => Ok(Self::FragInvocationCountEXT), - "InvocationsPerPixelNV" => Ok(Self::FragInvocationCountEXT), - "PrimitivePointIndicesEXT" => Ok(Self::PrimitivePointIndicesEXT), - "PrimitiveLineIndicesEXT" => Ok(Self::PrimitiveLineIndicesEXT), - "PrimitiveTriangleIndicesEXT" => Ok(Self::PrimitiveTriangleIndicesEXT), - "CullPrimitiveEXT" => Ok(Self::CullPrimitiveEXT), - "LaunchIdNV" => Ok(Self::LaunchIdNV), - "LaunchIdKHR" => Ok(Self::LaunchIdNV), - "LaunchSizeNV" => Ok(Self::LaunchSizeNV), - "LaunchSizeKHR" => Ok(Self::LaunchSizeNV), - "WorldRayOriginNV" => Ok(Self::WorldRayOriginNV), - "WorldRayOriginKHR" => Ok(Self::WorldRayOriginNV), - "WorldRayDirectionNV" => Ok(Self::WorldRayDirectionNV), - "WorldRayDirectionKHR" => Ok(Self::WorldRayDirectionNV), - "ObjectRayOriginNV" => Ok(Self::ObjectRayOriginNV), - "ObjectRayOriginKHR" => Ok(Self::ObjectRayOriginNV), - "ObjectRayDirectionNV" => Ok(Self::ObjectRayDirectionNV), - "ObjectRayDirectionKHR" => Ok(Self::ObjectRayDirectionNV), - "RayTminNV" => Ok(Self::RayTminNV), - "RayTminKHR" => Ok(Self::RayTminNV), - "RayTmaxNV" => Ok(Self::RayTmaxNV), - "RayTmaxKHR" => Ok(Self::RayTmaxNV), - "InstanceCustomIndexNV" => Ok(Self::InstanceCustomIndexNV), - "InstanceCustomIndexKHR" => Ok(Self::InstanceCustomIndexNV), - "ObjectToWorldNV" => Ok(Self::ObjectToWorldNV), - "ObjectToWorldKHR" => Ok(Self::ObjectToWorldNV), - "WorldToObjectNV" => Ok(Self::WorldToObjectNV), - "WorldToObjectKHR" => Ok(Self::WorldToObjectNV), - "HitTNV" => Ok(Self::HitTNV), - "HitKindNV" => Ok(Self::HitKindNV), - "HitKindKHR" => Ok(Self::HitKindNV), - "CurrentRayTimeNV" => Ok(Self::CurrentRayTimeNV), - "HitTriangleVertexPositionsKHR" => Ok(Self::HitTriangleVertexPositionsKHR), - "HitMicroTriangleVertexPositionsNV" => Ok(Self::HitMicroTriangleVertexPositionsNV), - "HitMicroTriangleVertexBarycentricsNV" => { - Ok(Self::HitMicroTriangleVertexBarycentricsNV) - } - "IncomingRayFlagsNV" => Ok(Self::IncomingRayFlagsNV), - "IncomingRayFlagsKHR" => Ok(Self::IncomingRayFlagsNV), - "RayGeometryIndexKHR" => Ok(Self::RayGeometryIndexKHR), - "WarpsPerSMNV" => Ok(Self::WarpsPerSMNV), - "SMCountNV" => Ok(Self::SMCountNV), - "WarpIDNV" => Ok(Self::WarpIDNV), - "SMIDNV" => Ok(Self::SMIDNV), - "HitKindFrontFacingMicroTriangleNV" => Ok(Self::HitKindFrontFacingMicroTriangleNV), - "HitKindBackFacingMicroTriangleNV" => Ok(Self::HitKindBackFacingMicroTriangleNV), - "CullMaskKHR" => Ok(Self::CullMaskKHR), - _ => Err(()), - } + Ok(match s { + "Position" => Self::Position, + "PointSize" => Self::PointSize, + "ClipDistance" => Self::ClipDistance, + "CullDistance" => Self::CullDistance, + "VertexId" => Self::VertexId, + "InstanceId" => Self::InstanceId, + "PrimitiveId" => Self::PrimitiveId, + "InvocationId" => Self::InvocationId, + "Layer" => Self::Layer, + "ViewportIndex" => Self::ViewportIndex, + "TessLevelOuter" => Self::TessLevelOuter, + "TessLevelInner" => Self::TessLevelInner, + "TessCoord" => Self::TessCoord, + "PatchVertices" => Self::PatchVertices, + "FragCoord" => Self::FragCoord, + "PointCoord" => Self::PointCoord, + "FrontFacing" => Self::FrontFacing, + "SampleId" => Self::SampleId, + "SamplePosition" => Self::SamplePosition, + "SampleMask" => Self::SampleMask, + "FragDepth" => Self::FragDepth, + "HelperInvocation" => Self::HelperInvocation, + "NumWorkgroups" => Self::NumWorkgroups, + "WorkgroupSize" => Self::WorkgroupSize, + "WorkgroupId" => Self::WorkgroupId, + "LocalInvocationId" => Self::LocalInvocationId, + "GlobalInvocationId" => Self::GlobalInvocationId, + "LocalInvocationIndex" => Self::LocalInvocationIndex, + "WorkDim" => Self::WorkDim, + "GlobalSize" => Self::GlobalSize, + "EnqueuedWorkgroupSize" => Self::EnqueuedWorkgroupSize, + "GlobalOffset" => Self::GlobalOffset, + "GlobalLinearId" => Self::GlobalLinearId, + "SubgroupSize" => Self::SubgroupSize, + "SubgroupMaxSize" => Self::SubgroupMaxSize, + "NumSubgroups" => Self::NumSubgroups, + "NumEnqueuedSubgroups" => Self::NumEnqueuedSubgroups, + "SubgroupId" => Self::SubgroupId, + "SubgroupLocalInvocationId" => Self::SubgroupLocalInvocationId, + "VertexIndex" => Self::VertexIndex, + "InstanceIndex" => Self::InstanceIndex, + "CoreIDARM" => Self::CoreIDARM, + "CoreCountARM" => Self::CoreCountARM, + "CoreMaxIDARM" => Self::CoreMaxIDARM, + "WarpIDARM" => Self::WarpIDARM, + "WarpMaxIDARM" => Self::WarpMaxIDARM, + "SubgroupEqMask" => Self::SubgroupEqMask, + "SubgroupEqMaskKHR" => Self::SubgroupEqMask, + "SubgroupGeMask" => Self::SubgroupGeMask, + "SubgroupGeMaskKHR" => Self::SubgroupGeMask, + "SubgroupGtMask" => Self::SubgroupGtMask, + "SubgroupGtMaskKHR" => Self::SubgroupGtMask, + "SubgroupLeMask" => Self::SubgroupLeMask, + "SubgroupLeMaskKHR" => Self::SubgroupLeMask, + "SubgroupLtMask" => Self::SubgroupLtMask, + "SubgroupLtMaskKHR" => Self::SubgroupLtMask, + "BaseVertex" => Self::BaseVertex, + "BaseInstance" => Self::BaseInstance, + "DrawIndex" => Self::DrawIndex, + "PrimitiveShadingRateKHR" => Self::PrimitiveShadingRateKHR, + "DeviceIndex" => Self::DeviceIndex, + "ViewIndex" => Self::ViewIndex, + "ShadingRateKHR" => Self::ShadingRateKHR, + "BaryCoordNoPerspAMD" => Self::BaryCoordNoPerspAMD, + "BaryCoordNoPerspCentroidAMD" => Self::BaryCoordNoPerspCentroidAMD, + "BaryCoordNoPerspSampleAMD" => Self::BaryCoordNoPerspSampleAMD, + "BaryCoordSmoothAMD" => Self::BaryCoordSmoothAMD, + "BaryCoordSmoothCentroidAMD" => Self::BaryCoordSmoothCentroidAMD, + "BaryCoordSmoothSampleAMD" => Self::BaryCoordSmoothSampleAMD, + "BaryCoordPullModelAMD" => Self::BaryCoordPullModelAMD, + "FragStencilRefEXT" => Self::FragStencilRefEXT, + "RemainingRecursionLevelsAMDX" => Self::RemainingRecursionLevelsAMDX, + "ShaderIndexAMDX" => Self::ShaderIndexAMDX, + "ViewportMaskNV" => Self::ViewportMaskNV, + "SecondaryPositionNV" => Self::SecondaryPositionNV, + "SecondaryViewportMaskNV" => Self::SecondaryViewportMaskNV, + "PositionPerViewNV" => Self::PositionPerViewNV, + "ViewportMaskPerViewNV" => Self::ViewportMaskPerViewNV, + "FullyCoveredEXT" => Self::FullyCoveredEXT, + "TaskCountNV" => Self::TaskCountNV, + "PrimitiveCountNV" => Self::PrimitiveCountNV, + "PrimitiveIndicesNV" => Self::PrimitiveIndicesNV, + "ClipDistancePerViewNV" => Self::ClipDistancePerViewNV, + "CullDistancePerViewNV" => Self::CullDistancePerViewNV, + "LayerPerViewNV" => Self::LayerPerViewNV, + "MeshViewCountNV" => Self::MeshViewCountNV, + "MeshViewIndicesNV" => Self::MeshViewIndicesNV, + "BaryCoordKHR" => Self::BaryCoordKHR, + "BaryCoordNV" => Self::BaryCoordKHR, + "BaryCoordNoPerspKHR" => Self::BaryCoordNoPerspKHR, + "BaryCoordNoPerspNV" => Self::BaryCoordNoPerspKHR, + "FragSizeEXT" => Self::FragSizeEXT, + "FragmentSizeNV" => Self::FragSizeEXT, + "FragInvocationCountEXT" => Self::FragInvocationCountEXT, + "InvocationsPerPixelNV" => Self::FragInvocationCountEXT, + "PrimitivePointIndicesEXT" => Self::PrimitivePointIndicesEXT, + "PrimitiveLineIndicesEXT" => Self::PrimitiveLineIndicesEXT, + "PrimitiveTriangleIndicesEXT" => Self::PrimitiveTriangleIndicesEXT, + "CullPrimitiveEXT" => Self::CullPrimitiveEXT, + "LaunchIdKHR" => Self::LaunchIdKHR, + "LaunchIdNV" => Self::LaunchIdKHR, + "LaunchSizeKHR" => Self::LaunchSizeKHR, + "LaunchSizeNV" => Self::LaunchSizeKHR, + "WorldRayOriginKHR" => Self::WorldRayOriginKHR, + "WorldRayOriginNV" => Self::WorldRayOriginKHR, + "WorldRayDirectionKHR" => Self::WorldRayDirectionKHR, + "WorldRayDirectionNV" => Self::WorldRayDirectionKHR, + "ObjectRayOriginKHR" => Self::ObjectRayOriginKHR, + "ObjectRayOriginNV" => Self::ObjectRayOriginKHR, + "ObjectRayDirectionKHR" => Self::ObjectRayDirectionKHR, + "ObjectRayDirectionNV" => Self::ObjectRayDirectionKHR, + "RayTminKHR" => Self::RayTminKHR, + "RayTminNV" => Self::RayTminKHR, + "RayTmaxKHR" => Self::RayTmaxKHR, + "RayTmaxNV" => Self::RayTmaxKHR, + "InstanceCustomIndexKHR" => Self::InstanceCustomIndexKHR, + "InstanceCustomIndexNV" => Self::InstanceCustomIndexKHR, + "ObjectToWorldKHR" => Self::ObjectToWorldKHR, + "ObjectToWorldNV" => Self::ObjectToWorldKHR, + "WorldToObjectKHR" => Self::WorldToObjectKHR, + "WorldToObjectNV" => Self::WorldToObjectKHR, + "HitTNV" => Self::HitTNV, + "HitKindKHR" => Self::HitKindKHR, + "HitKindNV" => Self::HitKindKHR, + "CurrentRayTimeNV" => Self::CurrentRayTimeNV, + "HitTriangleVertexPositionsKHR" => Self::HitTriangleVertexPositionsKHR, + "HitMicroTriangleVertexPositionsNV" => Self::HitMicroTriangleVertexPositionsNV, + "HitMicroTriangleVertexBarycentricsNV" => Self::HitMicroTriangleVertexBarycentricsNV, + "IncomingRayFlagsKHR" => Self::IncomingRayFlagsKHR, + "IncomingRayFlagsNV" => Self::IncomingRayFlagsKHR, + "RayGeometryIndexKHR" => Self::RayGeometryIndexKHR, + "HitIsSphereNV" => Self::HitIsSphereNV, + "HitIsLSSNV" => Self::HitIsLSSNV, + "HitSpherePositionNV" => Self::HitSpherePositionNV, + "WarpsPerSMNV" => Self::WarpsPerSMNV, + "SMCountNV" => Self::SMCountNV, + "WarpIDNV" => Self::WarpIDNV, + "SMIDNV" => Self::SMIDNV, + "HitLSSPositionsNV" => Self::HitLSSPositionsNV, + "HitKindFrontFacingMicroTriangleNV" => Self::HitKindFrontFacingMicroTriangleNV, + "HitKindBackFacingMicroTriangleNV" => Self::HitKindBackFacingMicroTriangleNV, + "HitSphereRadiusNV" => Self::HitSphereRadiusNV, + "HitLSSRadiiNV" => Self::HitLSSRadiiNV, + "ClusterIDNV" => Self::ClusterIDNV, + "CullMaskKHR" => Self::CullMaskKHR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [Scope](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_scope_a_scope)"] @@ -1929,17 +1998,17 @@ impl Scope { impl core::str::FromStr for Scope { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "CrossDevice" => Ok(Self::CrossDevice), - "Device" => Ok(Self::Device), - "Workgroup" => Ok(Self::Workgroup), - "Subgroup" => Ok(Self::Subgroup), - "Invocation" => Ok(Self::Invocation), - "QueueFamily" => Ok(Self::QueueFamily), - "QueueFamilyKHR" => Ok(Self::QueueFamily), - "ShaderCallKHR" => Ok(Self::ShaderCallKHR), - _ => Err(()), - } + Ok(match s { + "CrossDevice" => Self::CrossDevice, + "Device" => Self::Device, + "Workgroup" => Self::Workgroup, + "Subgroup" => Self::Subgroup, + "Invocation" => Self::Invocation, + "QueueFamily" => Self::QueueFamily, + "QueueFamilyKHR" => Self::QueueFamily, + "ShaderCallKHR" => Self::ShaderCallKHR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [GroupOperation](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_group_operation_a_group_operation)"] @@ -1971,16 +2040,16 @@ impl GroupOperation {} impl core::str::FromStr for GroupOperation { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Reduce" => Ok(Self::Reduce), - "InclusiveScan" => Ok(Self::InclusiveScan), - "ExclusiveScan" => Ok(Self::ExclusiveScan), - "ClusteredReduce" => Ok(Self::ClusteredReduce), - "PartitionedReduceNV" => Ok(Self::PartitionedReduceNV), - "PartitionedInclusiveScanNV" => Ok(Self::PartitionedInclusiveScanNV), - "PartitionedExclusiveScanNV" => Ok(Self::PartitionedExclusiveScanNV), - _ => Err(()), - } + Ok(match s { + "Reduce" => Self::Reduce, + "InclusiveScan" => Self::InclusiveScan, + "ExclusiveScan" => Self::ExclusiveScan, + "ClusteredReduce" => Self::ClusteredReduce, + "PartitionedReduceNV" => Self::PartitionedReduceNV, + "PartitionedInclusiveScanNV" => Self::PartitionedInclusiveScanNV, + "PartitionedExclusiveScanNV" => Self::PartitionedExclusiveScanNV, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [KernelEnqueueFlags](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_kernel_enqueue_flags_a_kernel_enqueue_flags)"] @@ -2007,12 +2076,12 @@ impl KernelEnqueueFlags {} impl core::str::FromStr for KernelEnqueueFlags { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "NoWait" => Ok(Self::NoWait), - "WaitKernel" => Ok(Self::WaitKernel), - "WaitWorkGroup" => Ok(Self::WaitWorkGroup), - _ => Err(()), - } + Ok(match s { + "NoWait" => Self::NoWait, + "WaitKernel" => Self::WaitKernel, + "WaitWorkGroup" => Self::WaitWorkGroup, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [Capability](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_capability_a_capability)"] @@ -2096,6 +2165,7 @@ pub enum Capability { TileImageColorReadAccessEXT = 4166u32, TileImageDepthReadAccessEXT = 4167u32, TileImageStencilReadAccessEXT = 4168u32, + CooperativeMatrixLayoutsARM = 4201u32, FragmentShadingRateKHR = 4422u32, SubgroupBallotKHR = 4423u32, DrawParameters = 4427u32, @@ -2123,11 +2193,13 @@ pub enum Capability { RoundingModeRTZ = 4468u32, RayQueryProvisionalKHR = 4471u32, RayQueryKHR = 4472u32, + UntypedPointersKHR = 4473u32, RayTraversalPrimitiveCullingKHR = 4478u32, RayTracingKHR = 4479u32, TextureSampleWeightedQCOM = 4484u32, TextureBoxFilterQCOM = 4485u32, TextureBlockMatchQCOM = 4486u32, + TextureBlockMatch2QCOM = 4498u32, Float16ImageAMD = 5008u32, ImageGatherBiasLodAMD = 5009u32, FragmentMaskAMD = 5010u32, @@ -2136,6 +2208,7 @@ pub enum Capability { Int64ImageEXT = 5016u32, ShaderClockKHR = 5055u32, ShaderEnqueueAMDX = 5067u32, + QuadControlKHR = 5087u32, SampleMaskOverrideCoverageNV = 5249u32, GeometryShaderPassthroughNV = 5251u32, ShaderViewportIndexLayerEXT = 5254u32, @@ -2147,7 +2220,7 @@ pub enum Capability { ImageFootprintNV = 5282u32, MeshShadingEXT = 5283u32, FragmentBarycentricKHR = 5284u32, - ComputeDerivativeGroupQuadsNV = 5288u32, + ComputeDerivativeGroupQuadsKHR = 5288u32, FragmentDensityEXT = 5291u32, GroupNonUniformPartitionedNV = 5297u32, ShaderNonUniform = 5301u32, @@ -2168,7 +2241,7 @@ pub enum Capability { VulkanMemoryModel = 5345u32, VulkanMemoryModelDeviceScope = 5346u32, PhysicalStorageBufferAddresses = 5347u32, - ComputeDerivativeGroupLinearNV = 5350u32, + ComputeDerivativeGroupLinearKHR = 5350u32, RayTracingProvisionalKHR = 5353u32, CooperativeMatrixNV = 5357u32, FragmentShaderSampleInterlockEXT = 5363u32, @@ -2181,7 +2254,20 @@ pub enum Capability { ShaderInvocationReorderNV = 5383u32, BindlessTextureNV = 5390u32, RayQueryPositionFetchKHR = 5391u32, + CooperativeVectorNV = 5394u32, + AtomicFloat16VectorNV = 5404u32, RayTracingDisplacementMicromapNV = 5409u32, + RawAccessChainsNV = 5414u32, + RayTracingSpheresGeometryNV = 5418u32, + RayTracingLinearSweptSpheresGeometryNV = 5419u32, + CooperativeMatrixReductionsNV = 5430u32, + CooperativeMatrixConversionsNV = 5431u32, + CooperativeMatrixPerElementOperationsNV = 5432u32, + CooperativeMatrixTensorAddressingNV = 5433u32, + CooperativeMatrixBlockLoadsNV = 5434u32, + CooperativeVectorTrainingNV = 5435u32, + RayTracingClusterAccelerationStructureNV = 5437u32, + TensorAddressingNV = 5439u32, SubgroupShuffleINTEL = 5568u32, SubgroupBufferBlockIOINTEL = 5569u32, SubgroupImageBlockIOINTEL = 5570u32, @@ -2230,24 +2316,35 @@ pub enum Capability { DotProduct = 6019u32, RayCullMaskKHR = 6020u32, CooperativeMatrixKHR = 6022u32, + ReplicatedCompositesEXT = 6024u32, BitInstructions = 6025u32, GroupNonUniformRotateKHR = 6026u32, + FloatControls2 = 6029u32, AtomicFloat32AddEXT = 6033u32, AtomicFloat64AddEXT = 6034u32, - LongConstantCompositeINTEL = 6089u32, - OptNoneINTEL = 6094u32, + LongCompositesINTEL = 6089u32, + OptNoneEXT = 6094u32, AtomicFloat16AddEXT = 6095u32, DebugInfoModuleINTEL = 6114u32, BFloat16ConversionINTEL = 6115u32, SplitBarrierINTEL = 6141u32, - GlobalVariableFPGADecorationsINTEL = 6146u32, + ArithmeticFenceEXT = 6144u32, + FPGAClusterAttributesV2INTEL = 6150u32, FPGAKernelAttributesv2INTEL = 6161u32, - GlobalVariableHostAccessINTEL = 6167u32, FPMaxErrorINTEL = 6169u32, FPGALatencyControlINTEL = 6171u32, FPGAArgumentInterfacesINTEL = 6174u32, + GlobalVariableHostAccessINTEL = 6187u32, + GlobalVariableFPGADecorationsINTEL = 6189u32, + SubgroupBufferPrefetchINTEL = 6220u32, + Subgroup2DBlockIOINTEL = 6228u32, + Subgroup2DBlockTransformINTEL = 6229u32, + Subgroup2DBlockTransposeINTEL = 6230u32, + SubgroupMatrixMultiplyAccumulateINTEL = 6236u32, GroupUniformArithmeticKHR = 6400u32, + MaskedGatherScatterINTEL = 6427u32, CacheControlsINTEL = 6441u32, + RegisterLimitsINTEL = 6460u32, } impl Capability { pub fn from_u32(n: u32) -> Option<Self> { @@ -2256,6 +2353,7 @@ impl Capability { 17u32..=25u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 27u32..=71u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4165u32..=4168u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 4201u32 => unsafe { core::mem::transmute::<u32, Capability>(4201u32) }, 4422u32..=4423u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4427u32..=4431u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4433u32..=4437u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, @@ -2264,14 +2362,16 @@ impl Capability { 4445u32 => unsafe { core::mem::transmute::<u32, Capability>(4445u32) }, 4447u32..=4450u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4464u32..=4468u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, - 4471u32..=4472u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 4471u32..=4473u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4478u32..=4479u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 4484u32..=4486u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 4498u32 => unsafe { core::mem::transmute::<u32, Capability>(4498u32) }, 5008u32..=5010u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 5013u32 => unsafe { core::mem::transmute::<u32, Capability>(5013u32) }, 5015u32..=5016u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 5055u32 => unsafe { core::mem::transmute::<u32, Capability>(5055u32) }, 5067u32 => unsafe { core::mem::transmute::<u32, Capability>(5067u32) }, + 5087u32 => unsafe { core::mem::transmute::<u32, Capability>(5087u32) }, 5249u32 => unsafe { core::mem::transmute::<u32, Capability>(5249u32) }, 5251u32 => unsafe { core::mem::transmute::<u32, Capability>(5251u32) }, 5254u32..=5255u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, @@ -2293,7 +2393,14 @@ impl Capability { 5378u32..=5381u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 5383u32 => unsafe { core::mem::transmute::<u32, Capability>(5383u32) }, 5390u32..=5391u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 5394u32 => unsafe { core::mem::transmute::<u32, Capability>(5394u32) }, + 5404u32 => unsafe { core::mem::transmute::<u32, Capability>(5404u32) }, 5409u32 => unsafe { core::mem::transmute::<u32, Capability>(5409u32) }, + 5414u32 => unsafe { core::mem::transmute::<u32, Capability>(5414u32) }, + 5418u32..=5419u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 5430u32..=5435u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 5437u32 => unsafe { core::mem::transmute::<u32, Capability>(5437u32) }, + 5439u32 => unsafe { core::mem::transmute::<u32, Capability>(5439u32) }, 5568u32..=5570u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 5579u32 => unsafe { core::mem::transmute::<u32, Capability>(5579u32) }, 5582u32..=5584u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, @@ -2327,20 +2434,28 @@ impl Capability { 5948u32 => unsafe { core::mem::transmute::<u32, Capability>(5948u32) }, 6016u32..=6020u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 6022u32 => unsafe { core::mem::transmute::<u32, Capability>(6022u32) }, - 6025u32..=6026u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 6024u32..=6026u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 6029u32 => unsafe { core::mem::transmute::<u32, Capability>(6029u32) }, 6033u32..=6034u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 6089u32 => unsafe { core::mem::transmute::<u32, Capability>(6089u32) }, 6094u32..=6095u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 6114u32..=6115u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, 6141u32 => unsafe { core::mem::transmute::<u32, Capability>(6141u32) }, - 6146u32 => unsafe { core::mem::transmute::<u32, Capability>(6146u32) }, + 6144u32 => unsafe { core::mem::transmute::<u32, Capability>(6144u32) }, + 6150u32 => unsafe { core::mem::transmute::<u32, Capability>(6150u32) }, 6161u32 => unsafe { core::mem::transmute::<u32, Capability>(6161u32) }, - 6167u32 => unsafe { core::mem::transmute::<u32, Capability>(6167u32) }, 6169u32 => unsafe { core::mem::transmute::<u32, Capability>(6169u32) }, 6171u32 => unsafe { core::mem::transmute::<u32, Capability>(6171u32) }, 6174u32 => unsafe { core::mem::transmute::<u32, Capability>(6174u32) }, + 6187u32 => unsafe { core::mem::transmute::<u32, Capability>(6187u32) }, + 6189u32 => unsafe { core::mem::transmute::<u32, Capability>(6189u32) }, + 6220u32 => unsafe { core::mem::transmute::<u32, Capability>(6220u32) }, + 6228u32..=6230u32 => unsafe { core::mem::transmute::<u32, Capability>(n) }, + 6236u32 => unsafe { core::mem::transmute::<u32, Capability>(6236u32) }, 6400u32 => unsafe { core::mem::transmute::<u32, Capability>(6400u32) }, + 6427u32 => unsafe { core::mem::transmute::<u32, Capability>(6427u32) }, 6441u32 => unsafe { core::mem::transmute::<u32, Capability>(6441u32) }, + 6460u32 => unsafe { core::mem::transmute::<u32, Capability>(6460u32) }, _ => return None, }) } @@ -2351,6 +2466,7 @@ impl Capability { pub const StorageUniform16: Self = Self::UniformAndStorageBuffer16BitAccess; pub const ShaderViewportIndexLayerNV: Self = Self::ShaderViewportIndexLayerEXT; pub const FragmentBarycentricNV: Self = Self::FragmentBarycentricKHR; + pub const ComputeDerivativeGroupQuadsNV: Self = Self::ComputeDerivativeGroupQuadsKHR; pub const ShadingRateNV: Self = Self::FragmentDensityEXT; pub const ShaderNonUniformEXT: Self = Self::ShaderNonUniform; pub const RuntimeDescriptorArrayEXT: Self = Self::RuntimeDescriptorArray; @@ -2377,317 +2493,336 @@ impl Capability { pub const VulkanMemoryModelKHR: Self = Self::VulkanMemoryModel; pub const VulkanMemoryModelDeviceScopeKHR: Self = Self::VulkanMemoryModelDeviceScope; pub const PhysicalStorageBufferAddressesEXT: Self = Self::PhysicalStorageBufferAddresses; + pub const ComputeDerivativeGroupLinearNV: Self = Self::ComputeDerivativeGroupLinearKHR; pub const DemoteToHelperInvocationEXT: Self = Self::DemoteToHelperInvocation; pub const DotProductInputAllKHR: Self = Self::DotProductInputAll; pub const DotProductInput4x8BitKHR: Self = Self::DotProductInput4x8Bit; pub const DotProductInput4x8BitPackedKHR: Self = Self::DotProductInput4x8BitPacked; pub const DotProductKHR: Self = Self::DotProduct; + pub const OptNoneINTEL: Self = Self::OptNoneEXT; } impl core::str::FromStr for Capability { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "Matrix" => Ok(Self::Matrix), - "Shader" => Ok(Self::Shader), - "Geometry" => Ok(Self::Geometry), - "Tessellation" => Ok(Self::Tessellation), - "Addresses" => Ok(Self::Addresses), - "Linkage" => Ok(Self::Linkage), - "Kernel" => Ok(Self::Kernel), - "Vector16" => Ok(Self::Vector16), - "Float16Buffer" => Ok(Self::Float16Buffer), - "Float16" => Ok(Self::Float16), - "Float64" => Ok(Self::Float64), - "Int64" => Ok(Self::Int64), - "Int64Atomics" => Ok(Self::Int64Atomics), - "ImageBasic" => Ok(Self::ImageBasic), - "ImageReadWrite" => Ok(Self::ImageReadWrite), - "ImageMipmap" => Ok(Self::ImageMipmap), - "Pipes" => Ok(Self::Pipes), - "Groups" => Ok(Self::Groups), - "DeviceEnqueue" => Ok(Self::DeviceEnqueue), - "LiteralSampler" => Ok(Self::LiteralSampler), - "AtomicStorage" => Ok(Self::AtomicStorage), - "Int16" => Ok(Self::Int16), - "TessellationPointSize" => Ok(Self::TessellationPointSize), - "GeometryPointSize" => Ok(Self::GeometryPointSize), - "ImageGatherExtended" => Ok(Self::ImageGatherExtended), - "StorageImageMultisample" => Ok(Self::StorageImageMultisample), - "UniformBufferArrayDynamicIndexing" => Ok(Self::UniformBufferArrayDynamicIndexing), - "SampledImageArrayDynamicIndexing" => Ok(Self::SampledImageArrayDynamicIndexing), - "StorageBufferArrayDynamicIndexing" => Ok(Self::StorageBufferArrayDynamicIndexing), - "StorageImageArrayDynamicIndexing" => Ok(Self::StorageImageArrayDynamicIndexing), - "ClipDistance" => Ok(Self::ClipDistance), - "CullDistance" => Ok(Self::CullDistance), - "ImageCubeArray" => Ok(Self::ImageCubeArray), - "SampleRateShading" => Ok(Self::SampleRateShading), - "ImageRect" => Ok(Self::ImageRect), - "SampledRect" => Ok(Self::SampledRect), - "GenericPointer" => Ok(Self::GenericPointer), - "Int8" => Ok(Self::Int8), - "InputAttachment" => Ok(Self::InputAttachment), - "SparseResidency" => Ok(Self::SparseResidency), - "MinLod" => Ok(Self::MinLod), - "Sampled1D" => Ok(Self::Sampled1D), - "Image1D" => Ok(Self::Image1D), - "SampledCubeArray" => Ok(Self::SampledCubeArray), - "SampledBuffer" => Ok(Self::SampledBuffer), - "ImageBuffer" => Ok(Self::ImageBuffer), - "ImageMSArray" => Ok(Self::ImageMSArray), - "StorageImageExtendedFormats" => Ok(Self::StorageImageExtendedFormats), - "ImageQuery" => Ok(Self::ImageQuery), - "DerivativeControl" => Ok(Self::DerivativeControl), - "InterpolationFunction" => Ok(Self::InterpolationFunction), - "TransformFeedback" => Ok(Self::TransformFeedback), - "GeometryStreams" => Ok(Self::GeometryStreams), - "StorageImageReadWithoutFormat" => Ok(Self::StorageImageReadWithoutFormat), - "StorageImageWriteWithoutFormat" => Ok(Self::StorageImageWriteWithoutFormat), - "MultiViewport" => Ok(Self::MultiViewport), - "SubgroupDispatch" => Ok(Self::SubgroupDispatch), - "NamedBarrier" => Ok(Self::NamedBarrier), - "PipeStorage" => Ok(Self::PipeStorage), - "GroupNonUniform" => Ok(Self::GroupNonUniform), - "GroupNonUniformVote" => Ok(Self::GroupNonUniformVote), - "GroupNonUniformArithmetic" => Ok(Self::GroupNonUniformArithmetic), - "GroupNonUniformBallot" => Ok(Self::GroupNonUniformBallot), - "GroupNonUniformShuffle" => Ok(Self::GroupNonUniformShuffle), - "GroupNonUniformShuffleRelative" => Ok(Self::GroupNonUniformShuffleRelative), - "GroupNonUniformClustered" => Ok(Self::GroupNonUniformClustered), - "GroupNonUniformQuad" => Ok(Self::GroupNonUniformQuad), - "ShaderLayer" => Ok(Self::ShaderLayer), - "ShaderViewportIndex" => Ok(Self::ShaderViewportIndex), - "UniformDecoration" => Ok(Self::UniformDecoration), - "CoreBuiltinsARM" => Ok(Self::CoreBuiltinsARM), - "TileImageColorReadAccessEXT" => Ok(Self::TileImageColorReadAccessEXT), - "TileImageDepthReadAccessEXT" => Ok(Self::TileImageDepthReadAccessEXT), - "TileImageStencilReadAccessEXT" => Ok(Self::TileImageStencilReadAccessEXT), - "FragmentShadingRateKHR" => Ok(Self::FragmentShadingRateKHR), - "SubgroupBallotKHR" => Ok(Self::SubgroupBallotKHR), - "DrawParameters" => Ok(Self::DrawParameters), - "WorkgroupMemoryExplicitLayoutKHR" => Ok(Self::WorkgroupMemoryExplicitLayoutKHR), + Ok(match s { + "Matrix" => Self::Matrix, + "Shader" => Self::Shader, + "Geometry" => Self::Geometry, + "Tessellation" => Self::Tessellation, + "Addresses" => Self::Addresses, + "Linkage" => Self::Linkage, + "Kernel" => Self::Kernel, + "Vector16" => Self::Vector16, + "Float16Buffer" => Self::Float16Buffer, + "Float16" => Self::Float16, + "Float64" => Self::Float64, + "Int64" => Self::Int64, + "Int64Atomics" => Self::Int64Atomics, + "ImageBasic" => Self::ImageBasic, + "ImageReadWrite" => Self::ImageReadWrite, + "ImageMipmap" => Self::ImageMipmap, + "Pipes" => Self::Pipes, + "Groups" => Self::Groups, + "DeviceEnqueue" => Self::DeviceEnqueue, + "LiteralSampler" => Self::LiteralSampler, + "AtomicStorage" => Self::AtomicStorage, + "Int16" => Self::Int16, + "TessellationPointSize" => Self::TessellationPointSize, + "GeometryPointSize" => Self::GeometryPointSize, + "ImageGatherExtended" => Self::ImageGatherExtended, + "StorageImageMultisample" => Self::StorageImageMultisample, + "UniformBufferArrayDynamicIndexing" => Self::UniformBufferArrayDynamicIndexing, + "SampledImageArrayDynamicIndexing" => Self::SampledImageArrayDynamicIndexing, + "StorageBufferArrayDynamicIndexing" => Self::StorageBufferArrayDynamicIndexing, + "StorageImageArrayDynamicIndexing" => Self::StorageImageArrayDynamicIndexing, + "ClipDistance" => Self::ClipDistance, + "CullDistance" => Self::CullDistance, + "ImageCubeArray" => Self::ImageCubeArray, + "SampleRateShading" => Self::SampleRateShading, + "ImageRect" => Self::ImageRect, + "SampledRect" => Self::SampledRect, + "GenericPointer" => Self::GenericPointer, + "Int8" => Self::Int8, + "InputAttachment" => Self::InputAttachment, + "SparseResidency" => Self::SparseResidency, + "MinLod" => Self::MinLod, + "Sampled1D" => Self::Sampled1D, + "Image1D" => Self::Image1D, + "SampledCubeArray" => Self::SampledCubeArray, + "SampledBuffer" => Self::SampledBuffer, + "ImageBuffer" => Self::ImageBuffer, + "ImageMSArray" => Self::ImageMSArray, + "StorageImageExtendedFormats" => Self::StorageImageExtendedFormats, + "ImageQuery" => Self::ImageQuery, + "DerivativeControl" => Self::DerivativeControl, + "InterpolationFunction" => Self::InterpolationFunction, + "TransformFeedback" => Self::TransformFeedback, + "GeometryStreams" => Self::GeometryStreams, + "StorageImageReadWithoutFormat" => Self::StorageImageReadWithoutFormat, + "StorageImageWriteWithoutFormat" => Self::StorageImageWriteWithoutFormat, + "MultiViewport" => Self::MultiViewport, + "SubgroupDispatch" => Self::SubgroupDispatch, + "NamedBarrier" => Self::NamedBarrier, + "PipeStorage" => Self::PipeStorage, + "GroupNonUniform" => Self::GroupNonUniform, + "GroupNonUniformVote" => Self::GroupNonUniformVote, + "GroupNonUniformArithmetic" => Self::GroupNonUniformArithmetic, + "GroupNonUniformBallot" => Self::GroupNonUniformBallot, + "GroupNonUniformShuffle" => Self::GroupNonUniformShuffle, + "GroupNonUniformShuffleRelative" => Self::GroupNonUniformShuffleRelative, + "GroupNonUniformClustered" => Self::GroupNonUniformClustered, + "GroupNonUniformQuad" => Self::GroupNonUniformQuad, + "ShaderLayer" => Self::ShaderLayer, + "ShaderViewportIndex" => Self::ShaderViewportIndex, + "UniformDecoration" => Self::UniformDecoration, + "CoreBuiltinsARM" => Self::CoreBuiltinsARM, + "TileImageColorReadAccessEXT" => Self::TileImageColorReadAccessEXT, + "TileImageDepthReadAccessEXT" => Self::TileImageDepthReadAccessEXT, + "TileImageStencilReadAccessEXT" => Self::TileImageStencilReadAccessEXT, + "CooperativeMatrixLayoutsARM" => Self::CooperativeMatrixLayoutsARM, + "FragmentShadingRateKHR" => Self::FragmentShadingRateKHR, + "SubgroupBallotKHR" => Self::SubgroupBallotKHR, + "DrawParameters" => Self::DrawParameters, + "WorkgroupMemoryExplicitLayoutKHR" => Self::WorkgroupMemoryExplicitLayoutKHR, "WorkgroupMemoryExplicitLayout8BitAccessKHR" => { - Ok(Self::WorkgroupMemoryExplicitLayout8BitAccessKHR) + Self::WorkgroupMemoryExplicitLayout8BitAccessKHR } "WorkgroupMemoryExplicitLayout16BitAccessKHR" => { - Ok(Self::WorkgroupMemoryExplicitLayout16BitAccessKHR) - } - "SubgroupVoteKHR" => Ok(Self::SubgroupVoteKHR), - "StorageBuffer16BitAccess" => Ok(Self::StorageBuffer16BitAccess), - "StorageUniformBufferBlock16" => Ok(Self::StorageBuffer16BitAccess), - "UniformAndStorageBuffer16BitAccess" => Ok(Self::UniformAndStorageBuffer16BitAccess), - "StorageUniform16" => Ok(Self::UniformAndStorageBuffer16BitAccess), - "StoragePushConstant16" => Ok(Self::StoragePushConstant16), - "StorageInputOutput16" => Ok(Self::StorageInputOutput16), - "DeviceGroup" => Ok(Self::DeviceGroup), - "MultiView" => Ok(Self::MultiView), - "VariablePointersStorageBuffer" => Ok(Self::VariablePointersStorageBuffer), - "VariablePointers" => Ok(Self::VariablePointers), - "AtomicStorageOps" => Ok(Self::AtomicStorageOps), - "SampleMaskPostDepthCoverage" => Ok(Self::SampleMaskPostDepthCoverage), - "StorageBuffer8BitAccess" => Ok(Self::StorageBuffer8BitAccess), - "UniformAndStorageBuffer8BitAccess" => Ok(Self::UniformAndStorageBuffer8BitAccess), - "StoragePushConstant8" => Ok(Self::StoragePushConstant8), - "DenormPreserve" => Ok(Self::DenormPreserve), - "DenormFlushToZero" => Ok(Self::DenormFlushToZero), - "SignedZeroInfNanPreserve" => Ok(Self::SignedZeroInfNanPreserve), - "RoundingModeRTE" => Ok(Self::RoundingModeRTE), - "RoundingModeRTZ" => Ok(Self::RoundingModeRTZ), - "RayQueryProvisionalKHR" => Ok(Self::RayQueryProvisionalKHR), - "RayQueryKHR" => Ok(Self::RayQueryKHR), - "RayTraversalPrimitiveCullingKHR" => Ok(Self::RayTraversalPrimitiveCullingKHR), - "RayTracingKHR" => Ok(Self::RayTracingKHR), - "TextureSampleWeightedQCOM" => Ok(Self::TextureSampleWeightedQCOM), - "TextureBoxFilterQCOM" => Ok(Self::TextureBoxFilterQCOM), - "TextureBlockMatchQCOM" => Ok(Self::TextureBlockMatchQCOM), - "Float16ImageAMD" => Ok(Self::Float16ImageAMD), - "ImageGatherBiasLodAMD" => Ok(Self::ImageGatherBiasLodAMD), - "FragmentMaskAMD" => Ok(Self::FragmentMaskAMD), - "StencilExportEXT" => Ok(Self::StencilExportEXT), - "ImageReadWriteLodAMD" => Ok(Self::ImageReadWriteLodAMD), - "Int64ImageEXT" => Ok(Self::Int64ImageEXT), - "ShaderClockKHR" => Ok(Self::ShaderClockKHR), - "ShaderEnqueueAMDX" => Ok(Self::ShaderEnqueueAMDX), - "SampleMaskOverrideCoverageNV" => Ok(Self::SampleMaskOverrideCoverageNV), - "GeometryShaderPassthroughNV" => Ok(Self::GeometryShaderPassthroughNV), - "ShaderViewportIndexLayerEXT" => Ok(Self::ShaderViewportIndexLayerEXT), - "ShaderViewportIndexLayerNV" => Ok(Self::ShaderViewportIndexLayerEXT), - "ShaderViewportMaskNV" => Ok(Self::ShaderViewportMaskNV), - "ShaderStereoViewNV" => Ok(Self::ShaderStereoViewNV), - "PerViewAttributesNV" => Ok(Self::PerViewAttributesNV), - "FragmentFullyCoveredEXT" => Ok(Self::FragmentFullyCoveredEXT), - "MeshShadingNV" => Ok(Self::MeshShadingNV), - "ImageFootprintNV" => Ok(Self::ImageFootprintNV), - "MeshShadingEXT" => Ok(Self::MeshShadingEXT), - "FragmentBarycentricKHR" => Ok(Self::FragmentBarycentricKHR), - "FragmentBarycentricNV" => Ok(Self::FragmentBarycentricKHR), - "ComputeDerivativeGroupQuadsNV" => Ok(Self::ComputeDerivativeGroupQuadsNV), - "FragmentDensityEXT" => Ok(Self::FragmentDensityEXT), - "ShadingRateNV" => Ok(Self::FragmentDensityEXT), - "GroupNonUniformPartitionedNV" => Ok(Self::GroupNonUniformPartitionedNV), - "ShaderNonUniform" => Ok(Self::ShaderNonUniform), - "ShaderNonUniformEXT" => Ok(Self::ShaderNonUniform), - "RuntimeDescriptorArray" => Ok(Self::RuntimeDescriptorArray), - "RuntimeDescriptorArrayEXT" => Ok(Self::RuntimeDescriptorArray), - "InputAttachmentArrayDynamicIndexing" => Ok(Self::InputAttachmentArrayDynamicIndexing), - "InputAttachmentArrayDynamicIndexingEXT" => { - Ok(Self::InputAttachmentArrayDynamicIndexing) + Self::WorkgroupMemoryExplicitLayout16BitAccessKHR } + "SubgroupVoteKHR" => Self::SubgroupVoteKHR, + "StorageBuffer16BitAccess" => Self::StorageBuffer16BitAccess, + "StorageUniformBufferBlock16" => Self::StorageBuffer16BitAccess, + "UniformAndStorageBuffer16BitAccess" => Self::UniformAndStorageBuffer16BitAccess, + "StorageUniform16" => Self::UniformAndStorageBuffer16BitAccess, + "StoragePushConstant16" => Self::StoragePushConstant16, + "StorageInputOutput16" => Self::StorageInputOutput16, + "DeviceGroup" => Self::DeviceGroup, + "MultiView" => Self::MultiView, + "VariablePointersStorageBuffer" => Self::VariablePointersStorageBuffer, + "VariablePointers" => Self::VariablePointers, + "AtomicStorageOps" => Self::AtomicStorageOps, + "SampleMaskPostDepthCoverage" => Self::SampleMaskPostDepthCoverage, + "StorageBuffer8BitAccess" => Self::StorageBuffer8BitAccess, + "UniformAndStorageBuffer8BitAccess" => Self::UniformAndStorageBuffer8BitAccess, + "StoragePushConstant8" => Self::StoragePushConstant8, + "DenormPreserve" => Self::DenormPreserve, + "DenormFlushToZero" => Self::DenormFlushToZero, + "SignedZeroInfNanPreserve" => Self::SignedZeroInfNanPreserve, + "RoundingModeRTE" => Self::RoundingModeRTE, + "RoundingModeRTZ" => Self::RoundingModeRTZ, + "RayQueryProvisionalKHR" => Self::RayQueryProvisionalKHR, + "RayQueryKHR" => Self::RayQueryKHR, + "UntypedPointersKHR" => Self::UntypedPointersKHR, + "RayTraversalPrimitiveCullingKHR" => Self::RayTraversalPrimitiveCullingKHR, + "RayTracingKHR" => Self::RayTracingKHR, + "TextureSampleWeightedQCOM" => Self::TextureSampleWeightedQCOM, + "TextureBoxFilterQCOM" => Self::TextureBoxFilterQCOM, + "TextureBlockMatchQCOM" => Self::TextureBlockMatchQCOM, + "TextureBlockMatch2QCOM" => Self::TextureBlockMatch2QCOM, + "Float16ImageAMD" => Self::Float16ImageAMD, + "ImageGatherBiasLodAMD" => Self::ImageGatherBiasLodAMD, + "FragmentMaskAMD" => Self::FragmentMaskAMD, + "StencilExportEXT" => Self::StencilExportEXT, + "ImageReadWriteLodAMD" => Self::ImageReadWriteLodAMD, + "Int64ImageEXT" => Self::Int64ImageEXT, + "ShaderClockKHR" => Self::ShaderClockKHR, + "ShaderEnqueueAMDX" => Self::ShaderEnqueueAMDX, + "QuadControlKHR" => Self::QuadControlKHR, + "SampleMaskOverrideCoverageNV" => Self::SampleMaskOverrideCoverageNV, + "GeometryShaderPassthroughNV" => Self::GeometryShaderPassthroughNV, + "ShaderViewportIndexLayerEXT" => Self::ShaderViewportIndexLayerEXT, + "ShaderViewportIndexLayerNV" => Self::ShaderViewportIndexLayerEXT, + "ShaderViewportMaskNV" => Self::ShaderViewportMaskNV, + "ShaderStereoViewNV" => Self::ShaderStereoViewNV, + "PerViewAttributesNV" => Self::PerViewAttributesNV, + "FragmentFullyCoveredEXT" => Self::FragmentFullyCoveredEXT, + "MeshShadingNV" => Self::MeshShadingNV, + "ImageFootprintNV" => Self::ImageFootprintNV, + "MeshShadingEXT" => Self::MeshShadingEXT, + "FragmentBarycentricKHR" => Self::FragmentBarycentricKHR, + "FragmentBarycentricNV" => Self::FragmentBarycentricKHR, + "ComputeDerivativeGroupQuadsKHR" => Self::ComputeDerivativeGroupQuadsKHR, + "ComputeDerivativeGroupQuadsNV" => Self::ComputeDerivativeGroupQuadsKHR, + "FragmentDensityEXT" => Self::FragmentDensityEXT, + "ShadingRateNV" => Self::FragmentDensityEXT, + "GroupNonUniformPartitionedNV" => Self::GroupNonUniformPartitionedNV, + "ShaderNonUniform" => Self::ShaderNonUniform, + "ShaderNonUniformEXT" => Self::ShaderNonUniform, + "RuntimeDescriptorArray" => Self::RuntimeDescriptorArray, + "RuntimeDescriptorArrayEXT" => Self::RuntimeDescriptorArray, + "InputAttachmentArrayDynamicIndexing" => Self::InputAttachmentArrayDynamicIndexing, + "InputAttachmentArrayDynamicIndexingEXT" => Self::InputAttachmentArrayDynamicIndexing, "UniformTexelBufferArrayDynamicIndexing" => { - Ok(Self::UniformTexelBufferArrayDynamicIndexing) + Self::UniformTexelBufferArrayDynamicIndexing } "UniformTexelBufferArrayDynamicIndexingEXT" => { - Ok(Self::UniformTexelBufferArrayDynamicIndexing) + Self::UniformTexelBufferArrayDynamicIndexing } "StorageTexelBufferArrayDynamicIndexing" => { - Ok(Self::StorageTexelBufferArrayDynamicIndexing) + Self::StorageTexelBufferArrayDynamicIndexing } "StorageTexelBufferArrayDynamicIndexingEXT" => { - Ok(Self::StorageTexelBufferArrayDynamicIndexing) - } - "UniformBufferArrayNonUniformIndexing" => { - Ok(Self::UniformBufferArrayNonUniformIndexing) - } - "UniformBufferArrayNonUniformIndexingEXT" => { - Ok(Self::UniformBufferArrayNonUniformIndexing) - } - "SampledImageArrayNonUniformIndexing" => Ok(Self::SampledImageArrayNonUniformIndexing), - "SampledImageArrayNonUniformIndexingEXT" => { - Ok(Self::SampledImageArrayNonUniformIndexing) - } - "StorageBufferArrayNonUniformIndexing" => { - Ok(Self::StorageBufferArrayNonUniformIndexing) - } - "StorageBufferArrayNonUniformIndexingEXT" => { - Ok(Self::StorageBufferArrayNonUniformIndexing) - } - "StorageImageArrayNonUniformIndexing" => Ok(Self::StorageImageArrayNonUniformIndexing), - "StorageImageArrayNonUniformIndexingEXT" => { - Ok(Self::StorageImageArrayNonUniformIndexing) + Self::StorageTexelBufferArrayDynamicIndexing } + "UniformBufferArrayNonUniformIndexing" => Self::UniformBufferArrayNonUniformIndexing, + "UniformBufferArrayNonUniformIndexingEXT" => Self::UniformBufferArrayNonUniformIndexing, + "SampledImageArrayNonUniformIndexing" => Self::SampledImageArrayNonUniformIndexing, + "SampledImageArrayNonUniformIndexingEXT" => Self::SampledImageArrayNonUniformIndexing, + "StorageBufferArrayNonUniformIndexing" => Self::StorageBufferArrayNonUniformIndexing, + "StorageBufferArrayNonUniformIndexingEXT" => Self::StorageBufferArrayNonUniformIndexing, + "StorageImageArrayNonUniformIndexing" => Self::StorageImageArrayNonUniformIndexing, + "StorageImageArrayNonUniformIndexingEXT" => Self::StorageImageArrayNonUniformIndexing, "InputAttachmentArrayNonUniformIndexing" => { - Ok(Self::InputAttachmentArrayNonUniformIndexing) + Self::InputAttachmentArrayNonUniformIndexing } "InputAttachmentArrayNonUniformIndexingEXT" => { - Ok(Self::InputAttachmentArrayNonUniformIndexing) + Self::InputAttachmentArrayNonUniformIndexing } "UniformTexelBufferArrayNonUniformIndexing" => { - Ok(Self::UniformTexelBufferArrayNonUniformIndexing) + Self::UniformTexelBufferArrayNonUniformIndexing } "UniformTexelBufferArrayNonUniformIndexingEXT" => { - Ok(Self::UniformTexelBufferArrayNonUniformIndexing) + Self::UniformTexelBufferArrayNonUniformIndexing } "StorageTexelBufferArrayNonUniformIndexing" => { - Ok(Self::StorageTexelBufferArrayNonUniformIndexing) + Self::StorageTexelBufferArrayNonUniformIndexing } "StorageTexelBufferArrayNonUniformIndexingEXT" => { - Ok(Self::StorageTexelBufferArrayNonUniformIndexing) + Self::StorageTexelBufferArrayNonUniformIndexing } - "RayTracingPositionFetchKHR" => Ok(Self::RayTracingPositionFetchKHR), - "RayTracingNV" => Ok(Self::RayTracingNV), - "RayTracingMotionBlurNV" => Ok(Self::RayTracingMotionBlurNV), - "VulkanMemoryModel" => Ok(Self::VulkanMemoryModel), - "VulkanMemoryModelKHR" => Ok(Self::VulkanMemoryModel), - "VulkanMemoryModelDeviceScope" => Ok(Self::VulkanMemoryModelDeviceScope), - "VulkanMemoryModelDeviceScopeKHR" => Ok(Self::VulkanMemoryModelDeviceScope), - "PhysicalStorageBufferAddresses" => Ok(Self::PhysicalStorageBufferAddresses), - "PhysicalStorageBufferAddressesEXT" => Ok(Self::PhysicalStorageBufferAddresses), - "ComputeDerivativeGroupLinearNV" => Ok(Self::ComputeDerivativeGroupLinearNV), - "RayTracingProvisionalKHR" => Ok(Self::RayTracingProvisionalKHR), - "CooperativeMatrixNV" => Ok(Self::CooperativeMatrixNV), - "FragmentShaderSampleInterlockEXT" => Ok(Self::FragmentShaderSampleInterlockEXT), - "FragmentShaderShadingRateInterlockEXT" => { - Ok(Self::FragmentShaderShadingRateInterlockEXT) + "RayTracingPositionFetchKHR" => Self::RayTracingPositionFetchKHR, + "RayTracingNV" => Self::RayTracingNV, + "RayTracingMotionBlurNV" => Self::RayTracingMotionBlurNV, + "VulkanMemoryModel" => Self::VulkanMemoryModel, + "VulkanMemoryModelKHR" => Self::VulkanMemoryModel, + "VulkanMemoryModelDeviceScope" => Self::VulkanMemoryModelDeviceScope, + "VulkanMemoryModelDeviceScopeKHR" => Self::VulkanMemoryModelDeviceScope, + "PhysicalStorageBufferAddresses" => Self::PhysicalStorageBufferAddresses, + "PhysicalStorageBufferAddressesEXT" => Self::PhysicalStorageBufferAddresses, + "ComputeDerivativeGroupLinearKHR" => Self::ComputeDerivativeGroupLinearKHR, + "ComputeDerivativeGroupLinearNV" => Self::ComputeDerivativeGroupLinearKHR, + "RayTracingProvisionalKHR" => Self::RayTracingProvisionalKHR, + "CooperativeMatrixNV" => Self::CooperativeMatrixNV, + "FragmentShaderSampleInterlockEXT" => Self::FragmentShaderSampleInterlockEXT, + "FragmentShaderShadingRateInterlockEXT" => Self::FragmentShaderShadingRateInterlockEXT, + "ShaderSMBuiltinsNV" => Self::ShaderSMBuiltinsNV, + "FragmentShaderPixelInterlockEXT" => Self::FragmentShaderPixelInterlockEXT, + "DemoteToHelperInvocation" => Self::DemoteToHelperInvocation, + "DemoteToHelperInvocationEXT" => Self::DemoteToHelperInvocation, + "DisplacementMicromapNV" => Self::DisplacementMicromapNV, + "RayTracingOpacityMicromapEXT" => Self::RayTracingOpacityMicromapEXT, + "ShaderInvocationReorderNV" => Self::ShaderInvocationReorderNV, + "BindlessTextureNV" => Self::BindlessTextureNV, + "RayQueryPositionFetchKHR" => Self::RayQueryPositionFetchKHR, + "CooperativeVectorNV" => Self::CooperativeVectorNV, + "AtomicFloat16VectorNV" => Self::AtomicFloat16VectorNV, + "RayTracingDisplacementMicromapNV" => Self::RayTracingDisplacementMicromapNV, + "RawAccessChainsNV" => Self::RawAccessChainsNV, + "RayTracingSpheresGeometryNV" => Self::RayTracingSpheresGeometryNV, + "RayTracingLinearSweptSpheresGeometryNV" => { + Self::RayTracingLinearSweptSpheresGeometryNV } - "ShaderSMBuiltinsNV" => Ok(Self::ShaderSMBuiltinsNV), - "FragmentShaderPixelInterlockEXT" => Ok(Self::FragmentShaderPixelInterlockEXT), - "DemoteToHelperInvocation" => Ok(Self::DemoteToHelperInvocation), - "DemoteToHelperInvocationEXT" => Ok(Self::DemoteToHelperInvocation), - "DisplacementMicromapNV" => Ok(Self::DisplacementMicromapNV), - "RayTracingOpacityMicromapEXT" => Ok(Self::RayTracingOpacityMicromapEXT), - "ShaderInvocationReorderNV" => Ok(Self::ShaderInvocationReorderNV), - "BindlessTextureNV" => Ok(Self::BindlessTextureNV), - "RayQueryPositionFetchKHR" => Ok(Self::RayQueryPositionFetchKHR), - "RayTracingDisplacementMicromapNV" => Ok(Self::RayTracingDisplacementMicromapNV), - "SubgroupShuffleINTEL" => Ok(Self::SubgroupShuffleINTEL), - "SubgroupBufferBlockIOINTEL" => Ok(Self::SubgroupBufferBlockIOINTEL), - "SubgroupImageBlockIOINTEL" => Ok(Self::SubgroupImageBlockIOINTEL), - "SubgroupImageMediaBlockIOINTEL" => Ok(Self::SubgroupImageMediaBlockIOINTEL), - "RoundToInfinityINTEL" => Ok(Self::RoundToInfinityINTEL), - "FloatingPointModeINTEL" => Ok(Self::FloatingPointModeINTEL), - "IntegerFunctions2INTEL" => Ok(Self::IntegerFunctions2INTEL), - "FunctionPointersINTEL" => Ok(Self::FunctionPointersINTEL), - "IndirectReferencesINTEL" => Ok(Self::IndirectReferencesINTEL), - "AsmINTEL" => Ok(Self::AsmINTEL), - "AtomicFloat32MinMaxEXT" => Ok(Self::AtomicFloat32MinMaxEXT), - "AtomicFloat64MinMaxEXT" => Ok(Self::AtomicFloat64MinMaxEXT), - "AtomicFloat16MinMaxEXT" => Ok(Self::AtomicFloat16MinMaxEXT), - "VectorComputeINTEL" => Ok(Self::VectorComputeINTEL), - "VectorAnyINTEL" => Ok(Self::VectorAnyINTEL), - "ExpectAssumeKHR" => Ok(Self::ExpectAssumeKHR), - "SubgroupAvcMotionEstimationINTEL" => Ok(Self::SubgroupAvcMotionEstimationINTEL), - "SubgroupAvcMotionEstimationIntraINTEL" => { - Ok(Self::SubgroupAvcMotionEstimationIntraINTEL) + "CooperativeMatrixReductionsNV" => Self::CooperativeMatrixReductionsNV, + "CooperativeMatrixConversionsNV" => Self::CooperativeMatrixConversionsNV, + "CooperativeMatrixPerElementOperationsNV" => { + Self::CooperativeMatrixPerElementOperationsNV } - "SubgroupAvcMotionEstimationChromaINTEL" => { - Ok(Self::SubgroupAvcMotionEstimationChromaINTEL) + "CooperativeMatrixTensorAddressingNV" => Self::CooperativeMatrixTensorAddressingNV, + "CooperativeMatrixBlockLoadsNV" => Self::CooperativeMatrixBlockLoadsNV, + "CooperativeVectorTrainingNV" => Self::CooperativeVectorTrainingNV, + "RayTracingClusterAccelerationStructureNV" => { + Self::RayTracingClusterAccelerationStructureNV } - "VariableLengthArrayINTEL" => Ok(Self::VariableLengthArrayINTEL), - "FunctionFloatControlINTEL" => Ok(Self::FunctionFloatControlINTEL), - "FPGAMemoryAttributesINTEL" => Ok(Self::FPGAMemoryAttributesINTEL), - "FPFastMathModeINTEL" => Ok(Self::FPFastMathModeINTEL), - "ArbitraryPrecisionIntegersINTEL" => Ok(Self::ArbitraryPrecisionIntegersINTEL), - "ArbitraryPrecisionFloatingPointINTEL" => { - Ok(Self::ArbitraryPrecisionFloatingPointINTEL) + "TensorAddressingNV" => Self::TensorAddressingNV, + "SubgroupShuffleINTEL" => Self::SubgroupShuffleINTEL, + "SubgroupBufferBlockIOINTEL" => Self::SubgroupBufferBlockIOINTEL, + "SubgroupImageBlockIOINTEL" => Self::SubgroupImageBlockIOINTEL, + "SubgroupImageMediaBlockIOINTEL" => Self::SubgroupImageMediaBlockIOINTEL, + "RoundToInfinityINTEL" => Self::RoundToInfinityINTEL, + "FloatingPointModeINTEL" => Self::FloatingPointModeINTEL, + "IntegerFunctions2INTEL" => Self::IntegerFunctions2INTEL, + "FunctionPointersINTEL" => Self::FunctionPointersINTEL, + "IndirectReferencesINTEL" => Self::IndirectReferencesINTEL, + "AsmINTEL" => Self::AsmINTEL, + "AtomicFloat32MinMaxEXT" => Self::AtomicFloat32MinMaxEXT, + "AtomicFloat64MinMaxEXT" => Self::AtomicFloat64MinMaxEXT, + "AtomicFloat16MinMaxEXT" => Self::AtomicFloat16MinMaxEXT, + "VectorComputeINTEL" => Self::VectorComputeINTEL, + "VectorAnyINTEL" => Self::VectorAnyINTEL, + "ExpectAssumeKHR" => Self::ExpectAssumeKHR, + "SubgroupAvcMotionEstimationINTEL" => Self::SubgroupAvcMotionEstimationINTEL, + "SubgroupAvcMotionEstimationIntraINTEL" => Self::SubgroupAvcMotionEstimationIntraINTEL, + "SubgroupAvcMotionEstimationChromaINTEL" => { + Self::SubgroupAvcMotionEstimationChromaINTEL } - "UnstructuredLoopControlsINTEL" => Ok(Self::UnstructuredLoopControlsINTEL), - "FPGALoopControlsINTEL" => Ok(Self::FPGALoopControlsINTEL), - "KernelAttributesINTEL" => Ok(Self::KernelAttributesINTEL), - "FPGAKernelAttributesINTEL" => Ok(Self::FPGAKernelAttributesINTEL), - "FPGAMemoryAccessesINTEL" => Ok(Self::FPGAMemoryAccessesINTEL), - "FPGAClusterAttributesINTEL" => Ok(Self::FPGAClusterAttributesINTEL), - "LoopFuseINTEL" => Ok(Self::LoopFuseINTEL), - "FPGADSPControlINTEL" => Ok(Self::FPGADSPControlINTEL), - "MemoryAccessAliasingINTEL" => Ok(Self::MemoryAccessAliasingINTEL), + "VariableLengthArrayINTEL" => Self::VariableLengthArrayINTEL, + "FunctionFloatControlINTEL" => Self::FunctionFloatControlINTEL, + "FPGAMemoryAttributesINTEL" => Self::FPGAMemoryAttributesINTEL, + "FPFastMathModeINTEL" => Self::FPFastMathModeINTEL, + "ArbitraryPrecisionIntegersINTEL" => Self::ArbitraryPrecisionIntegersINTEL, + "ArbitraryPrecisionFloatingPointINTEL" => Self::ArbitraryPrecisionFloatingPointINTEL, + "UnstructuredLoopControlsINTEL" => Self::UnstructuredLoopControlsINTEL, + "FPGALoopControlsINTEL" => Self::FPGALoopControlsINTEL, + "KernelAttributesINTEL" => Self::KernelAttributesINTEL, + "FPGAKernelAttributesINTEL" => Self::FPGAKernelAttributesINTEL, + "FPGAMemoryAccessesINTEL" => Self::FPGAMemoryAccessesINTEL, + "FPGAClusterAttributesINTEL" => Self::FPGAClusterAttributesINTEL, + "LoopFuseINTEL" => Self::LoopFuseINTEL, + "FPGADSPControlINTEL" => Self::FPGADSPControlINTEL, + "MemoryAccessAliasingINTEL" => Self::MemoryAccessAliasingINTEL, "FPGAInvocationPipeliningAttributesINTEL" => { - Ok(Self::FPGAInvocationPipeliningAttributesINTEL) + Self::FPGAInvocationPipeliningAttributesINTEL } - "FPGABufferLocationINTEL" => Ok(Self::FPGABufferLocationINTEL), - "ArbitraryPrecisionFixedPointINTEL" => Ok(Self::ArbitraryPrecisionFixedPointINTEL), - "USMStorageClassesINTEL" => Ok(Self::USMStorageClassesINTEL), - "RuntimeAlignedAttributeINTEL" => Ok(Self::RuntimeAlignedAttributeINTEL), - "IOPipesINTEL" => Ok(Self::IOPipesINTEL), - "BlockingPipesINTEL" => Ok(Self::BlockingPipesINTEL), - "FPGARegINTEL" => Ok(Self::FPGARegINTEL), - "DotProductInputAll" => Ok(Self::DotProductInputAll), - "DotProductInputAllKHR" => Ok(Self::DotProductInputAll), - "DotProductInput4x8Bit" => Ok(Self::DotProductInput4x8Bit), - "DotProductInput4x8BitKHR" => Ok(Self::DotProductInput4x8Bit), - "DotProductInput4x8BitPacked" => Ok(Self::DotProductInput4x8BitPacked), - "DotProductInput4x8BitPackedKHR" => Ok(Self::DotProductInput4x8BitPacked), - "DotProduct" => Ok(Self::DotProduct), - "DotProductKHR" => Ok(Self::DotProduct), - "RayCullMaskKHR" => Ok(Self::RayCullMaskKHR), - "CooperativeMatrixKHR" => Ok(Self::CooperativeMatrixKHR), - "BitInstructions" => Ok(Self::BitInstructions), - "GroupNonUniformRotateKHR" => Ok(Self::GroupNonUniformRotateKHR), - "AtomicFloat32AddEXT" => Ok(Self::AtomicFloat32AddEXT), - "AtomicFloat64AddEXT" => Ok(Self::AtomicFloat64AddEXT), - "LongConstantCompositeINTEL" => Ok(Self::LongConstantCompositeINTEL), - "OptNoneINTEL" => Ok(Self::OptNoneINTEL), - "AtomicFloat16AddEXT" => Ok(Self::AtomicFloat16AddEXT), - "DebugInfoModuleINTEL" => Ok(Self::DebugInfoModuleINTEL), - "BFloat16ConversionINTEL" => Ok(Self::BFloat16ConversionINTEL), - "SplitBarrierINTEL" => Ok(Self::SplitBarrierINTEL), - "GlobalVariableFPGADecorationsINTEL" => Ok(Self::GlobalVariableFPGADecorationsINTEL), - "FPGAKernelAttributesv2INTEL" => Ok(Self::FPGAKernelAttributesv2INTEL), - "GlobalVariableHostAccessINTEL" => Ok(Self::GlobalVariableHostAccessINTEL), - "FPMaxErrorINTEL" => Ok(Self::FPMaxErrorINTEL), - "FPGALatencyControlINTEL" => Ok(Self::FPGALatencyControlINTEL), - "FPGAArgumentInterfacesINTEL" => Ok(Self::FPGAArgumentInterfacesINTEL), - "GroupUniformArithmeticKHR" => Ok(Self::GroupUniformArithmeticKHR), - "CacheControlsINTEL" => Ok(Self::CacheControlsINTEL), - _ => Err(()), - } + "FPGABufferLocationINTEL" => Self::FPGABufferLocationINTEL, + "ArbitraryPrecisionFixedPointINTEL" => Self::ArbitraryPrecisionFixedPointINTEL, + "USMStorageClassesINTEL" => Self::USMStorageClassesINTEL, + "RuntimeAlignedAttributeINTEL" => Self::RuntimeAlignedAttributeINTEL, + "IOPipesINTEL" => Self::IOPipesINTEL, + "BlockingPipesINTEL" => Self::BlockingPipesINTEL, + "FPGARegINTEL" => Self::FPGARegINTEL, + "DotProductInputAll" => Self::DotProductInputAll, + "DotProductInputAllKHR" => Self::DotProductInputAll, + "DotProductInput4x8Bit" => Self::DotProductInput4x8Bit, + "DotProductInput4x8BitKHR" => Self::DotProductInput4x8Bit, + "DotProductInput4x8BitPacked" => Self::DotProductInput4x8BitPacked, + "DotProductInput4x8BitPackedKHR" => Self::DotProductInput4x8BitPacked, + "DotProduct" => Self::DotProduct, + "DotProductKHR" => Self::DotProduct, + "RayCullMaskKHR" => Self::RayCullMaskKHR, + "CooperativeMatrixKHR" => Self::CooperativeMatrixKHR, + "ReplicatedCompositesEXT" => Self::ReplicatedCompositesEXT, + "BitInstructions" => Self::BitInstructions, + "GroupNonUniformRotateKHR" => Self::GroupNonUniformRotateKHR, + "FloatControls2" => Self::FloatControls2, + "AtomicFloat32AddEXT" => Self::AtomicFloat32AddEXT, + "AtomicFloat64AddEXT" => Self::AtomicFloat64AddEXT, + "LongCompositesINTEL" => Self::LongCompositesINTEL, + "OptNoneEXT" => Self::OptNoneEXT, + "OptNoneINTEL" => Self::OptNoneEXT, + "AtomicFloat16AddEXT" => Self::AtomicFloat16AddEXT, + "DebugInfoModuleINTEL" => Self::DebugInfoModuleINTEL, + "BFloat16ConversionINTEL" => Self::BFloat16ConversionINTEL, + "SplitBarrierINTEL" => Self::SplitBarrierINTEL, + "ArithmeticFenceEXT" => Self::ArithmeticFenceEXT, + "FPGAClusterAttributesV2INTEL" => Self::FPGAClusterAttributesV2INTEL, + "FPGAKernelAttributesv2INTEL" => Self::FPGAKernelAttributesv2INTEL, + "FPMaxErrorINTEL" => Self::FPMaxErrorINTEL, + "FPGALatencyControlINTEL" => Self::FPGALatencyControlINTEL, + "FPGAArgumentInterfacesINTEL" => Self::FPGAArgumentInterfacesINTEL, + "GlobalVariableHostAccessINTEL" => Self::GlobalVariableHostAccessINTEL, + "GlobalVariableFPGADecorationsINTEL" => Self::GlobalVariableFPGADecorationsINTEL, + "SubgroupBufferPrefetchINTEL" => Self::SubgroupBufferPrefetchINTEL, + "Subgroup2DBlockIOINTEL" => Self::Subgroup2DBlockIOINTEL, + "Subgroup2DBlockTransformINTEL" => Self::Subgroup2DBlockTransformINTEL, + "Subgroup2DBlockTransposeINTEL" => Self::Subgroup2DBlockTransposeINTEL, + "SubgroupMatrixMultiplyAccumulateINTEL" => Self::SubgroupMatrixMultiplyAccumulateINTEL, + "GroupUniformArithmeticKHR" => Self::GroupUniformArithmeticKHR, + "MaskedGatherScatterINTEL" => Self::MaskedGatherScatterINTEL, + "CacheControlsINTEL" => Self::CacheControlsINTEL, + "RegisterLimitsINTEL" => Self::RegisterLimitsINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [RayQueryIntersection](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_ray_query_intersection_a_ray_query_intersection)"] @@ -2713,11 +2848,11 @@ impl RayQueryIntersection {} impl core::str::FromStr for RayQueryIntersection { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "RayQueryCandidateIntersectionKHR" => Ok(Self::RayQueryCandidateIntersectionKHR), - "RayQueryCommittedIntersectionKHR" => Ok(Self::RayQueryCommittedIntersectionKHR), - _ => Err(()), - } + Ok(match s { + "RayQueryCandidateIntersectionKHR" => Self::RayQueryCandidateIntersectionKHR, + "RayQueryCommittedIntersectionKHR" => Self::RayQueryCommittedIntersectionKHR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [RayQueryCommittedIntersectionType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_ray_query_committed_intersection_type_a_ray_query_committed_intersection_type)"] @@ -2746,18 +2881,16 @@ impl RayQueryCommittedIntersectionType {} impl core::str::FromStr for RayQueryCommittedIntersectionType { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "RayQueryCommittedIntersectionNoneKHR" => { - Ok(Self::RayQueryCommittedIntersectionNoneKHR) - } + Ok(match s { + "RayQueryCommittedIntersectionNoneKHR" => Self::RayQueryCommittedIntersectionNoneKHR, "RayQueryCommittedIntersectionTriangleKHR" => { - Ok(Self::RayQueryCommittedIntersectionTriangleKHR) + Self::RayQueryCommittedIntersectionTriangleKHR } "RayQueryCommittedIntersectionGeneratedKHR" => { - Ok(Self::RayQueryCommittedIntersectionGeneratedKHR) + Self::RayQueryCommittedIntersectionGeneratedKHR } - _ => Err(()), - } + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [RayQueryCandidateIntersectionType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_ray_query_candidate_intersection_type_a_ray_query_candidate_intersection_type)"] @@ -2785,15 +2918,13 @@ impl RayQueryCandidateIntersectionType {} impl core::str::FromStr for RayQueryCandidateIntersectionType { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { + Ok(match s { "RayQueryCandidateIntersectionTriangleKHR" => { - Ok(Self::RayQueryCandidateIntersectionTriangleKHR) - } - "RayQueryCandidateIntersectionAABBKHR" => { - Ok(Self::RayQueryCandidateIntersectionAABBKHR) + Self::RayQueryCandidateIntersectionTriangleKHR } - _ => Err(()), - } + "RayQueryCandidateIntersectionAABBKHR" => Self::RayQueryCandidateIntersectionAABBKHR, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [PackedVectorFormat](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_packed_vector_format_a_packed_vector_format)"] @@ -2820,11 +2951,11 @@ impl PackedVectorFormat { impl core::str::FromStr for PackedVectorFormat { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "PackedVectorFormat4x8Bit" => Ok(Self::PackedVectorFormat4x8Bit), - "PackedVectorFormat4x8BitKHR" => Ok(Self::PackedVectorFormat4x8Bit), - _ => Err(()), - } + Ok(match s { + "PackedVectorFormat4x8Bit" => Self::PackedVectorFormat4x8Bit, + "PackedVectorFormat4x8BitKHR" => Self::PackedVectorFormat4x8Bit, + _ => return Err(()), + }) } } bitflags! { # [doc = "SPIR-V operand kind: [CooperativeMatrixOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_operands_a_cooperative_matrix_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct CooperativeMatrixOperands : u32 { const NONE_KHR = 0u32 ; const MATRIX_A_SIGNED_COMPONENTS_KHR = 1u32 ; const MATRIX_B_SIGNED_COMPONENTS_KHR = 2u32 ; const MATRIX_C_SIGNED_COMPONENTS_KHR = 4u32 ; const MATRIX_RESULT_SIGNED_COMPONENTS_KHR = 8u32 ; const SATURATING_ACCUMULATION_KHR = 16u32 ; } } @@ -2837,11 +2968,14 @@ bitflags! { # [doc = "SPIR-V operand kind: [CooperativeMatrixOperands](https://w pub enum CooperativeMatrixLayout { RowMajorKHR = 0u32, ColumnMajorKHR = 1u32, + RowBlockedInterleavedARM = 4202u32, + ColumnBlockedInterleavedARM = 4203u32, } impl CooperativeMatrixLayout { pub fn from_u32(n: u32) -> Option<Self> { Some(match n { 0u32..=1u32 => unsafe { core::mem::transmute::<u32, CooperativeMatrixLayout>(n) }, + 4202u32..=4203u32 => unsafe { core::mem::transmute::<u32, CooperativeMatrixLayout>(n) }, _ => return None, }) } @@ -2851,11 +2985,13 @@ impl CooperativeMatrixLayout {} impl core::str::FromStr for CooperativeMatrixLayout { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "RowMajorKHR" => Ok(Self::RowMajorKHR), - "ColumnMajorKHR" => Ok(Self::ColumnMajorKHR), - _ => Err(()), - } + Ok(match s { + "RowMajorKHR" => Self::RowMajorKHR, + "ColumnMajorKHR" => Self::ColumnMajorKHR, + "RowBlockedInterleavedARM" => Self::RowBlockedInterleavedARM, + "ColumnBlockedInterleavedARM" => Self::ColumnBlockedInterleavedARM, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [CooperativeMatrixUse](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_use_a_cooperative_matrix_use)"] @@ -2882,14 +3018,52 @@ impl CooperativeMatrixUse {} impl core::str::FromStr for CooperativeMatrixUse { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "MatrixAKHR" => Ok(Self::MatrixAKHR), - "MatrixBKHR" => Ok(Self::MatrixBKHR), - "MatrixAccumulatorKHR" => Ok(Self::MatrixAccumulatorKHR), - _ => Err(()), - } + Ok(match s { + "MatrixAKHR" => Self::MatrixAKHR, + "MatrixBKHR" => Self::MatrixBKHR, + "MatrixAccumulatorKHR" => Self::MatrixAccumulatorKHR, + _ => return Err(()), + }) + } +} +bitflags! { # [doc = "SPIR-V operand kind: [CooperativeMatrixReduce](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_reduce_a_cooperative_matrix_reduce)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct CooperativeMatrixReduce : u32 { const ROW = 1u32 ; const COLUMN = 2u32 ; const _2X2 = 4u32 ; } } +#[doc = "SPIR-V operand kind: [TensorClampMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_tensor_clamp_mode_a_tensor_clamp_mode)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum TensorClampMode { + Undefined = 0u32, + Constant = 1u32, + ClampToEdge = 2u32, + Repeat = 3u32, + RepeatMirrored = 4u32, +} +impl TensorClampMode { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 0u32..=4u32 => unsafe { core::mem::transmute::<u32, TensorClampMode>(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl TensorClampMode {} +impl core::str::FromStr for TensorClampMode { + type Err = (); + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(match s { + "Undefined" => Self::Undefined, + "Constant" => Self::Constant, + "ClampToEdge" => Self::ClampToEdge, + "Repeat" => Self::Repeat, + "RepeatMirrored" => Self::RepeatMirrored, + _ => return Err(()), + }) } } +bitflags! { # [doc = "SPIR-V operand kind: [TensorAddressingOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_tensor_addressing_operands_a_tensor_addressing_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct TensorAddressingOperands : u32 { const NONE = 0u32 ; const TENSOR_VIEW = 1u32 ; const DECODE_FUNC = 2u32 ; } } #[doc = "SPIR-V operand kind: [InitializationModeQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_initialization_mode_qualifier_a_initialization_mode_qualifier)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -2913,11 +3087,11 @@ impl InitializationModeQualifier {} impl core::str::FromStr for InitializationModeQualifier { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "InitOnDeviceReprogramINTEL" => Ok(Self::InitOnDeviceReprogramINTEL), - "InitOnDeviceResetINTEL" => Ok(Self::InitOnDeviceResetINTEL), - _ => Err(()), - } + Ok(match s { + "InitOnDeviceReprogramINTEL" => Self::InitOnDeviceReprogramINTEL, + "InitOnDeviceResetINTEL" => Self::InitOnDeviceResetINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [LoadCacheControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_load_cache_control_a_load_cache_control)"] @@ -2946,14 +3120,14 @@ impl LoadCacheControl {} impl core::str::FromStr for LoadCacheControl { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "UncachedINTEL" => Ok(Self::UncachedINTEL), - "CachedINTEL" => Ok(Self::CachedINTEL), - "StreamingINTEL" => Ok(Self::StreamingINTEL), - "InvalidateAfterReadINTEL" => Ok(Self::InvalidateAfterReadINTEL), - "ConstCachedINTEL" => Ok(Self::ConstCachedINTEL), - _ => Err(()), - } + Ok(match s { + "UncachedINTEL" => Self::UncachedINTEL, + "CachedINTEL" => Self::CachedINTEL, + "StreamingINTEL" => Self::StreamingINTEL, + "InvalidateAfterReadINTEL" => Self::InvalidateAfterReadINTEL, + "ConstCachedINTEL" => Self::ConstCachedINTEL, + _ => return Err(()), + }) } } #[doc = "SPIR-V operand kind: [StoreCacheControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_store_cache_control_a_store_cache_control)"] @@ -2981,13 +3155,163 @@ impl StoreCacheControl {} impl core::str::FromStr for StoreCacheControl { type Err = (); fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "UncachedINTEL" => Ok(Self::UncachedINTEL), - "WriteThroughINTEL" => Ok(Self::WriteThroughINTEL), - "WriteBackINTEL" => Ok(Self::WriteBackINTEL), - "StreamingINTEL" => Ok(Self::StreamingINTEL), - _ => Err(()), - } + Ok(match s { + "UncachedINTEL" => Self::UncachedINTEL, + "WriteThroughINTEL" => Self::WriteThroughINTEL, + "WriteBackINTEL" => Self::WriteBackINTEL, + "StreamingINTEL" => Self::StreamingINTEL, + _ => return Err(()), + }) + } +} +#[doc = "SPIR-V operand kind: [NamedMaximumNumberOfRegisters](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_named_maximum_number_of_registers_a_named_maximum_number_of_registers)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum NamedMaximumNumberOfRegisters { + AutoINTEL = 0u32, +} +impl NamedMaximumNumberOfRegisters { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 0u32 => unsafe { core::mem::transmute::<u32, NamedMaximumNumberOfRegisters>(0u32) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl NamedMaximumNumberOfRegisters {} +impl core::str::FromStr for NamedMaximumNumberOfRegisters { + type Err = (); + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(match s { + "AutoINTEL" => Self::AutoINTEL, + _ => return Err(()), + }) + } +} +bitflags! { # [doc = "SPIR-V operand kind: [MatrixMultiplyAccumulateOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_matrix_multiply_accumulate_operands_a_matrix_multiply_accumulate_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MatrixMultiplyAccumulateOperands : u32 { const NONE = 0u32 ; const MATRIX_A_SIGNED_COMPONENTS_INTEL = 1u32 ; const MATRIX_B_SIGNED_COMPONENTS_INTEL = 2u32 ; const MATRIX_CB_FLOAT16_INTEL = 4u32 ; const MATRIX_RESULT_B_FLOAT16_INTEL = 8u32 ; const MATRIX_A_PACKED_INT8_INTEL = 16u32 ; const MATRIX_B_PACKED_INT8_INTEL = 32u32 ; const MATRIX_A_PACKED_INT4_INTEL = 64u32 ; const MATRIX_B_PACKED_INT4_INTEL = 128u32 ; const MATRIX_ATF32INTEL = 256u32 ; const MATRIX_BTF32INTEL = 512u32 ; const MATRIX_A_PACKED_FLOAT16_INTEL = 1024u32 ; const MATRIX_B_PACKED_FLOAT16_INTEL = 2048u32 ; const MATRIX_A_PACKED_B_FLOAT16_INTEL = 4096u32 ; const MATRIX_B_PACKED_B_FLOAT16_INTEL = 8192u32 ; } } +#[doc = "SPIR-V operand kind: [FPEncoding](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_encoding_a_fp_encoding)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum FPEncoding { + Max = 0x7fffffff, +} +impl FPEncoding { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 0x7fffffff => Self::Max, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl FPEncoding {} +impl core::str::FromStr for FPEncoding { + type Err = (); + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(match s { + "Max" => Self::Max, + _ => return Err(()), + }) + } +} +#[doc = "SPIR-V operand kind: [CooperativeVectorMatrixLayout](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_vector_matrix_layout_a_cooperative_vector_matrix_layout)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum CooperativeVectorMatrixLayout { + RowMajorNV = 0u32, + ColumnMajorNV = 1u32, + InferencingOptimalNV = 2u32, + TrainingOptimalNV = 3u32, +} +impl CooperativeVectorMatrixLayout { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::<u32, CooperativeVectorMatrixLayout>(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl CooperativeVectorMatrixLayout {} +impl core::str::FromStr for CooperativeVectorMatrixLayout { + type Err = (); + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(match s { + "RowMajorNV" => Self::RowMajorNV, + "ColumnMajorNV" => Self::ColumnMajorNV, + "InferencingOptimalNV" => Self::InferencingOptimalNV, + "TrainingOptimalNV" => Self::TrainingOptimalNV, + _ => return Err(()), + }) + } +} +#[doc = "SPIR-V operand kind: [ComponentType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_component_type_a_component_type)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum ComponentType { + Float16NV = 0u32, + Float32NV = 1u32, + Float64NV = 2u32, + SignedInt8NV = 3u32, + SignedInt16NV = 4u32, + SignedInt32NV = 5u32, + SignedInt64NV = 6u32, + UnsignedInt8NV = 7u32, + UnsignedInt16NV = 8u32, + UnsignedInt32NV = 9u32, + UnsignedInt64NV = 10u32, + SignedInt8PackedNV = 1000491000u32, + UnsignedInt8PackedNV = 1000491001u32, + FloatE4M3NV = 1000491002u32, + FloatE5M2NV = 1000491003u32, +} +impl ComponentType { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 0u32..=10u32 => unsafe { core::mem::transmute::<u32, ComponentType>(n) }, + 1000491000u32..=1000491003u32 => unsafe { + core::mem::transmute::<u32, ComponentType>(n) + }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl ComponentType {} +impl core::str::FromStr for ComponentType { + type Err = (); + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(match s { + "Float16NV" => Self::Float16NV, + "Float32NV" => Self::Float32NV, + "Float64NV" => Self::Float64NV, + "SignedInt8NV" => Self::SignedInt8NV, + "SignedInt16NV" => Self::SignedInt16NV, + "SignedInt32NV" => Self::SignedInt32NV, + "SignedInt64NV" => Self::SignedInt64NV, + "UnsignedInt8NV" => Self::UnsignedInt8NV, + "UnsignedInt16NV" => Self::UnsignedInt16NV, + "UnsignedInt32NV" => Self::UnsignedInt32NV, + "UnsignedInt64NV" => Self::UnsignedInt64NV, + "SignedInt8PackedNV" => Self::SignedInt8PackedNV, + "UnsignedInt8PackedNV" => Self::UnsignedInt8PackedNV, + "FloatE4M3NV" => Self::FloatE4M3NV, + "FloatE5M2NV" => Self::FloatE5M2NV, + _ => return Err(()), + }) } } #[doc = "SPIR-V [instructions](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_instructions_a_instructions) opcodes"] @@ -3345,13 +3669,22 @@ pub enum Op { DepthAttachmentReadEXT = 4161u32, StencilAttachmentReadEXT = 4162u32, TerminateInvocation = 4416u32, + TypeUntypedPointerKHR = 4417u32, + UntypedVariableKHR = 4418u32, + UntypedAccessChainKHR = 4419u32, + UntypedInBoundsAccessChainKHR = 4420u32, SubgroupBallotKHR = 4421u32, SubgroupFirstInvocationKHR = 4422u32, + UntypedPtrAccessChainKHR = 4423u32, + UntypedInBoundsPtrAccessChainKHR = 4424u32, + UntypedArrayLengthKHR = 4425u32, + UntypedPrefetchKHR = 4426u32, SubgroupAllKHR = 4428u32, SubgroupAnyKHR = 4429u32, SubgroupAllEqualKHR = 4430u32, GroupNonUniformRotateKHR = 4431u32, SubgroupReadInvocationKHR = 4432u32, + ExtInstWithForwardRefsKHR = 4433u32, TraceRayKHR = 4445u32, ExecuteCallableKHR = 4446u32, ConvertUToAccelerationStructureKHR = 4447u32, @@ -3368,6 +3701,9 @@ pub enum Op { CooperativeMatrixStoreKHR = 4458u32, CooperativeMatrixMulAddKHR = 4459u32, CooperativeMatrixLengthKHR = 4460u32, + ConstantCompositeReplicateEXT = 4461u32, + SpecConstantCompositeReplicateEXT = 4462u32, + CompositeConstructReplicateEXT = 4463u32, TypeRayQueryKHR = 4472u32, RayQueryInitializeKHR = 4473u32, RayQueryTerminateKHR = 4474u32, @@ -3379,6 +3715,10 @@ pub enum Op { ImageBoxFilterQCOM = 4481u32, ImageBlockMatchSSDQCOM = 4482u32, ImageBlockMatchSADQCOM = 4483u32, + ImageBlockMatchWindowSSDQCOM = 4500u32, + ImageBlockMatchWindowSADQCOM = 4501u32, + ImageBlockMatchGatherSSDQCOM = 4502u32, + ImageBlockMatchGatherSADQCOM = 4503u32, GroupIAddNonUniformAMD = 5000u32, GroupFAddNonUniformAMD = 5001u32, GroupFMinNonUniformAMD = 5002u32, @@ -3390,9 +3730,16 @@ pub enum Op { FragmentMaskFetchAMD = 5011u32, FragmentFetchAMD = 5012u32, ReadClockKHR = 5056u32, - FinalizeNodePayloadsAMDX = 5075u32, + AllocateNodePayloadsAMDX = 5074u32, + EnqueueNodePayloadsAMDX = 5075u32, + TypeNodePayloadArrayAMDX = 5076u32, FinishWritingNodePayloadAMDX = 5078u32, - InitializeNodePayloadsAMDX = 5090u32, + NodePayloadArrayLengthAMDX = 5090u32, + IsNodePayloadValidAMDX = 5101u32, + ConstantStringAMDX = 5103u32, + SpecConstantStringAMDX = 5104u32, + GroupNonUniformQuadAllKHR = 5110u32, + GroupNonUniformQuadAnyKHR = 5111u32, HitObjectRecordHitMotionNV = 5249u32, HitObjectRecordHitWithIndexMotionNV = 5250u32, HitObjectRecordMissMotionNV = 5251u32, @@ -3427,12 +3774,20 @@ pub enum Op { ReorderThreadWithHintNV = 5280u32, TypeHitObjectNV = 5281u32, ImageSampleFootprintNV = 5283u32, + TypeCooperativeVectorNV = 5288u32, + CooperativeVectorMatrixMulNV = 5289u32, + CooperativeVectorOuterProductAccumulateNV = 5290u32, + CooperativeVectorReduceSumAccumulateNV = 5291u32, + CooperativeVectorMatrixMulAddNV = 5292u32, + CooperativeMatrixConvertNV = 5293u32, EmitMeshTasksEXT = 5294u32, SetMeshOutputsEXT = 5295u32, GroupNonUniformPartitionNV = 5296u32, WritePackedPrimitiveIndices4x8NV = 5299u32, FetchMicroTriangleVertexPositionNV = 5300u32, FetchMicroTriangleVertexBarycentricNV = 5301u32, + CooperativeVectorLoadNV = 5302u32, + CooperativeVectorStoreNV = 5303u32, ReportIntersectionKHR = 5334u32, IgnoreIntersectionNV = 5335u32, TerminateRayNV = 5336u32, @@ -3442,6 +3797,8 @@ pub enum Op { RayQueryGetIntersectionTriangleVertexPositionsKHR = 5340u32, TypeAccelerationStructureKHR = 5341u32, ExecuteCallableNV = 5344u32, + RayQueryGetClusterIdNV = 5345u32, + HitObjectGetClusterIdNV = 5346u32, TypeCooperativeMatrixNV = 5358u32, CooperativeMatrixLoadNV = 5359u32, CooperativeMatrixStoreNV = 5360u32, @@ -3449,8 +3806,25 @@ pub enum Op { CooperativeMatrixLengthNV = 5362u32, BeginInvocationInterlockEXT = 5364u32, EndInvocationInterlockEXT = 5365u32, + CooperativeMatrixReduceNV = 5366u32, + CooperativeMatrixLoadTensorNV = 5367u32, + CooperativeMatrixStoreTensorNV = 5368u32, + CooperativeMatrixPerElementOpNV = 5369u32, + TypeTensorLayoutNV = 5370u32, + TypeTensorViewNV = 5371u32, + CreateTensorLayoutNV = 5372u32, + TensorLayoutSetDimensionNV = 5373u32, + TensorLayoutSetStrideNV = 5374u32, + TensorLayoutSliceNV = 5375u32, + TensorLayoutSetClampValueNV = 5376u32, + CreateTensorViewNV = 5377u32, + TensorViewSetDimensionNV = 5378u32, + TensorViewSetStrideNV = 5379u32, DemoteToHelperInvocation = 5380u32, IsHelperInvocationEXT = 5381u32, + TensorViewSetClipNV = 5382u32, + TensorLayoutSetBlockSizeNV = 5384u32, + CooperativeMatrixTransposeNV = 5390u32, ConvertUToImageNV = 5391u32, ConvertUToSamplerNV = 5392u32, ConvertImageToUNV = 5393u32, @@ -3458,6 +3832,20 @@ pub enum Op { ConvertUToSampledImageNV = 5395u32, ConvertSampledImageToUNV = 5396u32, SamplerImageAddressingModeNV = 5397u32, + RawAccessChainNV = 5398u32, + RayQueryGetIntersectionSpherePositionNV = 5427u32, + RayQueryGetIntersectionSphereRadiusNV = 5428u32, + RayQueryGetIntersectionLSSPositionsNV = 5429u32, + RayQueryGetIntersectionLSSRadiiNV = 5430u32, + RayQueryGetIntersectionLSSHitValueNV = 5431u32, + HitObjectGetSpherePositionNV = 5432u32, + HitObjectGetSphereRadiusNV = 5433u32, + HitObjectGetLSSPositionsNV = 5434u32, + HitObjectGetLSSRadiiNV = 5435u32, + HitObjectIsSphereHitNV = 5436u32, + HitObjectIsLSSHitNV = 5437u32, + RayQueryIsSphereHitNV = 5438u32, + RayQueryIsLSSHitNV = 5439u32, SubgroupShuffleINTEL = 5571u32, SubgroupShuffleDownINTEL = 5572u32, SubgroupShuffleUpINTEL = 5573u32, @@ -3697,10 +4085,19 @@ pub enum Op { TypeStructContinuedINTEL = 6090u32, ConstantCompositeContinuedINTEL = 6091u32, SpecConstantCompositeContinuedINTEL = 6092u32, + CompositeConstructContinuedINTEL = 6096u32, ConvertFToBF16INTEL = 6116u32, ConvertBF16ToFINTEL = 6117u32, ControlBarrierArriveINTEL = 6142u32, ControlBarrierWaitINTEL = 6143u32, + ArithmeticFenceEXT = 6145u32, + SubgroupBlockPrefetchINTEL = 6221u32, + Subgroup2DBlockLoadINTEL = 6231u32, + Subgroup2DBlockLoadTransformINTEL = 6232u32, + Subgroup2DBlockLoadTransposeINTEL = 6233u32, + Subgroup2DBlockPrefetchINTEL = 6234u32, + Subgroup2DBlockStoreINTEL = 6235u32, + SubgroupMatrixMultiplyAccumulateINTEL = 6237u32, GroupIMulKHR = 6401u32, GroupFMulKHR = 6402u32, GroupBitwiseAndKHR = 6403u32, @@ -3709,6 +4106,8 @@ pub enum Op { GroupLogicalAndKHR = 6406u32, GroupLogicalOrKHR = 6407u32, GroupLogicalXorKHR = 6408u32, + MaskedGatherINTEL = 6428u32, + MaskedScatterINTEL = 6429u32, } impl Op { pub fn from_u32(n: u32) -> Option<Self> { @@ -3737,28 +4136,32 @@ impl Op { 291u32..=366u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 400u32..=403u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 4160u32..=4162u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 4416u32 => unsafe { core::mem::transmute::<u32, Op>(4416u32) }, - 4421u32..=4422u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 4428u32..=4432u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 4445u32..=4460u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 4416u32..=4426u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 4428u32..=4433u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 4445u32..=4463u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 4472u32..=4477u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 4479u32..=4483u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 4500u32..=4503u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5000u32..=5007u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5011u32..=5012u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5056u32 => unsafe { core::mem::transmute::<u32, Op>(5056u32) }, - 5075u32 => unsafe { core::mem::transmute::<u32, Op>(5075u32) }, + 5074u32..=5076u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5078u32 => unsafe { core::mem::transmute::<u32, Op>(5078u32) }, 5090u32 => unsafe { core::mem::transmute::<u32, Op>(5090u32) }, + 5101u32 => unsafe { core::mem::transmute::<u32, Op>(5101u32) }, + 5103u32..=5104u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5110u32..=5111u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5249u32..=5281u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5283u32 => unsafe { core::mem::transmute::<u32, Op>(5283u32) }, - 5294u32..=5296u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 5299u32..=5301u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5288u32..=5296u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5299u32..=5303u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5334u32..=5341u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 5344u32 => unsafe { core::mem::transmute::<u32, Op>(5344u32) }, + 5344u32..=5346u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5358u32..=5362u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 5364u32..=5365u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 5380u32..=5381u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, - 5391u32..=5397u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5364u32..=5382u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5384u32 => unsafe { core::mem::transmute::<u32, Op>(5384u32) }, + 5390u32..=5398u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 5427u32..=5439u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5571u32..=5578u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5580u32..=5581u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 5585u32..=5598u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, @@ -3780,9 +4183,15 @@ impl Op { 6035u32 => unsafe { core::mem::transmute::<u32, Op>(6035u32) }, 6086u32 => unsafe { core::mem::transmute::<u32, Op>(6086u32) }, 6090u32..=6092u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 6096u32 => unsafe { core::mem::transmute::<u32, Op>(6096u32) }, 6116u32..=6117u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, 6142u32..=6143u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 6145u32 => unsafe { core::mem::transmute::<u32, Op>(6145u32) }, + 6221u32 => unsafe { core::mem::transmute::<u32, Op>(6221u32) }, + 6231u32..=6235u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 6237u32 => unsafe { core::mem::transmute::<u32, Op>(6237u32) }, 6401u32..=6408u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, + 6428u32..=6429u32 => unsafe { core::mem::transmute::<u32, Op>(n) }, _ => return None, }) } @@ -3899,7 +4308,7 @@ impl GLOp { }) } } -#[doc = "[OpenCL.std](https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html) extended instruction opcode"] +#[doc = "[OpenCL.std.100](https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html) extended instruction opcode"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -4079,3 +4488,20 @@ impl CLOp { }) } } +#[doc = "[NonSemantic.DebugPrintF](https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/docs/debug_printf.md) extended instruction opcode"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum DebugPrintFOp { + DebugPrintf = 1u32, +} +impl DebugPrintFOp { + pub fn from_u32(n: u32) -> Option<Self> { + Some(match n { + 1u32 => unsafe { core::mem::transmute::<u32, DebugPrintFOp>(1u32) }, + _ => return None, + }) + } +} diff --git a/third_party/rust/spirv/lib.rs b/third_party/rust/spirv/lib.rs @@ -7,6 +7,7 @@ #![no_std] #![allow(non_camel_case_types)] +#![deny(clippy::std_instead_of_core, clippy::alloc_instead_of_core)] #![cfg_attr(rustfmt, rustfmt_skip)] use bitflags::bitflags; diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3fa11b214c7cfa646d5112dd9bee8916304821d09d48174532a0f49c38dd102e","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","build.rs":"5e3619e28faeac243cbae1a5f739ad15035dc9e1254957b64fd1deed6f393c8a","src/as_hal.rs":"5d08d8e49b016abb662957d8e42ab748d580a2f3e449caeeb7311f222b8818f6","src/binding_model.rs":"26c81824371ca9395d9dd3d6aa19c3317f845b10924a2ff80e7f01537cdd6db0","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"26e3e693515dd82ae421b5b28d32138e6d9b62031e66b6761f2345bf2aa67148","src/command/bundle.rs":"e7b7cb4123d490769dbffda7f5e112af99c773db0af38c536d65f7ef91d3a422","src/command/clear.rs":"e125c82ff73f08ced329474a04228e656aba362535b630866b4877d42be929a3","src/command/compute.rs":"b22b9856fa08fae52e1fe03805a3faa2b1eda8d71768dd7a1b8f87c0bb38ee22","src/command/compute_command.rs":"92351bef1de6914b5b313dbe0df5a3bd25ef074f68b6d750f2a0f8a9011cfa89","src/command/draw.rs":"6ca62ab86e0b2216a1ac32e0f5b0d12653346a3e39922ffd9df722be7ed263f8","src/command/encoder.rs":"7655f8c248120f39e37f3ad0f84bd9816df78a75657790ab12d5aba144fef65f","src/command/encoder_command.rs":"2f9417c9c6c0cb52db561ed7d8a777fc29b59ade95a98ffaf91e4bb84f3b8cda","src/command/ffi.rs":"4924adbb42a670b5e9827c0f2175939981e8fc78a36b2fe370426e8c550a4ce7","src/command/memory_init.rs":"f68a796c4262d261620cf85e5762e267dee013f4ef5d61f67fcb173b59048983","src/command/mod.rs":"c73244dc4f6c95d967fbb413cb6b20594d7bb9c0654184c6a289217738795e88","src/command/pass.rs":"ebaffd6ddc8692d9b004a1f456694c1ba86dc3bb39ce5873c1bd3e4d940954fc","src/command/query.rs":"f1bf5f54d79833a2bc19a069cd74ab4d6f82ce538d4c3aa7c5c51a1e52c2eac8","src/command/ray_tracing.rs":"818788dd5e37325367832ec969e21ce47363a259754f907d518336ae5069f0bd","src/command/render.rs":"fdd6907ad22555e0410a6d129ef4dcb6fb8b4b6c5c729a758953f9eaaee47e7a","src/command/render_command.rs":"2e639cb0766d8de3047abb6997cc508b07f0c0adc1dfd1beed5f565af8b9eeef","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"ce36f5bfaf289ad467c4a7a39a7e47bc1050b28784ad4d6cd84c1b6d7f74aa27","src/command/transition_resources.rs":"753cb02adfee4758404c403d19fd76e6c8de77de01435a2cbe2f60bdbe44bde1","src/conv.rs":"6142ee1793ad9b59dd3b95c87f15539a17333e0780c5dd5bdff92475711f1b36","src/device/bgl.rs":"b081fe1393f1dd917151efc3a10ee0269fecd3920eac3b45411c1197a98c5a06","src/device/global.rs":"c59c3fb9e425987b7ed5c6cb9a917f977e60ca1eed7b41dfc91220d88f3f198a","src/device/life.rs":"44bd34cf5ab1c1a21729f2188df6d2ca0238f11c5f723380c8a4a16fbbd90b88","src/device/mod.rs":"acf3377cb05a02586b2c76ba4e51cdcb5939700d6d6bb167d17f72fd1526af91","src/device/queue.rs":"01d95b1876459974fa0f106cef0011c6bead8300130da8c6cdb41994ccc158a4","src/device/ray_tracing.rs":"6f8df97f9fb1a3405a651d96619760ba7cf14830e28f65e824413a4f922abd95","src/device/resource.rs":"99ddb1d8e2a65e54e84833b82e0e7c1587f8f78c35539ed7546b46d3112c017b","src/device/trace.rs":"022df1e97641b3e615f2974c297ff2c589c61bf1e2a2828236e101165eefa069","src/device/trace/record.rs":"b045e728bcc01accaf22cf0f61eb0cb384b45f10286860597ef0f616a341e456","src/error.rs":"4f07a0b09b30b2d6cbc855d0091d724000f492018af3b41e80befbeccf2a6f4e","src/global.rs":"29a7a03d26e72899fceb6ddfdc540a96f737cf23068c99f09fc29c1fc3f80c75","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"308c53e05134e5a48294c61511e43077adfdb5c334237de2016ed4537d562382","src/id.rs":"ec20d5b995178c0e731b1b8cecfd90772ee18dd4d91c28de434039e9c9e50486","src/identity.rs":"712ccda267eb602655c53672a94346aa4c9f88c0044ae6edcd658a814c9a50cf","src/indirect_validation/dispatch.rs":"04c845c36711484e614b379187c85e935feff4a8703d63e925a651456b3da6fa","src/indirect_validation/draw.rs":"80a3b126745a4fbbfcb195b05c4b93d9e7e17b8a166ff50e3b9e487b562ea366","src/indirect_validation/mod.rs":"79466e4f9a59386e833958b3537beed6ffb6a7ee62aaabcf35382c2683998e43","src/indirect_validation/utils.rs":"e6a3b636dd71ff6b01d5abd5a589a0136fb30aa1d517a43f45cf2e5ad54da245","src/indirect_validation/validate_draw.wgsl":"35a34174ac4a61b9684283878eb42468c1843b6778114bff3ef4dc40976e05d7","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"aa87df3428e3b23507377c71eae92dc1dd9f5d5374aa0b03906fb81507fc6ce6","src/init_tracker/texture.rs":"ffdc67d4be23bcd48b22945de94ac0ea8ee571f91eb6d00323b9afe6fa91eef3","src/instance.rs":"128d113ba6742d35c5085b6958c45da5f2d544abada4463ada21c0eb614dcd00","src/lib.rs":"57d2562e33b04113cc6c2ca3bc9a215ec779a291be82b680ff037fac7d7a8a15","src/lock/mod.rs":"8d3ae3f8d004d7f7d8a3aefe9f30b35669cb8e2409f5fba27b1fcb116b2429c4","src/lock/observing.rs":"5bf62cef9f3ae67e99af640442fadd4e1f762480d990ee69ed9924c9e94a8dce","src/lock/rank.rs":"238e6a97c58ee1a804863c8011bb257864301170344d18596bdaab09f3f74b54","src/lock/ranked.rs":"a95d6bf7f2ef510047a4c33687076beccf38a0148aac3261bd29fa7555e3f488","src/lock/vanilla.rs":"ca8156d4c981473d437db1056487a44c714760d685819eaff8cf82fb0098a608","src/pipeline.rs":"d84fbf90eda12f4acbb0ff8f8166a6b498ce89da52beacf5b81a6b06afa907c9","src/pipeline_cache.rs":"96a7d2a5decf61a2906fe38f73377c9b785490a9510ee51eae553aeeaef799dc","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"65711dbf7305861e2ccbc61db95a43483376ce80c4462bb23da8b995549b5a08","src/ray_tracing.rs":"ae43907290f003f6247bb599927401bd768865f7773a41c327dc73fade014ede","src/registry.rs":"2a76c6397998d263b6f6347299f04a8d27ea4df7dda200e98f205cfa3850dadb","src/resource.rs":"46bc35f20e63487a34c8a94c13c93ecdc497c72a7439465e6f736958dbb920ae","src/scratch.rs":"ea5c40e4d18a12f09cc1038f2dcdddb69b13e99275ac987d826658229a39b326","src/snatch.rs":"bf422810afd952894e365cd397763d42d6365ce3c5a5b4c1170566432f462939","src/storage.rs":"1a5bbf125a1cf65a36d8580e426ef1847c1638003fea0c6f76e309f5923b7692","src/timestamp_normalization/common.wgsl":"9f65aef0526ff9dde945fae70cef064ad961b0aee4291759ae82974cd2ead0a7","src/timestamp_normalization/mod.rs":"4fb7a4d6c53797edc9dd3893a8e25d4efeff14c4846a8927d865101a6d7594a2","src/timestamp_normalization/timestamp_normalization.wgsl":"c0225bf02fdd741542bd20664a6d9195b91936e6f7758c9c4c0ac05b08122e79","src/track/blas.rs":"18c7b5b89a60ab49bbc0f4f8b85a24502c1d968714ef4c586095e119848d902a","src/track/buffer.rs":"7f2393d16d0e8f624327c7a3a1de7176f945f3d33bfd3e12640faddc5c2c9f83","src/track/metadata.rs":"04b8bcf8ded7c7c805d9336cfc874da9d8de7d12d99f7525f0540780a1dffc45","src/track/mod.rs":"c28de55e31cdde3feb067945a04446dc5343a39418c4b9c2c76148172e7ba855","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"34e72a20364d3ce642c21b29a089811503aa2fb4e7dab1a1e20d8ddd598742d7","src/validation.rs":"d68edeec2ad9987c89f7959f443ece88a4df8753736b54d510238a112d750db0","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"package":null} -\ No newline at end of file +{"files":{"Cargo.toml":"839621d8e065ae4c1b3f11997f5bff35e8c280e82aa0479553796505a5fee8f3","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","build.rs":"5e3619e28faeac243cbae1a5f739ad15035dc9e1254957b64fd1deed6f393c8a","src/as_hal.rs":"5d08d8e49b016abb662957d8e42ab748d580a2f3e449caeeb7311f222b8818f6","src/binding_model.rs":"26c81824371ca9395d9dd3d6aa19c3317f845b10924a2ff80e7f01537cdd6db0","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"26e3e693515dd82ae421b5b28d32138e6d9b62031e66b6761f2345bf2aa67148","src/command/bundle.rs":"e7b7cb4123d490769dbffda7f5e112af99c773db0af38c536d65f7ef91d3a422","src/command/clear.rs":"e125c82ff73f08ced329474a04228e656aba362535b630866b4877d42be929a3","src/command/compute.rs":"b22b9856fa08fae52e1fe03805a3faa2b1eda8d71768dd7a1b8f87c0bb38ee22","src/command/compute_command.rs":"92351bef1de6914b5b313dbe0df5a3bd25ef074f68b6d750f2a0f8a9011cfa89","src/command/draw.rs":"6ca62ab86e0b2216a1ac32e0f5b0d12653346a3e39922ffd9df722be7ed263f8","src/command/encoder.rs":"7655f8c248120f39e37f3ad0f84bd9816df78a75657790ab12d5aba144fef65f","src/command/encoder_command.rs":"2f9417c9c6c0cb52db561ed7d8a777fc29b59ade95a98ffaf91e4bb84f3b8cda","src/command/ffi.rs":"4924adbb42a670b5e9827c0f2175939981e8fc78a36b2fe370426e8c550a4ce7","src/command/memory_init.rs":"f68a796c4262d261620cf85e5762e267dee013f4ef5d61f67fcb173b59048983","src/command/mod.rs":"5556b9e8f6deaed9d0dd5505d1828451b112f36d3f77abfa03ebeb0cdf60a6ff","src/command/pass.rs":"ebaffd6ddc8692d9b004a1f456694c1ba86dc3bb39ce5873c1bd3e4d940954fc","src/command/query.rs":"f1bf5f54d79833a2bc19a069cd74ab4d6f82ce538d4c3aa7c5c51a1e52c2eac8","src/command/ray_tracing.rs":"818788dd5e37325367832ec969e21ce47363a259754f907d518336ae5069f0bd","src/command/render.rs":"fdd6907ad22555e0410a6d129ef4dcb6fb8b4b6c5c729a758953f9eaaee47e7a","src/command/render_command.rs":"2e639cb0766d8de3047abb6997cc508b07f0c0adc1dfd1beed5f565af8b9eeef","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"ce36f5bfaf289ad467c4a7a39a7e47bc1050b28784ad4d6cd84c1b6d7f74aa27","src/command/transition_resources.rs":"753cb02adfee4758404c403d19fd76e6c8de77de01435a2cbe2f60bdbe44bde1","src/conv.rs":"6142ee1793ad9b59dd3b95c87f15539a17333e0780c5dd5bdff92475711f1b36","src/device/bgl.rs":"b081fe1393f1dd917151efc3a10ee0269fecd3920eac3b45411c1197a98c5a06","src/device/global.rs":"c59c3fb9e425987b7ed5c6cb9a917f977e60ca1eed7b41dfc91220d88f3f198a","src/device/life.rs":"44bd34cf5ab1c1a21729f2188df6d2ca0238f11c5f723380c8a4a16fbbd90b88","src/device/mod.rs":"8a45aca14d891d1c25f892f043747567ea2256ee14388fa720e0125eeba3ef0a","src/device/queue.rs":"01d95b1876459974fa0f106cef0011c6bead8300130da8c6cdb41994ccc158a4","src/device/ray_tracing.rs":"6f8df97f9fb1a3405a651d96619760ba7cf14830e28f65e824413a4f922abd95","src/device/resource.rs":"9c77056dbd2f277d374b55613e0f87ebc2593ec414d82448c5b8300afc7e4090","src/device/trace.rs":"022df1e97641b3e615f2974c297ff2c589c61bf1e2a2828236e101165eefa069","src/device/trace/record.rs":"b045e728bcc01accaf22cf0f61eb0cb384b45f10286860597ef0f616a341e456","src/error.rs":"4f07a0b09b30b2d6cbc855d0091d724000f492018af3b41e80befbeccf2a6f4e","src/global.rs":"b29b96777103398ed337ceae8d866c4606c5cdc5ace2db6555bacf66766306af","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"308c53e05134e5a48294c61511e43077adfdb5c334237de2016ed4537d562382","src/id.rs":"ec20d5b995178c0e731b1b8cecfd90772ee18dd4d91c28de434039e9c9e50486","src/identity.rs":"712ccda267eb602655c53672a94346aa4c9f88c0044ae6edcd658a814c9a50cf","src/indirect_validation/dispatch.rs":"04c845c36711484e614b379187c85e935feff4a8703d63e925a651456b3da6fa","src/indirect_validation/draw.rs":"80a3b126745a4fbbfcb195b05c4b93d9e7e17b8a166ff50e3b9e487b562ea366","src/indirect_validation/mod.rs":"79466e4f9a59386e833958b3537beed6ffb6a7ee62aaabcf35382c2683998e43","src/indirect_validation/utils.rs":"e6a3b636dd71ff6b01d5abd5a589a0136fb30aa1d517a43f45cf2e5ad54da245","src/indirect_validation/validate_draw.wgsl":"35a34174ac4a61b9684283878eb42468c1843b6778114bff3ef4dc40976e05d7","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"aa87df3428e3b23507377c71eae92dc1dd9f5d5374aa0b03906fb81507fc6ce6","src/init_tracker/texture.rs":"ffdc67d4be23bcd48b22945de94ac0ea8ee571f91eb6d00323b9afe6fa91eef3","src/instance.rs":"4e211e1536b4b438af445b9e5ee9d98ca14d453007ff04c7b9b0d7077bc7197a","src/lib.rs":"57d2562e33b04113cc6c2ca3bc9a215ec779a291be82b680ff037fac7d7a8a15","src/lock/mod.rs":"8d3ae3f8d004d7f7d8a3aefe9f30b35669cb8e2409f5fba27b1fcb116b2429c4","src/lock/observing.rs":"5bf62cef9f3ae67e99af640442fadd4e1f762480d990ee69ed9924c9e94a8dce","src/lock/rank.rs":"238e6a97c58ee1a804863c8011bb257864301170344d18596bdaab09f3f74b54","src/lock/ranked.rs":"a95d6bf7f2ef510047a4c33687076beccf38a0148aac3261bd29fa7555e3f488","src/lock/vanilla.rs":"ca8156d4c981473d437db1056487a44c714760d685819eaff8cf82fb0098a608","src/pipeline.rs":"99ff9e5ab4c98b334a8cb3ec348b6987594972fc0575dd52ebaa3bb392a8c062","src/pipeline_cache.rs":"96a7d2a5decf61a2906fe38f73377c9b785490a9510ee51eae553aeeaef799dc","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"65711dbf7305861e2ccbc61db95a43483376ce80c4462bb23da8b995549b5a08","src/ray_tracing.rs":"ae43907290f003f6247bb599927401bd768865f7773a41c327dc73fade014ede","src/registry.rs":"2a76c6397998d263b6f6347299f04a8d27ea4df7dda200e98f205cfa3850dadb","src/resource.rs":"46bc35f20e63487a34c8a94c13c93ecdc497c72a7439465e6f736958dbb920ae","src/scratch.rs":"ea5c40e4d18a12f09cc1038f2dcdddb69b13e99275ac987d826658229a39b326","src/snatch.rs":"bf422810afd952894e365cd397763d42d6365ce3c5a5b4c1170566432f462939","src/storage.rs":"1a5bbf125a1cf65a36d8580e426ef1847c1638003fea0c6f76e309f5923b7692","src/timestamp_normalization/common.wgsl":"9f65aef0526ff9dde945fae70cef064ad961b0aee4291759ae82974cd2ead0a7","src/timestamp_normalization/mod.rs":"4fb7a4d6c53797edc9dd3893a8e25d4efeff14c4846a8927d865101a6d7594a2","src/timestamp_normalization/timestamp_normalization.wgsl":"c0225bf02fdd741542bd20664a6d9195b91936e6f7758c9c4c0ac05b08122e79","src/track/blas.rs":"18c7b5b89a60ab49bbc0f4f8b85a24502c1d968714ef4c586095e119848d902a","src/track/buffer.rs":"7f2393d16d0e8f624327c7a3a1de7176f945f3d33bfd3e12640faddc5c2c9f83","src/track/metadata.rs":"04b8bcf8ded7c7c805d9336cfc874da9d8de7d12d99f7525f0540780a1dffc45","src/track/mod.rs":"c28de55e31cdde3feb067945a04446dc5343a39418c4b9c2c76148172e7ba855","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"34e72a20364d3ce642c21b29a089811503aa2fb4e7dab1a1e20d8ddd598742d7","src/validation.rs":"f9246eed1e0573595b7af30caf7b3da8ad6ae179e0555981cf9b929717d5f286","src/validation/shader_io_deductions.rs":"351d98d2451139d5da5cdf40ecb5fe7472146c59a49092d5f76f9a389387e30a","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"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 @@ -67,7 +67,6 @@ portable-atomic = [ "dep:portable-atomic", "wgpu-hal/portable-atomic", ] -raw-window-handle = ["dep:raw-window-handle"] renderdoc = ["wgpu-core-deps-windows-linux-android/renderdoc"] replay = [ "serde", @@ -167,7 +166,6 @@ default-features = false [dependencies.raw-window-handle] version = "0.6.2" -optional = true default-features = false [dependencies.ron] diff --git a/third_party/rust/wgpu-core/src/command/mod.rs b/third_party/rust/wgpu-core/src/command/mod.rs @@ -677,10 +677,10 @@ impl InnerCommandEncoder { /// In both cases, returns a reference to the raw encoder. fn open_if_closed(&mut self) -> Result<&mut dyn hal::DynCommandEncoder, DeviceError> { if !self.is_open { - self.is_open = true; let hal_label = hal_label(Some(self.label.as_str()), self.device.instance_flags); unsafe { self.raw.begin_encoding(hal_label) } .map_err(|e| self.device.handle_hal_error(e))?; + self.is_open = true; } Ok(self.raw.as_mut()) @@ -691,10 +691,10 @@ impl InnerCommandEncoder { /// The underlying hal encoder is put in the "recording" state. pub(crate) fn open(&mut self) -> Result<&mut dyn hal::DynCommandEncoder, DeviceError> { if !self.is_open { - self.is_open = true; let hal_label = hal_label(Some(self.label.as_str()), self.device.instance_flags); unsafe { self.raw.begin_encoding(hal_label) } .map_err(|e| self.device.handle_hal_error(e))?; + self.is_open = true; } Ok(self.raw.as_mut()) @@ -713,11 +713,11 @@ impl InnerCommandEncoder { label: Option<&str>, ) -> Result<&mut dyn hal::DynCommandEncoder, DeviceError> { assert!(!self.is_open); - self.is_open = true; let hal_label = hal_label(label, self.device.instance_flags); unsafe { self.raw.begin_encoding(hal_label) } .map_err(|e| self.device.handle_hal_error(e))?; + self.is_open = true; Ok(self.raw.as_mut()) } diff --git a/third_party/rust/wgpu-core/src/device/mod.rs b/third_party/rust/wgpu-core/src/device/mod.rs @@ -539,6 +539,10 @@ pub fn create_validator( Caps::MESH_SHADER_POINT_TOPOLOGY, features.intersects(wgt::Features::EXPERIMENTAL_MESH_SHADER_POINTS), ); + caps.set( + Caps::COOPERATIVE_MATRIX, + features.intersects(wgt::Features::EXPERIMENTAL_COOPERATIVE_MATRIX), + ); naga::valid::Validator::new(flags, caps) } diff --git a/third_party/rust/wgpu-core/src/device/resource.rs b/third_party/rust/wgpu-core/src/device/resource.rs @@ -567,7 +567,7 @@ impl Device { buffer: params_buffer, usage: hal::StateTransition { from: wgt::BufferUses::MAP_WRITE, - to: wgt::BufferUses::COPY_SRC, + to: wgt::BufferUses::COPY_DST, }, }]); pending_writes.command_encoder.copy_buffer_to_buffer( @@ -3743,10 +3743,10 @@ impl Device { let final_entry_point_name; { - let stage = wgt::ShaderStages::COMPUTE; + let stage = validation::ShaderStageForValidation::Compute; final_entry_point_name = shader_module.finalize_entry_point_name( - stage, + stage.to_naga(), desc.stage.entry_point.as_ref().map(|ep| ep.as_ref()), )?; @@ -3757,7 +3757,6 @@ impl Device { &final_entry_point_name, stage, io, - None, )?; } } @@ -4141,6 +4140,14 @@ impl Device { if let Some(ds) = depth_stencil_state { target_specified = true; let error = 'error: { + if !ds.format.is_depth_stencil_format() { + // This error case is not redundant with the aspect check below when + // neither depth nor stencil is enabled at all. + break 'error Some(pipeline::DepthStencilStateError::FormatNotDepthOrStencil( + ds.format, + )); + } + let format_features = self.describe_format_features(ds.format)?; if !format_features .allowed_usages @@ -4230,17 +4237,23 @@ impl Device { pipeline::RenderPipelineVertexProcessor::Vertex(ref vertex) => { vertex_stage = { let stage_desc = &vertex.stage; - let stage = wgt::ShaderStages::VERTEX; + let stage = validation::ShaderStageForValidation::Vertex { + topology: desc.primitive.topology, + compare_function: desc.depth_stencil.as_ref().map(|d| d.depth_compare), + }; + let stage_bit = stage.to_wgt_bit(); let vertex_shader_module = &stage_desc.module; vertex_shader_module.same_device(self)?; - let stage_err = - |error| pipeline::CreateRenderPipelineError::Stage { stage, error }; + let stage_err = |error| pipeline::CreateRenderPipelineError::Stage { + stage: stage_bit, + error, + }; _vertex_entry_point_name = vertex_shader_module .finalize_entry_point_name( - stage, + stage.to_naga(), stage_desc.entry_point.as_ref().map(|ep| ep.as_ref()), ) .map_err(stage_err)?; @@ -4253,10 +4266,9 @@ impl Device { &_vertex_entry_point_name, stage, io, - desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) .map_err(stage_err)?; - validated_stages |= stage; + validated_stages |= stage_bit; } Some(hal::ProgrammableStage { module: vertex_shader_module.raw(), @@ -4272,16 +4284,19 @@ impl Device { task_stage = if let Some(task) = task { let stage_desc = &task.stage; - let stage = wgt::ShaderStages::TASK; + let stage = validation::ShaderStageForValidation::Task; + let stage_bit = stage.to_wgt_bit(); let task_shader_module = &stage_desc.module; task_shader_module.same_device(self)?; - let stage_err = - |error| pipeline::CreateRenderPipelineError::Stage { stage, error }; + let stage_err = |error| pipeline::CreateRenderPipelineError::Stage { + stage: stage_bit, + error, + }; _task_entry_point_name = task_shader_module .finalize_entry_point_name( - stage, + stage.to_naga(), stage_desc.entry_point.as_ref().map(|ep| ep.as_ref()), ) .map_err(stage_err)?; @@ -4294,10 +4309,9 @@ impl Device { &_task_entry_point_name, stage, io, - desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) .map_err(stage_err)?; - validated_stages |= stage; + validated_stages |= stage_bit; } Some(hal::ProgrammableStage { module: task_shader_module.raw(), @@ -4311,16 +4325,19 @@ impl Device { }; mesh_stage = { let stage_desc = &mesh.stage; - let stage = wgt::ShaderStages::MESH; + let stage = validation::ShaderStageForValidation::Mesh; + let stage_bit = stage.to_wgt_bit(); let mesh_shader_module = &stage_desc.module; mesh_shader_module.same_device(self)?; - let stage_err = - |error| pipeline::CreateRenderPipelineError::Stage { stage, error }; + let stage_err = |error| pipeline::CreateRenderPipelineError::Stage { + stage: stage_bit, + error, + }; _mesh_entry_point_name = mesh_shader_module .finalize_entry_point_name( - stage, + stage.to_naga(), stage_desc.entry_point.as_ref().map(|ep| ep.as_ref()), ) .map_err(stage_err)?; @@ -4333,10 +4350,9 @@ impl Device { &_mesh_entry_point_name, stage, io, - desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) .map_err(stage_err)?; - validated_stages |= stage; + validated_stages |= stage_bit; } Some(hal::ProgrammableStage { module: mesh_shader_module.raw(), @@ -4352,16 +4368,20 @@ impl Device { let fragment_entry_point_name; let fragment_stage = match desc.fragment { Some(ref fragment_state) => { - let stage = wgt::ShaderStages::FRAGMENT; + let stage = validation::ShaderStageForValidation::Fragment; + let stage_bit = stage.to_wgt_bit(); let shader_module = &fragment_state.stage.module; shader_module.same_device(self)?; - let stage_err = |error| pipeline::CreateRenderPipelineError::Stage { stage, error }; + let stage_err = |error| pipeline::CreateRenderPipelineError::Stage { + stage: stage_bit, + error, + }; fragment_entry_point_name = shader_module .finalize_entry_point_name( - stage, + stage.to_naga(), fragment_state .stage .entry_point @@ -4378,17 +4398,16 @@ impl Device { &fragment_entry_point_name, stage, io, - desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) .map_err(stage_err)?; - validated_stages |= stage; + validated_stages |= stage_bit; } if let Some(ref interface) = shader_module.interface { shader_expects_dual_source_blending = interface .fragment_uses_dual_source_blending(&fragment_entry_point_name) .map_err(|error| pipeline::CreateRenderPipelineError::Stage { - stage, + stage: stage_bit, error, })?; } diff --git a/third_party/rust/wgpu-core/src/global.rs b/third_party/rust/wgpu-core/src/global.rs @@ -33,7 +33,7 @@ pub struct Global { impl Global { pub fn new( name: &str, - instance_desc: &wgt::InstanceDescriptor, + instance_desc: wgt::InstanceDescriptor, telemetry: Option<hal::Telemetry>, ) -> Self { profiling::scope!("Global::new"); diff --git a/third_party/rust/wgpu-core/src/instance.rs b/third_party/rust/wgpu-core/src/instance.rs @@ -89,12 +89,19 @@ pub struct Instance { supported_backends: Backends, pub flags: wgt::InstanceFlags, + + /// Non-lifetimed [`raw_window_handle::DisplayHandle`], for keepalive and validation purposes in + /// [`Self::create_surface()`]. + /// + /// When used with `winit`, callers are expected to pass its `OwnedDisplayHandle` (created from + /// the `EventLoop`) here. + display: Option<Box<dyn wgt::WgpuHasDisplayHandle>>, } impl Instance { pub fn new( name: &str, - instance_desc: &wgt::InstanceDescriptor, + mut instance_desc: wgt::InstanceDescriptor, telemetry: Option<hal::Telemetry>, ) -> Self { let mut this = Self { @@ -103,18 +110,22 @@ impl Instance { requested_backends: instance_desc.backends, supported_backends: Backends::empty(), flags: instance_desc.flags, + // HACK: We must take ownership of the field here, without being able to pass it into + // try_add_hal(). Remove it from the mutable descriptor instead, while try_add_hal() + // borrows the handle from `this.display` instead. + display: instance_desc.display.take(), }; #[cfg(vulkan)] - this.try_add_hal(hal::api::Vulkan, instance_desc, telemetry); + this.try_add_hal(hal::api::Vulkan, &instance_desc, telemetry); #[cfg(metal)] - this.try_add_hal(hal::api::Metal, instance_desc, telemetry); + this.try_add_hal(hal::api::Metal, &instance_desc, telemetry); #[cfg(dx12)] - this.try_add_hal(hal::api::Dx12, instance_desc, telemetry); + this.try_add_hal(hal::api::Dx12, &instance_desc, telemetry); #[cfg(gles)] - this.try_add_hal(hal::api::Gles, instance_desc, telemetry); + this.try_add_hal(hal::api::Gles, &instance_desc, telemetry); #[cfg(feature = "noop")] - this.try_add_hal(hal::api::Noop, instance_desc, telemetry); + this.try_add_hal(hal::api::Noop, &instance_desc, telemetry); this } @@ -135,15 +146,25 @@ impl Instance { return; } + // If this was Some, it was moved into self + assert!(instance_desc.display.is_none()); + let hal_desc = hal::InstanceDescriptor { name: "wgpu", flags: self.flags, memory_budget_thresholds: instance_desc.memory_budget_thresholds, backend_options: instance_desc.backend_options.clone(), telemetry, + // Pass a borrow, the core instance here keeps the owned handle alive already + // WARNING: Using self here, not instance_desc! + display: self.display.as_ref().map(|hdh| { + hdh.display_handle() + .expect("Implementation did not provide a DisplayHandle") + }), }; use hal::Instance as _; + // SAFETY: ??? match unsafe { A::Instance::init(&hal_desc) } { Ok(instance) => { log::debug!("Instance::new: created {:?} backend", A::VARIANT); @@ -170,6 +191,7 @@ impl Instance { requested_backends: A::VARIANT.into(), supported_backends: A::VARIANT.into(), flags: wgt::InstanceFlags::default(), + display: None, // TODO: Extract display from HAL instance if available? } } @@ -208,7 +230,6 @@ impl Instance { /// - `display_handle` must be a valid object to create a surface upon. /// - `window_handle` must remain valid as long as the returned /// [`SurfaceId`] is being used. - #[cfg(feature = "raw-window-handle")] pub unsafe fn create_surface( &self, display_handle: raw_window_handle::RawDisplayHandle, @@ -216,6 +237,17 @@ impl Instance { ) -> Result<Surface, CreateSurfaceError> { profiling::scope!("Instance::create_surface"); + if let Some(instance_display_handle) = &self.display { + if instance_display_handle + .display_handle() + .expect("Implementation did not provide a DisplayHandle") + .as_raw() + != display_handle + { + return Err(CreateSurfaceError::MismatchingDisplayHandle); + } + } + let mut errors = HashMap::default(); let mut surface_per_backend = HashMap::default(); @@ -684,6 +716,10 @@ impl Adapter { unsafe { self.raw.adapter.get_presentation_timestamp() } } + pub fn cooperative_matrix_properties(&self) -> Vec<wgt::CooperativeMatrixProperties> { + self.raw.capabilities.cooperative_matrix_properties.clone() + } + pub fn get_texture_format_features( &self, format: wgt::TextureFormat, @@ -894,6 +930,8 @@ pub enum CreateSurfaceError { BackendNotEnabled(Backend), #[error("Failed to create surface for any enabled backend: {0:?}")] FailedToCreateSurfaceForAnyBackend(HashMap<Backend, hal::InstanceError>), + #[error("The display handle used to create this Instance does not match the one used to create a surface on it")] + MismatchingDisplayHandle, } impl Global { @@ -914,7 +952,6 @@ impl Global { /// - `display_handle` must be a valid object to create a surface upon. /// - `window_handle` must remain valid as long as the returned /// [`SurfaceId`] is being used. - #[cfg(feature = "raw-window-handle")] pub unsafe fn instance_create_surface( &self, display_handle: raw_window_handle::RawDisplayHandle, @@ -1114,6 +1151,14 @@ impl Global { adapter.get_presentation_timestamp() } + pub fn adapter_cooperative_matrix_properties( + &self, + adapter_id: AdapterId, + ) -> Vec<wgt::CooperativeMatrixProperties> { + let adapter = self.hub.adapters.get(adapter_id); + adapter.cooperative_matrix_properties() + } + pub fn adapter_drop(&self, adapter_id: AdapterId) { profiling::scope!("Adapter::drop"); api_log!("Adapter::drop {adapter_id:?}"); diff --git a/third_party/rust/wgpu-core/src/pipeline.rs b/third_party/rust/wgpu-core/src/pipeline.rs @@ -89,11 +89,11 @@ impl ShaderModule { pub(crate) fn finalize_entry_point_name( &self, - stage_bit: wgt::ShaderStages, + stage: naga::ShaderStage, entry_point: Option<&str>, ) -> Result<String, validation::StageError> { match &self.interface { - Some(interface) => interface.finalize_entry_point_name(stage_bit, entry_point), + Some(interface) => interface.finalize_entry_point_name(stage, entry_point), None => entry_point .map(|ep| ep.to_string()) .ok_or(validation::StageError::NoEntryPointFound), @@ -617,6 +617,8 @@ pub enum ColorStateError { pub enum DepthStencilStateError { #[error("Format {0:?} is not renderable")] FormatNotRenderable(wgt::TextureFormat), + #[error("Format {0:?} is not a depth/stencil format")] + FormatNotDepthOrStencil(wgt::TextureFormat), #[error("Format {0:?} does not have a depth aspect, but depth test/write is enabled")] FormatNotDepth(wgt::TextureFormat), #[error("Format {0:?} does not have a stencil aspect, but stencil test/write is enabled")] diff --git a/third_party/rust/wgpu-core/src/validation.rs b/third_party/rust/wgpu-core/src/validation.rs @@ -7,13 +7,19 @@ use core::fmt; use arrayvec::ArrayVec; use hashbrown::hash_map::Entry; +use shader_io_deductions::{display_deductions_as_optional_list, MaxVertexShaderOutputDeduction}; use thiserror::Error; use wgt::{ error::{ErrorType, WebGpuError}, BindGroupLayoutEntry, BindingType, }; -use crate::{device::bgl, resource::InvalidResourceError, FastHashMap, FastHashSet}; +use crate::{ + device::bgl, resource::InvalidResourceError, + validation::shader_io_deductions::MaxFragmentShaderInputDeduction, FastHashMap, FastHashSet, +}; + +pub mod shader_io_deductions; #[derive(Debug)] enum ResourceType { @@ -96,16 +102,6 @@ impl fmt::Display for NumericDimension { } } -impl NumericDimension { - fn num_components(&self) -> u32 { - match *self { - Self::Scalar => 1, - Self::Vector(size) => size as u32, - Self::Matrix(w, h) => w as u32 * h as u32, - } - } -} - #[derive(Clone, Copy, Debug)] pub struct NumericType { dim: NumericDimension, @@ -296,8 +292,6 @@ pub enum StageError { per_dimension_limit: &'static str, total_limit: &'static str, }, - #[error("Shader uses {used} inter-stage components above the limit of {limit}")] - TooManyVaryings { used: u32, limit: u32 }, #[error("Unable to find entry point '{0}'")] MissingEntryPoint(String), #[error("Shader global {0:?} is not available in the pipeline layout")] @@ -329,6 +323,55 @@ pub enum StageError { #[error(transparent)] InvalidResource(#[from] InvalidResourceError), #[error( + "vertex shader output location Location[{location}] ({var}) exceeds the \ + `max_inter_stage_shader_variables` limit ({}, 0-based){}", + // NOTE: Remember: the limit is 0-based for indices. + limit - 1, + display_deductions_as_optional_list(deductions, |d| d.for_location()) + )] + VertexOutputLocationTooLarge { + location: u32, + var: InterfaceVar, + limit: u32, + deductions: Vec<MaxVertexShaderOutputDeduction>, + }, + #[error( + "found {num_found} user-defined vertex shader output variables, which exceeds the \ + `max_inter_stage_shader_variables` limit ({limit}){}", + display_deductions_as_optional_list(deductions, |d| d.for_variables()) + )] + TooManyUserDefinedVertexOutputs { + num_found: u32, + limit: u32, + deductions: Vec<MaxVertexShaderOutputDeduction>, + }, + #[error( + "fragment shader input location Location[{location}] ({var}) exceeds the \ + `max_inter_stage_shader_variables` limit ({}, 0-based){}", + // NOTE: Remember: the limit is 0-based for indices. + limit - 1, + // NOTE: WebGPU spec. validation for fragment inputs is expressed in terms of variables + // (unlike vertex outputs), so we use `MaxFragmentShaderInputDeduction::for_variables` here + // (and not a non-existent `for_locations`). + display_deductions_as_optional_list(deductions, |d| d.for_variables()) + )] + FragmentInputLocationTooLarge { + location: u32, + var: InterfaceVar, + limit: u32, + deductions: Vec<MaxFragmentShaderInputDeduction>, + }, + #[error( + "found {num_found} user-defined fragment shader input variables, which exceeds the \ + `max_inter_stage_shader_variables` limit ({limit}){}", + display_deductions_as_optional_list(deductions, |d| d.for_variables()) + )] + TooManyUserDefinedFragmentInputs { + num_found: u32, + limit: u32, + deductions: Vec<MaxFragmentShaderInputDeduction>, + }, + #[error( "Location[{location}] {var}'s index exceeds the `max_color_attachments` limit ({limit})" )] ColorAttachmentLocationTooLarge { @@ -371,10 +414,13 @@ impl WebGpuError for StageError { error, } => error, Self::InvalidWorkgroupSize { .. } - | Self::TooManyVaryings { .. } | Self::MissingEntryPoint(..) | Self::NoEntryPointFound | Self::MultipleEntryPointsFound + | Self::VertexOutputLocationTooLarge { .. } + | Self::TooManyUserDefinedVertexOutputs { .. } + | Self::FragmentInputLocationTooLarge { .. } + | Self::TooManyUserDefinedFragmentInputs { .. } | Self::ColorAttachmentLocationTooLarge { .. } | Self::TooManyMeshVertices { .. } | Self::TooManyMeshPrimitives { .. } @@ -1148,10 +1194,9 @@ impl Interface { pub fn finalize_entry_point_name( &self, - stage_bit: wgt::ShaderStages, + stage: naga::ShaderStage, entry_point_name: Option<&str>, ) -> Result<String, StageError> { - let stage = Self::shader_stage_from_stage_bit(stage_bit); entry_point_name .map(|ep| ep.to_string()) .map(Ok) @@ -1168,36 +1213,27 @@ impl Interface { }) } - pub(crate) fn shader_stage_from_stage_bit(stage_bit: wgt::ShaderStages) -> naga::ShaderStage { - match stage_bit { - wgt::ShaderStages::VERTEX => naga::ShaderStage::Vertex, - wgt::ShaderStages::FRAGMENT => naga::ShaderStage::Fragment, - wgt::ShaderStages::COMPUTE => naga::ShaderStage::Compute, - wgt::ShaderStages::MESH => naga::ShaderStage::Mesh, - wgt::ShaderStages::TASK => naga::ShaderStage::Task, - _ => unreachable!(), - } - } - + /// Among other things, this implements some validation logic defined by the WebGPU spec. at + /// <https://www.w3.org/TR/webgpu/#abstract-opdef-validating-inter-stage-interfaces>. pub fn check_stage( &self, layouts: &mut BindingLayoutSource<'_>, shader_binding_sizes: &mut FastHashMap<naga::ResourceBinding, wgt::BufferSize>, entry_point_name: &str, - stage_bit: wgt::ShaderStages, + shader_stage: ShaderStageForValidation, inputs: StageIo, - compare_function: Option<wgt::CompareFunction>, ) -> Result<StageIo, StageError> { // Since a shader module can have multiple entry points with the same name, // we need to look for one with the right execution model. - let shader_stage = Self::shader_stage_from_stage_bit(stage_bit); - let pair = (shader_stage, entry_point_name.to_string()); + let pair = (shader_stage.to_naga(), entry_point_name.to_string()); let entry_point = match self.entry_points.get(&pair) { Some(some) => some, None => return Err(StageError::MissingEntryPoint(pair.1)), }; let (_, entry_point_name) = pair; + let stage_bit = shader_stage.to_wgt_bit(); + // check resources visibility for &handle in entry_point.resources.iter() { let res = &self.resources[handle]; @@ -1319,13 +1355,13 @@ impl Interface { } // check workgroup size limits - if shader_stage.compute_like() { + if shader_stage.to_naga().compute_like() { let ( max_workgroup_size_limits, max_workgroup_size_total, per_dimension_limit, total_limit, - ) = match shader_stage { + ) = match shader_stage.to_naga() { naga::ShaderStage::Compute => ( [ self.limits.max_compute_workgroup_size_x, @@ -1377,7 +1413,6 @@ impl Interface { } } - let mut inter_stage_components = 0; let mut this_stage_primitive_index = false; let mut has_draw_id = false; @@ -1390,38 +1425,36 @@ impl Interface { .get(&location) .ok_or(InputError::Missing) .and_then(|provided| { - let (compatible, num_components, per_primitive_correct) = - match shader_stage { - // For vertex attributes, there are defaults filled out - // by the driver if data is not provided. - naga::ShaderStage::Vertex => { - let is_compatible = - iv.ty.scalar.kind == provided.ty.scalar.kind; - // vertex inputs don't count towards inter-stage - (is_compatible, 0, !iv.per_primitive) + let (compatible, per_primitive_correct) = match shader_stage.to_naga() { + // For vertex attributes, there are defaults filled out + // by the driver if data is not provided. + naga::ShaderStage::Vertex => { + let is_compatible = + iv.ty.scalar.kind == provided.ty.scalar.kind; + // vertex inputs don't count towards inter-stage + (is_compatible, !iv.per_primitive) + } + naga::ShaderStage::Fragment => { + if iv.interpolation != provided.interpolation { + return Err(InputError::InterpolationMismatch( + provided.interpolation, + )); } - naga::ShaderStage::Fragment => { - if iv.interpolation != provided.interpolation { - return Err(InputError::InterpolationMismatch( - provided.interpolation, - )); - } - if iv.sampling != provided.sampling { - return Err(InputError::SamplingMismatch( - provided.sampling, - )); - } - ( - iv.ty.is_subtype_of(&provided.ty), - iv.ty.dim.num_components(), - iv.per_primitive == provided.per_primitive, - ) + if iv.sampling != provided.sampling { + return Err(InputError::SamplingMismatch( + provided.sampling, + )); } - // These can't have varying inputs - naga::ShaderStage::Compute - | naga::ShaderStage::Task - | naga::ShaderStage::Mesh => (false, 0, false), - }; + ( + iv.ty.is_subtype_of(&provided.ty), + iv.per_primitive == provided.per_primitive, + ) + } + // These can't have varying inputs + naga::ShaderStage::Compute + | naga::ShaderStage::Task + | naga::ShaderStage::Mesh => (false, false), + }; if !compatible { return Err(InputError::WrongType(provided.ty)); } else if !per_primitive_correct { @@ -1430,19 +1463,15 @@ impl Interface { shader: iv.per_primitive, }); } - Ok(num_components) + Ok(()) + }); + + if let Err(error) = result { + return Err(StageError::Input { + location, + var: iv.clone(), + error, }); - match result { - Ok(num_components) => { - inter_stage_components += num_components; - } - Err(error) => { - return Err(StageError::Input { - location, - var: iv.clone(), - error, - }) - } } } Varying::BuiltIn(naga::BuiltIn::PrimitiveIndex) => { @@ -1456,12 +1485,49 @@ impl Interface { } match shader_stage { - naga::ShaderStage::Vertex => { + ShaderStageForValidation::Vertex { + topology, + compare_function, + } => { + let mut max_vertex_shader_output_variables = + self.limits.max_inter_stage_shader_variables; + let mut max_vertex_shader_output_location = max_vertex_shader_output_variables - 1; + + let point_list_deduction = if topology == wgt::PrimitiveTopology::PointList { + Some(MaxVertexShaderOutputDeduction::PointListPrimitiveTopology) + } else { + None + }; + + let deductions = point_list_deduction.into_iter(); + + for deduction in deductions.clone() { + // NOTE: Deductions, in the current version of the spec. we implement, do not + // ever exceed the minimum variables available. + max_vertex_shader_output_variables = max_vertex_shader_output_variables + .checked_sub(deduction.for_variables()) + .unwrap(); + max_vertex_shader_output_location = max_vertex_shader_output_location + .checked_sub(deduction.for_location()) + .unwrap(); + } + + let mut num_user_defined_outputs = 0; + for output in entry_point.outputs.iter() { - //TODO: count builtins towards the limit? - inter_stage_components += match *output { - Varying::Local { ref iv, .. } => iv.ty.dim.num_components(), - Varying::BuiltIn(_) => 0, + match *output { + Varying::Local { ref iv, location } => { + if location > max_vertex_shader_output_location { + return Err(StageError::VertexOutputLocationTooLarge { + location, + var: iv.clone(), + limit: self.limits.max_inter_stage_shader_variables, + deductions: deductions.collect(), + }); + } + num_user_defined_outputs += 1; + } + Varying::BuiltIn(_) => {} }; if let Some( @@ -1488,8 +1554,71 @@ impl Interface { } } } + + if num_user_defined_outputs > max_vertex_shader_output_variables { + return Err(StageError::TooManyUserDefinedVertexOutputs { + num_found: num_user_defined_outputs, + limit: self.limits.max_inter_stage_shader_variables, + deductions: deductions.collect(), + }); + } } - naga::ShaderStage::Fragment => { + ShaderStageForValidation::Fragment => { + let mut max_fragment_shader_input_variables = + self.limits.max_inter_stage_shader_variables; + + let deductions = entry_point.inputs.iter().filter_map(|output| match output { + Varying::Local { .. } => None, + Varying::BuiltIn(builtin) => { + MaxFragmentShaderInputDeduction::from_inter_stage_builtin(*builtin).or_else( + || { + unreachable!( + concat!( + "unexpected built-in provided; ", + "{:?} is not used for fragment stage input", + ), + builtin + ) + }, + ) + } + }); + + for deduction in deductions.clone() { + // NOTE: Deductions, in the current version of the spec. we implement, do not + // ever exceed the minimum variables available. + max_fragment_shader_input_variables = max_fragment_shader_input_variables + .checked_sub(deduction.for_variables()) + .unwrap(); + } + + let mut num_user_defined_inputs = 0; + + for output in entry_point.inputs.iter() { + match *output { + Varying::Local { ref iv, location } => { + if location >= max_fragment_shader_input_variables { + return Err(StageError::FragmentInputLocationTooLarge { + location, + var: iv.clone(), + limit: self.limits.max_inter_stage_shader_variables, + deductions: deductions.collect(), + }); + } + num_user_defined_inputs += 1; + } + Varying::BuiltIn(_) => {} + }; + } + + if num_user_defined_inputs > max_fragment_shader_input_variables { + return Err(StageError::TooManyUserDefinedFragmentInputs { + num_found: num_user_defined_inputs, + limit: self.limits.max_inter_stage_shader_variables, + deductions: deductions.collect(), + }); + } + for output in &entry_point.outputs { let &Varying::Local { location, ref iv } = output else { continue; @@ -1506,13 +1635,6 @@ impl Interface { _ => (), } - if inter_stage_components > self.limits.max_inter_stage_shader_components { - return Err(StageError::TooManyVaryings { - used: inter_stage_components, - limit: self.limits.max_inter_stage_shader_components, - }); - } - if let Some(ref mesh_info) = entry_point.mesh_info { if mesh_info.max_vertices > self.limits.max_mesh_output_vertices { return Err(StageError::TooManyMeshVertices { @@ -1535,7 +1657,7 @@ impl Interface { }); } } - if shader_stage == naga::ShaderStage::Mesh + if shader_stage.to_naga() == naga::ShaderStage::Mesh && entry_point.task_payload_size != inputs.task_payload_size { return Err(StageError::TaskPayloadMustMatch { @@ -1545,18 +1667,18 @@ impl Interface { } // Fragment shader primitive index is treated like a varying - if shader_stage == naga::ShaderStage::Fragment + if shader_stage.to_naga() == naga::ShaderStage::Fragment && this_stage_primitive_index && inputs.primitive_index == Some(false) { return Err(StageError::InvalidPrimitiveIndex); - } else if shader_stage == naga::ShaderStage::Fragment + } else if shader_stage.to_naga() == naga::ShaderStage::Fragment && !this_stage_primitive_index && inputs.primitive_index == Some(true) { return Err(StageError::MissingPrimitiveIndex); } - if shader_stage == naga::ShaderStage::Mesh + if shader_stage.to_naga() == naga::ShaderStage::Mesh && inputs.task_payload_size.is_some() && has_draw_id { @@ -1575,7 +1697,7 @@ impl Interface { Ok(StageIo { task_payload_size: entry_point.task_payload_size, varyings: outputs, - primitive_index: if shader_stage == naga::ShaderStage::Mesh { + primitive_index: if shader_stage.to_naga() == naga::ShaderStage::Mesh { Some(this_stage_primitive_index) } else { None @@ -1624,3 +1746,36 @@ pub fn validate_color_attachment_bytes_per_sample( Ok(()) } + +pub enum ShaderStageForValidation { + Vertex { + topology: wgt::PrimitiveTopology, + compare_function: Option<wgt::CompareFunction>, + }, + Mesh, + Fragment, + Compute, + Task, +} + +impl ShaderStageForValidation { + pub fn to_naga(&self) -> naga::ShaderStage { + match self { + Self::Vertex { .. } => naga::ShaderStage::Vertex, + Self::Mesh => naga::ShaderStage::Mesh, + Self::Fragment => naga::ShaderStage::Fragment, + Self::Compute => naga::ShaderStage::Compute, + Self::Task => naga::ShaderStage::Task, + } + } + + pub fn to_wgt_bit(&self) -> wgt::ShaderStages { + match self { + Self::Vertex { .. } => wgt::ShaderStages::VERTEX, + Self::Mesh { .. } => wgt::ShaderStages::MESH, + Self::Fragment { .. } => wgt::ShaderStages::FRAGMENT, + Self::Compute => wgt::ShaderStages::COMPUTE, + Self::Task => wgt::ShaderStages::TASK, + } + } +} diff --git a/third_party/rust/wgpu-core/src/validation/shader_io_deductions.rs b/third_party/rust/wgpu-core/src/validation/shader_io_deductions.rs @@ -0,0 +1,156 @@ +use core::fmt::{self, Debug, Display, Formatter}; + +#[cfg(doc)] +#[expect(unused_imports)] +use crate::validation::StageError; + +/// Max shader I/O variable deductions for vertex shader output. Used by +/// [`StageError::TooManyUserDefinedVertexOutputs`] and +/// [`StageError::VertexOutputLocationTooLarge`]. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MaxVertexShaderOutputDeduction { + /// When a pipeline's [`crate::pipeline::RenderPipelineDescriptor::primitive`] is set to + /// [`wgt::PrimitiveTopology::PointList`]. + PointListPrimitiveTopology, +} + +impl MaxVertexShaderOutputDeduction { + pub fn for_variables(self) -> u32 { + match self { + Self::PointListPrimitiveTopology => 1, + } + } + + pub fn for_location(self) -> u32 { + match self { + Self::PointListPrimitiveTopology => 0, + } + } +} + +/// Max shader I/O variable deductions for vertex shader output. Used by +/// [`StageError::TooManyUserDefinedFragmentInputs`] and +/// [`StageError::FragmentInputLocationTooLarge`]. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MaxFragmentShaderInputDeduction { + InterStageBuiltIn(InterStageBuiltIn), +} + +impl MaxFragmentShaderInputDeduction { + pub fn for_variables(self) -> u32 { + match self { + Self::InterStageBuiltIn(builtin) => match builtin { + InterStageBuiltIn::FrontFacing + | InterStageBuiltIn::SampleIndex + | InterStageBuiltIn::SampleMask + | InterStageBuiltIn::PrimitiveIndex + | InterStageBuiltIn::SubgroupInvocationId + | InterStageBuiltIn::SubgroupSize + | InterStageBuiltIn::ViewIndex + | InterStageBuiltIn::PointCoord => 1, + InterStageBuiltIn::Barycentric => 3, + InterStageBuiltIn::Position => 4, + }, + } + } + + pub fn from_inter_stage_builtin(builtin: naga::BuiltIn) -> Option<Self> { + use naga::BuiltIn; + + Some(Self::InterStageBuiltIn(match builtin { + BuiltIn::FrontFacing => InterStageBuiltIn::FrontFacing, + BuiltIn::SampleIndex => InterStageBuiltIn::SampleIndex, + BuiltIn::SampleMask => InterStageBuiltIn::SampleMask, + BuiltIn::PrimitiveIndex => InterStageBuiltIn::PrimitiveIndex, + BuiltIn::SubgroupSize => InterStageBuiltIn::SubgroupSize, + BuiltIn::SubgroupInvocationId => InterStageBuiltIn::SubgroupInvocationId, + + BuiltIn::PointCoord => InterStageBuiltIn::PointCoord, + BuiltIn::Barycentric => InterStageBuiltIn::Barycentric, + BuiltIn::Position { .. } => InterStageBuiltIn::Position, + BuiltIn::ViewIndex => InterStageBuiltIn::ViewIndex, + + BuiltIn::BaseInstance + | BuiltIn::BaseVertex + | BuiltIn::ClipDistance + | BuiltIn::CullDistance + | BuiltIn::InstanceIndex + | BuiltIn::PointSize + | BuiltIn::VertexIndex + | BuiltIn::DrawID + | BuiltIn::FragDepth + | BuiltIn::GlobalInvocationId + | BuiltIn::LocalInvocationId + | BuiltIn::LocalInvocationIndex + | BuiltIn::WorkGroupId + | BuiltIn::WorkGroupSize + | BuiltIn::NumWorkGroups + | BuiltIn::NumSubgroups + | BuiltIn::SubgroupId + | BuiltIn::MeshTaskSize + | BuiltIn::CullPrimitive + | BuiltIn::PointIndex + | BuiltIn::LineIndices + | BuiltIn::TriangleIndices + | BuiltIn::VertexCount + | BuiltIn::Vertices + | BuiltIn::PrimitiveCount + | BuiltIn::Primitives => return None, + })) + } +} + +/// A [`naga::BuiltIn`] that counts towards +/// a [`MaxFragmentShaderInputDeduction::InterStageBuiltIn`]. +/// +/// See also <https://www.w3.org/TR/webgpu/#inter-stage-builtins>. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum InterStageBuiltIn { + // Standard for WebGPU + FrontFacing, + SampleIndex, + SampleMask, + PrimitiveIndex, + SubgroupInvocationId, + SubgroupSize, + + // Non-standard + PointCoord, + Barycentric, + Position, + ViewIndex, +} + +pub(in crate::validation) fn display_deductions_as_optional_list<T>( + deductions: &[T], + accessor: fn(&T) -> u32, +) -> impl Display + '_ +where + T: Debug, +{ + struct DisplayFromFn<F>(F); + + impl<F> Display for DisplayFromFn<F> + where + F: Fn(&mut Formatter<'_>) -> fmt::Result, + { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + let Self(inner) = self; + inner(f) + } + } + + DisplayFromFn(move |f: &mut Formatter<'_>| { + let relevant_deductions = deductions + .iter() + .map(|deduction| (deduction, accessor(deduction))) + .filter(|(_, effective_deduction)| *effective_deduction > 0); + if relevant_deductions.clone().next().is_some() { + writeln!(f, "; note that some deductions apply during validation:")?; + for deduction in deductions { + writeln!(f, "\n- {deduction:?}: {}", accessor(deduction))?; + } + } + Ok(()) + }) +} diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"da95b276985ef9f6846fc2a3741036c2213920a4fcc339fe7a6b6f7a8bf9cfe6","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","README.md":"cf9e84804a635e4a8a9fefc596be9da6bf7354dde0d105e27d56a12cb20dd8e3","build.rs":"92e5ba25cb39fb1eb568ffc84e417d5f272a52a4f7128488c42c26f1f0428a7e","examples/halmark/main.rs":"96c3b9b9ec07cc410cd2e538294808d7b8d83a4253fb4169bd787d99ef700256","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"7583874835f178f49c9784f669e53fd22256d06d8b2d0fd8d284b09d0eb56925","examples/ray-traced-triangle/main.rs":"b4435d6df8c9ee69e30a0ea7f8392bea5925fe32b58cb999b6f0fb957af953d1","examples/ray-traced-triangle/shader.wgsl":"90a66ffa57a642fd806a5b3c96347448158cd562d8951b5afd067bfd0b3d1e98","src/auxil/dxgi/conv.rs":"3ca856c93916c0be714924ff077aa1f366be5557cc164210154d252e7e49fb77","src/auxil/dxgi/exception.rs":"0eafc977390cf76b6ab92697a60de05b8fd61fbad5f3d3ea0649d6e93777e1bc","src/auxil/dxgi/factory.rs":"81e479e550a09127384d8080e43d5f5bae8e8dda6082fe41a87bea8f872eb0f1","src/auxil/dxgi/mod.rs":"e6c5cc3b73bb97742135d6f35308c42f0822304764978fb8dabb0e848863352a","src/auxil/dxgi/name.rs":"ff942da0da1a497ee4d2be21604f7ba9fae963588105b3d1f63aae1a0c536e82","src/auxil/dxgi/result.rs":"e7a9dfb48d8ef8cbe58b28b1ace5caf7818ee50505ba3220bb0509e66ae469b7","src/auxil/dxgi/time.rs":"b6911800be3873cbe277b2534b3839c6f005f3d9a09341aace4752e207d584a2","src/auxil/mod.rs":"87f8ebf431175d008e0400c569c5a76c419a7400fa61649687b23de97a4a3705","src/auxil/renderdoc.rs":"94898f747476e269b2910d42e769f2bbb6be0cb466ad92f9d381f55799d2756e","src/dx12/adapter.rs":"82330954cbc52e7a6aedc0f317d658d52f4be83882a08fdf91022f002d274edf","src/dx12/command.rs":"3d3c61140d1003252d887ee0f4870bd9cfbedccfd5f4ae8b949ab0151648823b","src/dx12/conv.rs":"a320fca45fd1990762ff10dad1d8bbb29833d9b693b0887bf2898021a737612c","src/dx12/dcomp.rs":"053068fbd393a4b8610c7070a72e5887f0fe09b61d35d2be806083d800b48b08","src/dx12/descriptor.rs":"ccd4feb6bd3e0a0ffc26142f8a81fca26180d0f50146b6eb2f670cbc89ea7064","src/dx12/device.rs":"6b559e95a819269a5bdb84563604242bf532822ae1dee40a1d22133ae92108e2","src/dx12/instance.rs":"994484b3909e2507b8ed450fc0a5ac69a3f21a0c66a6e7183d76ae4bf1a2c8ad","src/dx12/mod.rs":"44fdc829d9ede4820211d40706e63beec2f1cb556e9642cd7dd0661156aa56dc","src/dx12/pipeline_desc.rs":"631c72108f6735debe9f7059e22574ad50b11aca4dc0ca804e6d89b1373d19ff","src/dx12/sampler.rs":"d18d243efe4fa667dbab5b75b5b91d47de94d441976d9f44a46a2b49ba38473d","src/dx12/shader_compilation.rs":"a0ce9ca4b9143715ffc4b45a56a18182d54b118161553173c1a546cc6041560c","src/dx12/suballocation.rs":"3abbde338015079fe366c5b76bd155b2c41b31ea5b44b7a67ad42f2c43545239","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"79b3f7331d9795e60f9b53023cbf0df46c3a05b1e8bd5c7bcca8acdd235b124f","src/dynamic/adapter.rs":"e93f7d082a3950c9e8ccff8a631d251c7598b4b25dda9fe6347dadfa3ba07829","src/dynamic/command.rs":"90cb8c795af62a39a4488659dc5d482e8738a494a975d123bcd764cdaecebfc6","src/dynamic/device.rs":"d521f90344bfe54538888a8649500c748d656b1b7668acf4f56af6e17461e83a","src/dynamic/instance.rs":"7b515c201e1ca24f24439544dbfa1d19ea1412a4f89bd803e009aed13b021e55","src/dynamic/mod.rs":"2577d3aef6441f5b42b427d80ba3cf7fee2a97b2fc12335a1fba383e8a79a9b2","src/dynamic/queue.rs":"d76abb4797e90253386d24584f186dbe1909e772560156b2e891fa043cfefbdc","src/dynamic/surface.rs":"4328c2fe86931f50aa00ac3d6982d0879b774eebf7a507903d1b1898c891fb4d","src/gles/adapter.rs":"9a39f0a589d28144c715319b6a4907c671a2ede69bf34a21483852238a78f917","src/gles/command.rs":"fec58151673a12aff619eaa495d34e39da0af428dac26f4087bb990cd1019261","src/gles/conv.rs":"1013e1e48bc6b5b0df60a026251b97653528b112600eb3f8d4e905dbf791d897","src/gles/device.rs":"c2be98d957f8a13689bb23b16300f9deb6c1d7def016ef414c0592aa2d2ab40d","src/gles/egl.rs":"1d8c984ca3c7d70f2f2cd284e6585a549d7f1e33c5bc86bf35de98485f61c06f","src/gles/emscripten.rs":"316d2bb6f2a4bb126dbe68a223f7393399080d116b61c39504454acdf4f9cfaf","src/gles/fence.rs":"a2e7b6abd2fd4a438de90b9f58452c64cd8bba83999c90fd6390e3db128b9c6c","src/gles/mod.rs":"21b3402a396c91d3168e3c42ec9e43cf33991f362a7d59638c23e1e1a34602f2","src/gles/queue.rs":"949c132a5e7ebc65b5da1b007f90503fd9d080021b3335c884b556b120c150ab","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":"cb5940bf7b2381811675011b640040274f407a7d1908d0f82c813d6a9d3b00f7","src/gles/wgl.rs":"d98495ae9866e71fecdbd5fadd6be4e87f4d61c6981f44368893129a128cc659","src/lib.rs":"7455991893b42874d09444d54931da781cae27f71e780f21911158037305cd6d","src/metal/adapter.rs":"bda1ac5c6bb4dc5edcc123a02105159c45904f2649dcbd5fcd3e14645a734a32","src/metal/command.rs":"1eef7886ee0423de4015ff91a14c95db72c51d552c3fd90112c6143e23cb387c","src/metal/conv.rs":"85e8168be334ba24d109575a0a7e91b2ad3459403173e99e5cdd5d977cc5c18f","src/metal/device.rs":"801d02d1291827219340fb2b2e4603ffb1f14a5a91cd8ba8f285c580aab255ea","src/metal/layer_observer.rs":"8370a6e443d01739b951b8538ee719a03b69fc0cbac92c748db418fbcc8837b5","src/metal/mod.rs":"733b8c584f18dbc445b0603d9664d4dc1410efe95c7cd0ce54908e7621605605","src/metal/surface.rs":"b002e2665704c220bb06f352a6e840290ac07d6aa4bbd236f7532fedae0d0e5f","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/noop/buffer.rs":"b5edc5e2c52287dfbd4f619e36097ac233041eb9ab287b889b6ee477d740fa09","src/noop/command.rs":"2b6c04bb4cd7b7a1f40433266767698e01ed725a9cec42a6c16834c3a369cc67","src/noop/mod.rs":"45fb2426cc02f7ffe71d217055cc0569e0829a386fbe1ddfba3df5dc7a3df7af","src/validation_canary.rs":"2e8f84e5f85671b3e55ddd410476171c762e34cbea315b37921cbb6ff18bfb4f","src/vulkan/adapter.rs":"ad944471311577f1de081f21b1107cde35658c4fab10f6d33d730882eaca8f09","src/vulkan/command.rs":"d38772cdbaa63eb87a84b0b31ffec0848c70ffc8f26b2743ec7f9e51ed39db36","src/vulkan/conv.rs":"237289e3a9403a194482559d9f361c7758e35c61bc916283c2fa7d79081b15fc","src/vulkan/device.rs":"4b849b404e5277909ee81b0e317facacdc18cc066e0177c62be52cb152544ee1","src/vulkan/drm.rs":"45f7bf1dd854688a65261e4674d80f90c997b193a162fd2ae658acf4e2003552","src/vulkan/instance.rs":"3afdd04742c4b2588be421d644de70eba47901cb165de4c0528bc425fed6652a","src/vulkan/mod.rs":"452ea5f33ad883ce6d085e7c3ccc96e9ebef8cc83f0b29d459e2bd9c8943f78b","src/vulkan/sampler.rs":"f65729d6df5cce681b7756b3e48074017f0c7f42da69ca55e26cc723cd14ad59","src/vulkan/semaphore_list.rs":"6e548d810d75daf5ed31b6e520ece32c8ef97e4b66926c17f0d4317f355802e5","src/vulkan/swapchain/mod.rs":"1baef6ef36d005fe03b27ea15a91d1c5c7114eb7f777a50e67ca5f448a53291b","src/vulkan/swapchain/native.rs":"fc05951f4bf49074fab510f9706689ac74edf4478bae049af054e8735f247a56"},"package":null} -\ No newline at end of file +{"files":{"Cargo.toml":"4791472d8972d115097b69a465bf3ff2697956805a3bfa422d5c04423d3a9cb7","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","README.md":"cf9e84804a635e4a8a9fefc596be9da6bf7354dde0d105e27d56a12cb20dd8e3","build.rs":"92e5ba25cb39fb1eb568ffc84e417d5f272a52a4f7128488c42c26f1f0428a7e","examples/halmark/main.rs":"71e83a4d9759adc8073a137b136a5c18d6914946d7005b0feb2abffd632e8691","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"7583874835f178f49c9784f669e53fd22256d06d8b2d0fd8d284b09d0eb56925","examples/ray-traced-triangle/main.rs":"ed7b940951b2dc91b7ebedbe0f7784c6cfe43bafe3ef818880a5541efb6f9fbc","examples/ray-traced-triangle/shader.wgsl":"90a66ffa57a642fd806a5b3c96347448158cd562d8951b5afd067bfd0b3d1e98","src/auxil/dxgi/conv.rs":"3ca856c93916c0be714924ff077aa1f366be5557cc164210154d252e7e49fb77","src/auxil/dxgi/exception.rs":"0eafc977390cf76b6ab92697a60de05b8fd61fbad5f3d3ea0649d6e93777e1bc","src/auxil/dxgi/factory.rs":"81e479e550a09127384d8080e43d5f5bae8e8dda6082fe41a87bea8f872eb0f1","src/auxil/dxgi/mod.rs":"e6c5cc3b73bb97742135d6f35308c42f0822304764978fb8dabb0e848863352a","src/auxil/dxgi/name.rs":"ff942da0da1a497ee4d2be21604f7ba9fae963588105b3d1f63aae1a0c536e82","src/auxil/dxgi/result.rs":"e7a9dfb48d8ef8cbe58b28b1ace5caf7818ee50505ba3220bb0509e66ae469b7","src/auxil/dxgi/time.rs":"b6911800be3873cbe277b2534b3839c6f005f3d9a09341aace4752e207d584a2","src/auxil/mod.rs":"87f8ebf431175d008e0400c569c5a76c419a7400fa61649687b23de97a4a3705","src/auxil/renderdoc.rs":"94898f747476e269b2910d42e769f2bbb6be0cb466ad92f9d381f55799d2756e","src/dx12/adapter.rs":"4c2e28a5cd17e614ed7ce3517c4655be9d22b76b5417c694d0c272b443e1620c","src/dx12/command.rs":"3d3c61140d1003252d887ee0f4870bd9cfbedccfd5f4ae8b949ab0151648823b","src/dx12/conv.rs":"a320fca45fd1990762ff10dad1d8bbb29833d9b693b0887bf2898021a737612c","src/dx12/dcomp.rs":"053068fbd393a4b8610c7070a72e5887f0fe09b61d35d2be806083d800b48b08","src/dx12/descriptor.rs":"ccd4feb6bd3e0a0ffc26142f8a81fca26180d0f50146b6eb2f670cbc89ea7064","src/dx12/device.rs":"6b559e95a819269a5bdb84563604242bf532822ae1dee40a1d22133ae92108e2","src/dx12/instance.rs":"110b2ecb08d5e5c0e6424b0c7ffec3d8925646feaaf91ae1f1042437fd2981d5","src/dx12/mod.rs":"44fdc829d9ede4820211d40706e63beec2f1cb556e9642cd7dd0661156aa56dc","src/dx12/pipeline_desc.rs":"631c72108f6735debe9f7059e22574ad50b11aca4dc0ca804e6d89b1373d19ff","src/dx12/sampler.rs":"d18d243efe4fa667dbab5b75b5b91d47de94d441976d9f44a46a2b49ba38473d","src/dx12/shader_compilation.rs":"a0ce9ca4b9143715ffc4b45a56a18182d54b118161553173c1a546cc6041560c","src/dx12/suballocation.rs":"3abbde338015079fe366c5b76bd155b2c41b31ea5b44b7a67ad42f2c43545239","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"79b3f7331d9795e60f9b53023cbf0df46c3a05b1e8bd5c7bcca8acdd235b124f","src/dynamic/adapter.rs":"e93f7d082a3950c9e8ccff8a631d251c7598b4b25dda9fe6347dadfa3ba07829","src/dynamic/command.rs":"90cb8c795af62a39a4488659dc5d482e8738a494a975d123bcd764cdaecebfc6","src/dynamic/device.rs":"d521f90344bfe54538888a8649500c748d656b1b7668acf4f56af6e17461e83a","src/dynamic/instance.rs":"7b515c201e1ca24f24439544dbfa1d19ea1412a4f89bd803e009aed13b021e55","src/dynamic/mod.rs":"2577d3aef6441f5b42b427d80ba3cf7fee2a97b2fc12335a1fba383e8a79a9b2","src/dynamic/queue.rs":"d76abb4797e90253386d24584f186dbe1909e772560156b2e891fa043cfefbdc","src/dynamic/surface.rs":"4328c2fe86931f50aa00ac3d6982d0879b774eebf7a507903d1b1898c891fb4d","src/gles/adapter.rs":"996975f5d664094b1b72edf1a6784b69e5d54da296a5b0e6d52eebcb8ba0a36c","src/gles/command.rs":"fec58151673a12aff619eaa495d34e39da0af428dac26f4087bb990cd1019261","src/gles/conv.rs":"1013e1e48bc6b5b0df60a026251b97653528b112600eb3f8d4e905dbf791d897","src/gles/device.rs":"c2be98d957f8a13689bb23b16300f9deb6c1d7def016ef414c0592aa2d2ab40d","src/gles/egl.rs":"95614cf3aa2a260e82850bbd2895a205d3679b7a8b0296957f15c04bd693ad53","src/gles/emscripten.rs":"316d2bb6f2a4bb126dbe68a223f7393399080d116b61c39504454acdf4f9cfaf","src/gles/fence.rs":"a2e7b6abd2fd4a438de90b9f58452c64cd8bba83999c90fd6390e3db128b9c6c","src/gles/mod.rs":"21b3402a396c91d3168e3c42ec9e43cf33991f362a7d59638c23e1e1a34602f2","src/gles/queue.rs":"949c132a5e7ebc65b5da1b007f90503fd9d080021b3335c884b556b120c150ab","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":"7ce662d1cab08f92e2ecac4a4407ba037c80f9ac2c953f71ac4e53d33b736a37","src/gles/wgl.rs":"61082a0139d34d5f06906477f80727a01fba094181223725d5ded2d7d1a8992a","src/lib.rs":"d84bcbfabd9c58c4f222e7daff332ce4ffcbb66408630f65c052e920e11d696c","src/metal/adapter.rs":"846d0fb5655a972f541f5cd17a318e7d4e1e271c55518f1dddc0abd3ef67b180","src/metal/command.rs":"1eef7886ee0423de4015ff91a14c95db72c51d552c3fd90112c6143e23cb387c","src/metal/conv.rs":"85e8168be334ba24d109575a0a7e91b2ad3459403173e99e5cdd5d977cc5c18f","src/metal/device.rs":"801d02d1291827219340fb2b2e4603ffb1f14a5a91cd8ba8f285c580aab255ea","src/metal/layer_observer.rs":"8370a6e443d01739b951b8538ee719a03b69fc0cbac92c748db418fbcc8837b5","src/metal/mod.rs":"5fa522fb90fa7f90b67551904c233daf6c6c24082fc6f262da40ae6aed79657c","src/metal/surface.rs":"b002e2665704c220bb06f352a6e840290ac07d6aa4bbd236f7532fedae0d0e5f","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/noop/buffer.rs":"b5edc5e2c52287dfbd4f619e36097ac233041eb9ab287b889b6ee477d740fa09","src/noop/command.rs":"2b6c04bb4cd7b7a1f40433266767698e01ed725a9cec42a6c16834c3a369cc67","src/noop/mod.rs":"97b17b0b20db1ec4fb43dec3c7dac73f20c2823cb324cd9c948c469220aff70e","src/validation_canary.rs":"2e8f84e5f85671b3e55ddd410476171c762e34cbea315b37921cbb6ff18bfb4f","src/vulkan/adapter.rs":"cbfff171629961dbb58893a6ed2f1bf5046fa56aa3fb0398b8d2498a8cf1952b","src/vulkan/command.rs":"d38772cdbaa63eb87a84b0b31ffec0848c70ffc8f26b2743ec7f9e51ed39db36","src/vulkan/conv.rs":"237289e3a9403a194482559d9f361c7758e35c61bc916283c2fa7d79081b15fc","src/vulkan/device.rs":"4b849b404e5277909ee81b0e317facacdc18cc066e0177c62be52cb152544ee1","src/vulkan/drm.rs":"45f7bf1dd854688a65261e4674d80f90c997b193a162fd2ae658acf4e2003552","src/vulkan/instance.rs":"099a336fc035efb4e4df6107fc822c86a63084216b13523baf01330da2cd2338","src/vulkan/mod.rs":"452ea5f33ad883ce6d085e7c3ccc96e9ebef8cc83f0b29d459e2bd9c8943f78b","src/vulkan/sampler.rs":"f65729d6df5cce681b7756b3e48074017f0c7f42da69ca55e26cc723cd14ad59","src/vulkan/semaphore_list.rs":"6e548d810d75daf5ed31b6e520ece32c8ef97e4b66926c17f0d4317f355802e5","src/vulkan/swapchain/mod.rs":"1baef6ef36d005fe03b27ea15a91d1c5c7114eb7f777a50e67ca5f448a53291b","src/vulkan/swapchain/native.rs":"fc05951f4bf49074fab510f9706689ac74edf4478bae049af054e8735f247a56"},"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 @@ -90,6 +90,7 @@ gles = [ "dep:hashbrown", "dep:js-sys", "dep:khronos-egl", + "dep:wayland-sys", "dep:libloading", "dep:log", "dep:ndk-sys", @@ -399,6 +400,15 @@ version = "0.2.172" optional = true default-features = false +[target."cfg(unix)".dependencies.wayland-sys] +version = "0.31.3" +features = [ + "client", + "dlopen", + "egl", +] +optional = true + [target."cfg(windows)".dependencies.bit-set] version = "0.8" optional = true diff --git a/third_party/rust/wgpu-hal/examples/halmark/main.rs b/third_party/rust/wgpu-hal/examples/halmark/main.rs @@ -93,6 +93,9 @@ struct Example<A: hal::Api> { impl<A: hal::Api> Example<A> { fn init(window: &winit::window::Window) -> Result<Self, Box<dyn std::error::Error>> { + // The Instance can be initialized with the DisplayHandle from the EventLoop as well + let raw_display_handle = window.display_handle()?; + let instance_desc = hal::InstanceDescriptor { name: "example", flags: wgpu_types::InstanceFlags::from_build_config().with_env(), @@ -100,15 +103,15 @@ impl<A: hal::Api> Example<A> { // Can't rely on having DXC available, so use FXC instead backend_options: wgpu_types::BackendOptions::default(), telemetry: None, + display: Some(raw_display_handle), }; let instance = unsafe { A::Instance::init(&instance_desc)? }; let surface = { let raw_window_handle = window.window_handle()?.as_raw(); - let raw_display_handle = window.display_handle()?.as_raw(); unsafe { instance - .create_surface(raw_display_handle, raw_window_handle) + .create_surface(raw_display_handle.as_raw(), raw_window_handle) .unwrap() } }; 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 @@ -235,6 +235,9 @@ impl<A: hal::Api> Example<A> { log::info!("using index buffer") } + // The Instance can be initialized with the DisplayHandle from the EventLoop as well + let raw_display_handle = window.display_handle()?; + let instance_desc = hal::InstanceDescriptor { name: "example", flags: wgpu_types::InstanceFlags::default(), @@ -247,15 +250,15 @@ impl<A: hal::Api> Example<A> { ..Default::default() }, telemetry: None, + display: Some(raw_display_handle), }; let instance = unsafe { A::Instance::init(&instance_desc)? }; let surface = { let raw_window_handle = window.window_handle()?.as_raw(); - let raw_display_handle = window.display_handle()?.as_raw(); unsafe { instance - .create_surface(raw_display_handle, raw_window_handle) + .create_surface(raw_display_handle.as_raw(), raw_window_handle) .unwrap() } }; diff --git a/third_party/rust/wgpu-hal/src/dx12/adapter.rs b/third_party/rust/wgpu-hal/src/dx12/adapter.rs @@ -809,7 +809,7 @@ impl super::Adapter { min_uniform_buffer_offset_alignment: Direct3D12::D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT, min_storage_buffer_offset_alignment: 4, - max_inter_stage_shader_components: base.max_inter_stage_shader_components, + max_inter_stage_shader_variables: base.max_inter_stage_shader_variables, max_color_attachments, max_color_attachment_bytes_per_sample, // From: https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#18.6.6%20Inter-Thread%20Data%20Sharing @@ -905,6 +905,7 @@ impl super::Adapter { Direct3D12::D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT, }, downlevel, + cooperative_matrix_properties: Vec::new(), }, }) } diff --git a/third_party/rust/wgpu-hal/src/dx12/instance.rs b/third_party/rust/wgpu-hal/src/dx12/instance.rs @@ -18,7 +18,7 @@ use crate::{ impl crate::Instance for super::Instance { type A = super::Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { profiling::scope!("Init DX12 Backend"); let lib_main = D3D12Lib::new().map_err(|e| { crate::InstanceError::with_source(String::from("failed to load d3d12.dll"), e) diff --git a/third_party/rust/wgpu-hal/src/gles/adapter.rs b/third_party/rust/wgpu-hal/src/gles/adapter.rs @@ -755,17 +755,17 @@ impl super::Adapter { max_immediate_size: super::MAX_IMMEDIATES as u32 * 4, min_uniform_buffer_offset_alignment, min_storage_buffer_offset_alignment, - max_inter_stage_shader_components: { + max_inter_stage_shader_variables: { // MAX_VARYING_COMPONENTS may return 0, because it is deprecated since OpenGL 3.2 core, // and an OpenGL Context with the core profile and with forward-compatibility=true, // will make deprecated constants unavailable. let max_varying_components = unsafe { gl.get_parameter_i32(glow::MAX_VARYING_COMPONENTS) } as u32; if max_varying_components == 0 { - // default value for max_inter_stage_shader_components - 60 + // default value for max_inter_stage_shader_variables + 15 } else { - max_varying_components + max_varying_components / 4 } }, max_color_attachments, @@ -895,6 +895,7 @@ impl super::Adapter { raw_tlas_instance_size: 0, ray_tracing_scratch_buffer_alignment: 0, }, + cooperative_matrix_properties: Vec::new(), }, }) } diff --git a/third_party/rust/wgpu-hal/src/gles/egl.rs b/third_party/rust/wgpu-hal/src/gles/egl.rs @@ -1,4 +1,4 @@ -use alloc::{rc::Rc, string::String, sync::Arc, vec::Vec}; +use alloc::{string::String, sync::Arc, vec::Vec}; use core::{ffi, mem::ManuallyDrop, ptr, time::Duration}; use std::sync::LazyLock; @@ -21,38 +21,12 @@ const EGL_PLATFORM_SURFACELESS_MESA: u32 = 0x31DD; const EGL_GL_COLORSPACE_KHR: u32 = 0x309D; const EGL_GL_COLORSPACE_SRGB_KHR: u32 = 0x3089; -type XOpenDisplayFun = - unsafe extern "system" fn(display_name: *const ffi::c_char) -> *mut ffi::c_void; - -type XCloseDisplayFun = unsafe extern "system" fn(display: *mut ffi::c_void) -> ffi::c_int; - -type WlDisplayConnectFun = - unsafe extern "system" fn(display_name: *const ffi::c_char) -> *mut ffi::c_void; - -type WlDisplayDisconnectFun = unsafe extern "system" fn(display: *const ffi::c_void); - #[cfg(not(Emscripten))] type EglInstance = khronos_egl::DynamicInstance<khronos_egl::EGL1_4>; #[cfg(Emscripten)] type EglInstance = khronos_egl::Instance<khronos_egl::Static>; -type WlEglWindowCreateFun = unsafe extern "system" fn( - surface: *const ffi::c_void, - width: ffi::c_int, - height: ffi::c_int, -) -> *mut ffi::c_void; - -type WlEglWindowResizeFun = unsafe extern "system" fn( - window: *const ffi::c_void, - width: ffi::c_int, - height: ffi::c_int, - dx: ffi::c_int, - dy: ffi::c_int, -); - -type WlEglWindowDestroyFun = unsafe extern "system" fn(window: *const ffi::c_void); - type EglLabel = *const ffi::c_void; #[allow(clippy::upper_case_acronyms)] @@ -89,7 +63,7 @@ unsafe extern "system" fn egl_debug_proc( EGL_DEBUG_MSG_CRITICAL_KHR | EGL_DEBUG_MSG_ERROR_KHR => log::Level::Error, EGL_DEBUG_MSG_WARN_KHR => log::Level::Warn, // We intentionally suppress info messages down to debug - // so that users are not innundated with info messages from + // so that users are not inundated with info messages from // the runtime. EGL_DEBUG_MSG_INFO_KHR => log::Level::Debug, _ => log::Level::Trace, @@ -104,106 +78,6 @@ unsafe extern "system" fn egl_debug_proc( log::log!(log_severity, "EGL '{command}' code 0x{error:x}: {message}",); } -/// A simple wrapper around an X11 or Wayland display handle. -/// Since the logic in this file doesn't actually need to directly -/// persist a wayland connection handle, the only load-bearing -/// enum variant is the X11 variant -#[derive(Debug)] -enum DisplayRef { - X11(ptr::NonNull<ffi::c_void>), - Wayland, -} - -impl DisplayRef { - /// Convenience for getting the underlying pointer - fn as_ptr(&self) -> *mut ffi::c_void { - match *self { - Self::X11(ptr) => ptr.as_ptr(), - Self::Wayland => unreachable!(), - } - } -} - -/// DisplayOwner ties the lifetime of the system display handle -/// to that of the loaded library. -/// It implements Drop to ensure that the display handle is closed -/// prior to unloading the library so that we don't leak the -/// associated file descriptors -#[derive(Debug)] -struct DisplayOwner { - library: libloading::Library, - display: DisplayRef, -} - -impl Drop for DisplayOwner { - fn drop(&mut self) { - match self.display { - DisplayRef::X11(ptr) => unsafe { - let Ok(func): Result<libloading::Symbol<XCloseDisplayFun>, _> = self - .library - .get(c"XCloseDisplay".to_bytes()) - .inspect_err(|err| log::error!("Failed to load XCloseDisplay: {err:?}")) - else { - return; - }; - func(ptr.as_ptr()); - }, - DisplayRef::Wayland => {} - } - } -} - -fn open_x_display() -> Option<DisplayOwner> { - log::debug!("Loading X11 library to get the current display"); - unsafe { - let library = find_library(&["libX11.so.6", "libX11.so"])?; - let func: libloading::Symbol<XOpenDisplayFun> = library - .get(c"XOpenDisplay".to_bytes()) - .inspect_err(|err| log::error!("Failed to load XOpenDisplay: {err:?}")) - .ok()?; - let result = func(ptr::null()); - ptr::NonNull::new(result).map(|ptr| DisplayOwner { - display: DisplayRef::X11(ptr), - library, - }) - } -} - -unsafe fn find_library(paths: &[&str]) -> Option<libloading::Library> { - for path in paths { - match unsafe { libloading::Library::new(path) } { - Ok(lib) => return Some(lib), - _ => continue, - }; - } - None -} - -fn test_wayland_display() -> Option<DisplayOwner> { - /* We try to connect and disconnect here to simply ensure there - * is an active wayland display available. - */ - log::debug!("Loading Wayland library to get the current display"); - let library = unsafe { - let client_library = find_library(&["libwayland-client.so.0", "libwayland-client.so"])?; - let wl_display_connect: libloading::Symbol<WlDisplayConnectFun> = client_library - .get(c"wl_display_connect".to_bytes()) - .inspect_err(|err| log::error!("Failed to load wl_display_connect: {err:?}")) - .ok()?; - let wl_display_disconnect: libloading::Symbol<WlDisplayDisconnectFun> = client_library - .get(c"wl_display_disconnect".to_bytes()) - .inspect_err(|err| log::error!("Failed to load wl_display_disconnect: {err:?}")) - .ok()?; - let display = ptr::NonNull::new(wl_display_connect(ptr::null()))?; - wl_display_disconnect(display.as_ptr()); - find_library(&["libwayland-egl.so.1", "libwayland-egl.so"])? - }; - Some(DisplayOwner { - library, - display: DisplayRef::Wayland, - }) -} - #[derive(Clone, Copy, Debug)] enum SrgbFrameBufferKind { /// No support for SRGB surface @@ -465,10 +339,6 @@ struct Inner { version: (i32, i32), supports_native_window: bool, config: khronos_egl::Config, - #[cfg_attr(Emscripten, allow(dead_code))] - wl_display: Option<*mut ffi::c_void>, - #[cfg_attr(Emscripten, allow(dead_code))] - force_gles_minor_version: wgt::Gles3MinorVersion, /// Method by which the framebuffer should support srgb srgb_kind: SrgbFrameBufferKind, } @@ -768,15 +638,16 @@ impl Inner { version, supports_native_window, config, - wl_display: None, srgb_kind, - force_gles_minor_version, }) } } impl Drop for Inner { fn drop(&mut self) { + // ERROR: Since EglContext is erroneously Clone, these handles could be copied and + // accidentally used elsewhere outside of Inner, despite us assuming ownership and + // destroying the handles here. if let Err(e) = self .egl .instance @@ -801,7 +672,6 @@ enum WindowKind { #[derive(Clone, Debug)] struct WindowSystemInterface { - display_owner: Option<Rc<DisplayOwner>>, kind: WindowKind, } @@ -843,7 +713,9 @@ unsafe impl Sync for Instance {} impl crate::Instance for Instance { type A = super::Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { + use raw_window_handle::RawDisplayHandle as Rdh; + profiling::scope!("Init OpenGL (EGL) Backend"); #[cfg(Emscripten)] let egl_result: Result<EglInstance, khronos_egl::Error> = @@ -880,91 +752,97 @@ impl crate::Instance for Instance { client_ext_str.split_whitespace().collect::<Vec<_>>() ); - let wayland_library = if client_ext_str.contains("EGL_EXT_platform_wayland") { - test_wayland_display() - } else { - None - }; - let x11_display_library = if client_ext_str.contains("EGL_EXT_platform_x11") { - open_x_display() - } else { - None - }; - let angle_x11_display_library = if client_ext_str.contains("EGL_ANGLE_platform_angle") { - open_x_display() - } else { - None - }; - #[cfg(not(Emscripten))] let egl1_5 = egl.upcast::<khronos_egl::EGL1_5>(); #[cfg(Emscripten)] let egl1_5: Option<&Arc<EglInstance>> = Some(&egl); - let (display, display_owner, wsi_kind) = if let (Some(library), Some(egl)) = - (wayland_library, egl1_5) - { - log::debug!("Using Wayland platform"); - let display_attributes = [khronos_egl::ATTRIB_NONE]; - let display = unsafe { - egl.get_platform_display( - EGL_PLATFORM_WAYLAND_KHR, - khronos_egl::DEFAULT_DISPLAY, - &display_attributes, - ) + let (display, wsi_kind) = match (desc.display.map(|d| d.as_raw()), egl1_5) { + (Some(Rdh::Wayland(wayland_display_handle)), Some(egl)) + if client_ext_str.contains("EGL_EXT_platform_wayland") => + { + log::debug!("Using Wayland platform"); + let display_attributes = [khronos_egl::ATTRIB_NONE]; + let display = unsafe { + egl.get_platform_display( + EGL_PLATFORM_WAYLAND_KHR, + wayland_display_handle.display.as_ptr(), + &display_attributes, + ) + } + .map_err(instance_err("failed to get Wayland display"))?; + (display, WindowKind::Wayland) } - .map_err(instance_err("failed to get Wayland display"))?; - (display, Some(Rc::new(library)), WindowKind::Wayland) - } else if let (Some(display_owner), Some(egl)) = (x11_display_library, egl1_5) { - log::debug!("Using X11 platform"); - let display_attributes = [khronos_egl::ATTRIB_NONE]; - let display = unsafe { - egl.get_platform_display( - EGL_PLATFORM_X11_KHR, - display_owner.display.as_ptr(), - &display_attributes, - ) + (Some(Rdh::Xlib(xlib_display_handle)), Some(egl)) + if client_ext_str.contains("EGL_EXT_platform_x11") => + { + log::debug!("Using X11 platform"); + let display_attributes = [khronos_egl::ATTRIB_NONE]; + let display = unsafe { + egl.get_platform_display( + EGL_PLATFORM_X11_KHR, + xlib_display_handle + .display + .map_or(khronos_egl::DEFAULT_DISPLAY, ptr::NonNull::as_ptr), + &display_attributes, + ) + } + .map_err(instance_err("failed to get X11 display"))?; + (display, WindowKind::X11) } - .map_err(instance_err("failed to get x11 display"))?; - (display, Some(Rc::new(display_owner)), WindowKind::X11) - } else if let (Some(display_owner), Some(egl)) = (angle_x11_display_library, egl1_5) { - log::debug!("Using Angle platform with X11"); - let display_attributes = [ - EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as khronos_egl::Attrib, - EGL_PLATFORM_X11_KHR as khronos_egl::Attrib, - EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED as khronos_egl::Attrib, - usize::from(desc.flags.contains(wgt::InstanceFlags::VALIDATION)), - khronos_egl::ATTRIB_NONE, - ]; - let display = unsafe { - egl.get_platform_display( - EGL_PLATFORM_ANGLE_ANGLE, - display_owner.display.as_ptr(), - &display_attributes, - ) + (Some(Rdh::Xlib(xlib_display_handle)), Some(egl)) + if client_ext_str.contains("EGL_ANGLE_platform_angle") => + { + log::debug!("Using Angle platform with X11"); + let display_attributes = [ + EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as khronos_egl::Attrib, + EGL_PLATFORM_X11_KHR as khronos_egl::Attrib, + EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED as khronos_egl::Attrib, + usize::from(desc.flags.contains(wgt::InstanceFlags::VALIDATION)), + khronos_egl::ATTRIB_NONE, + ]; + let display = unsafe { + egl.get_platform_display( + EGL_PLATFORM_ANGLE_ANGLE, + xlib_display_handle + .display + .map_or(khronos_egl::DEFAULT_DISPLAY, ptr::NonNull::as_ptr), + &display_attributes, + ) + } + .map_err(instance_err("failed to get Angle display"))?; + (display, WindowKind::AngleX11) } - .map_err(instance_err("failed to get Angle display"))?; - (display, Some(Rc::new(display_owner)), WindowKind::AngleX11) - } else if client_ext_str.contains("EGL_MESA_platform_surfaceless") { - log::debug!("No windowing system present. Using surfaceless platform"); - #[allow(clippy::unnecessary_literal_unwrap)] // This is only a literal on Emscripten - let egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless"); - let display = unsafe { - egl.get_platform_display( - EGL_PLATFORM_SURFACELESS_MESA, - khronos_egl::DEFAULT_DISPLAY, - &[khronos_egl::ATTRIB_NONE], - ) + (Some(Rdh::Xcb(_xcb_display_handle)), Some(_egl)) => todo!("xcb"), + x if client_ext_str.contains("EGL_MESA_platform_surfaceless") => { + log::debug!( + "No (or unknown) windowing system ({x:?}) present. Using surfaceless platform" + ); + #[allow(clippy::unnecessary_literal_unwrap)] + // This is only a literal on Emscripten + // TODO: This extension is also supported on EGL 1.4 with EGL_EXT_platform_base: https://registry.khronos.org/EGL/extensions/MESA/EGL_MESA_platform_surfaceless.txt + let egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless"); + let display = unsafe { + egl.get_platform_display( + EGL_PLATFORM_SURFACELESS_MESA, + khronos_egl::DEFAULT_DISPLAY, + &[khronos_egl::ATTRIB_NONE], + ) + } + .map_err(instance_err("failed to get MESA surfaceless display"))?; + (display, WindowKind::Unknown) + } + x => { + log::debug!( + "No (or unknown) windowing system {x:?} and EGL_MESA_platform_surfaceless not available. Using default platform" + ); + let display = + unsafe { egl.get_display(khronos_egl::DEFAULT_DISPLAY) }.ok_or_else(|| { + crate::InstanceError::new("Failed to get default display".into()) + })?; + (display, WindowKind::Unknown) } - .map_err(instance_err("failed to get MESA display"))?; - - (display, None, WindowKind::Unknown) - } else { - log::debug!("EGL_MESA_platform_surfaceless not available. Using default platform"); - let display = unsafe { egl.get_display(khronos_egl::DEFAULT_DISPLAY) } - .ok_or_else(|| crate::InstanceError::new("Failed to get default display".into()))?; - (display, None, WindowKind::Unknown) }; if desc.flags.contains(wgt::InstanceFlags::VALIDATION) @@ -1003,10 +881,7 @@ impl crate::Instance for Instance { )?; Ok(Instance { - wsi: WindowSystemInterface { - display_owner, - kind: wsi_kind, - }, + wsi: WindowSystemInterface { kind: wsi_kind }, flags: desc.flags, options: desc.backend_options.gl.clone(), inner: Mutex::new(inner), @@ -1021,8 +896,7 @@ impl crate::Instance for Instance { ) -> Result<Surface, crate::InstanceError> { use raw_window_handle::RawWindowHandle as Rwh; - #[cfg_attr(any(target_os = "android", Emscripten), allow(unused_mut))] - let mut inner = self.inner.lock(); + let inner = self.inner.lock(); match (window_handle, display_handle) { (Rwh::Xlib(_), _) => {} @@ -1060,55 +934,7 @@ impl crate::Instance for Instance { ))); } } - #[cfg(not(Emscripten))] - (Rwh::Wayland(_), raw_window_handle::RawDisplayHandle::Wayland(display_handle)) => { - if inner - .wl_display - .map(|ptr| ptr != display_handle.display.as_ptr()) - .unwrap_or(true) - { - /* Wayland displays are not sharable between surfaces so if the - * surface we receive from this handle is from a different - * display, we must re-initialize the context. - * - * See gfx-rs/gfx#3545 - */ - log::warn!("Re-initializing Gles context due to Wayland window"); - - use core::ops::DerefMut; - let display_attributes = [khronos_egl::ATTRIB_NONE]; - - let display = unsafe { - inner - .egl - .instance - .upcast::<khronos_egl::EGL1_5>() - .ok_or_else(|| { - crate::InstanceError::new( - "EGL 1.5 is required for Wayland support".into(), - ) - })? - .get_platform_display( - EGL_PLATFORM_WAYLAND_KHR, - display_handle.display.as_ptr(), - &display_attributes, - ) - } - .map_err(instance_err("failed to get wayland display"))?; - - let new_inner = Inner::create( - self.flags, - Arc::clone(&inner.egl.instance), - display, - inner.force_gles_minor_version, - )?; - - let old_inner = core::mem::replace(inner.deref_mut(), new_inner); - inner.wl_display = Some(display_handle.display.as_ptr()); - - drop(old_inner); - } - } + (Rwh::Wayland(_), _) => {} #[cfg(Emscripten)] (Rwh::Web(_), _) => {} other => { @@ -1176,6 +1002,7 @@ impl crate::Instance for Instance { super::Adapter::expose( AdapterContext { glow: Mutex::new(gl), + // ERROR: Copying owned reference handles here, be careful to not drop them! egl: Some(inner.egl.clone()), }, self.options.clone(), @@ -1227,7 +1054,7 @@ impl super::Device { #[derive(Debug)] pub struct Swapchain { surface: khronos_egl::Surface, - wl_window: Option<*mut ffi::c_void>, + wl_window: Option<*mut wayland_sys::egl::wl_egl_window>, framebuffer: glow::Framebuffer, renderbuffer: glow::Renderbuffer, /// Extent because the window lies @@ -1335,7 +1162,10 @@ impl Surface { unsafe fn unconfigure_impl( &self, device: &super::Device, - ) -> Option<(khronos_egl::Surface, Option<*mut ffi::c_void>)> { + ) -> Option<( + khronos_egl::Surface, + Option<*mut wayland_sys::egl::wl_egl_window>, + )> { let gl = &device.shared.context.lock(); match self.swapchain.write().take() { Some(sc) => { @@ -1366,7 +1196,21 @@ impl crate::Surface for Surface { use raw_window_handle::RawWindowHandle as Rwh; let (surface, wl_window) = match unsafe { self.unconfigure_impl(device) } { - Some(pair) => pair, + Some((sc, wl_window)) => { + if let Some(window) = wl_window { + wayland_sys::ffi_dispatch!( + wayland_sys::egl::wayland_egl_handle(), + wl_egl_window_resize, + window, + config.extent.width as i32, + config.extent.height as i32, + 0, + 0, + ); + } + + (sc, wl_window) + } None => { let mut wl_window = None; let (mut temp_xlib_handle, mut temp_xcb_handle); @@ -1387,26 +1231,17 @@ impl crate::Surface for Surface { handle.a_native_window.as_ptr() } (WindowKind::Unknown, Rwh::OhosNdk(handle)) => handle.native_window.as_ptr(), + #[cfg(unix)] (WindowKind::Wayland, Rwh::Wayland(handle)) => { - let library = &self - .wsi - .display_owner - .as_ref() - .ok_or(crate::SurfaceError::Other("No WSI display owner"))? - .library; - let wl_egl_window_create: libloading::Symbol<WlEglWindowCreateFun> = - unsafe { library.get(c"wl_egl_window_create".to_bytes()) }.map_err( - |_| { - crate::SurfaceError::Other( - "Failed to load `wl_egl_window_create", - ) - }, - )?; - let window = - unsafe { wl_egl_window_create(handle.surface.as_ptr(), 640, 480) } - .cast(); + let window = wayland_sys::ffi_dispatch!( + wayland_sys::egl::wayland_egl_handle(), + wl_egl_window_create, + handle.surface.as_ptr().cast(), + config.extent.width as i32, + config.extent.height as i32, + ); wl_window = Some(window); - window + window.cast() } #[cfg(Emscripten)] (WindowKind::Unknown, Rwh::Web(handle)) => handle.id as *mut ffi::c_void, @@ -1510,28 +1345,6 @@ impl crate::Surface for Surface { } }; - if let Some(window) = wl_window { - let library = &self - .wsi - .display_owner - .as_ref() - .ok_or(crate::SurfaceError::Other("No WSI display owner"))? - .library; - let wl_egl_window_resize: libloading::Symbol<WlEglWindowResizeFun> = unsafe { - library.get(c"wl_egl_window_resize".to_bytes()) - } - .map_err(|_| crate::SurfaceError::Other("Failed to load `wl_egl_window_resize"))?; - unsafe { - wl_egl_window_resize( - window, - config.extent.width as i32, - config.extent.height as i32, - 0, - 0, - ) - }; - } - let format_desc = device.shared.describe_texture_format(config.format); let gl = &device.shared.context.lock(); let renderbuffer = unsafe { gl.create_renderbuffer() }.map_err(|error| { @@ -1585,15 +1398,11 @@ impl crate::Surface for Surface { .destroy_surface(self.egl.display, surface) .unwrap(); if let Some(window) = wl_window { - let library = &self - .wsi - .display_owner - .as_ref() - .expect("unsupported window") - .library; - let wl_egl_window_destroy: libloading::Symbol<WlEglWindowDestroyFun> = - unsafe { library.get(c"wl_egl_window_destroy".to_bytes()) }.unwrap(); - unsafe { wl_egl_window_destroy(window) }; + wayland_sys::ffi_dispatch!( + wayland_sys::egl::wayland_egl_handle(), + wl_egl_window_destroy, + window, + ); } } } diff --git a/third_party/rust/wgpu-hal/src/gles/web.rs b/third_party/rust/wgpu-hal/src/gles/web.rs @@ -114,7 +114,7 @@ unsafe impl Send for Instance {} impl crate::Instance for Instance { type A = super::Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { profiling::scope!("Init OpenGL (WebGL) Backend"); Ok(Instance { options: desc.backend_options.gl.clone(), diff --git a/third_party/rust/wgpu-hal/src/gles/wgl.rs b/third_party/rust/wgpu-hal/src/gles/wgl.rs @@ -448,7 +448,7 @@ fn create_instance_device() -> Result<InstanceDevice, crate::InstanceError> { impl crate::Instance for Instance { type A = super::Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { profiling::scope!("Init OpenGL (WGL) Backend"); let opengl_module = unsafe { LibraryLoader::LoadLibraryA(PCSTR(c"opengl32.dll".as_ptr().cast())) } diff --git a/third_party/rust/wgpu-hal/src/lib.rs b/third_party/rust/wgpu-hal/src/lib.rs @@ -305,6 +305,7 @@ use core::{ }; use bitflags::bitflags; +use raw_window_handle::DisplayHandle; use thiserror::Error; use wgt::WasmNotSendSync; @@ -643,7 +644,7 @@ pub trait Api: Clone + fmt::Debug + Sized + WasmNotSendSync + 'static { pub trait Instance: Sized + WasmNotSendSync { type A: Api; - unsafe fn init(desc: &InstanceDescriptor) -> Result<Self, InstanceError>; + unsafe fn init(desc: &InstanceDescriptor<'_>) -> Result<Self, InstanceError>; unsafe fn create_surface( &self, display_handle: raw_window_handle::RawDisplayHandle, @@ -1870,13 +1871,16 @@ bitflags!( } ); -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct InstanceDescriptor<'a> { pub name: &'a str, pub flags: wgt::InstanceFlags, pub memory_budget_thresholds: wgt::MemoryBudgetThresholds, pub backend_options: wgt::BackendOptions, pub telemetry: Option<Telemetry>, + /// This is a borrow because the surrounding `core::Instance` keeps the the owned display handle + /// alive already. + pub display: Option<DisplayHandle<'a>>, } #[derive(Clone, Debug)] @@ -1917,6 +1921,10 @@ pub struct Capabilities { pub limits: wgt::Limits, pub alignments: Alignments, pub downlevel: wgt::DownlevelCapabilities, + /// Supported cooperative matrix configurations. + /// + /// Empty if cooperative matrices are not supported. + pub cooperative_matrix_properties: Vec<wgt::CooperativeMatrixProperties>, } /// An adapter with all the information needed to reason about its capabilities. diff --git a/third_party/rust/wgpu-hal/src/metal/adapter.rs b/third_party/rust/wgpu-hal/src/metal/adapter.rs @@ -6,7 +6,7 @@ use objc::{class, msg_send, sel, sel_impl}; use parking_lot::Mutex; use wgt::{AstcBlock, AstcChannel}; -use alloc::sync::Arc; +use alloc::{sync::Arc, vec::Vec}; use super::TimestampQuerySupport; @@ -960,8 +960,17 @@ impl super::PrivateCapabilities { || (version.at_least((10, 15), (14, 0), (16, 0), (1, 0), os_type) && device.supports_shader_barycentric_coordinates()), // https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=3 + // See https://github.com/gfx-rs/wgpu/pull/8725 for more details supports_memoryless_storage: metal4 - || (family_check && device.supports_family(MTLGPUFamily::Apple2)), + || if family_check { + // Apple A7 (MTLGPUFamily::Apple1) has been tested to have support. + device.supports_family(MTLGPUFamily::Apple1) + } else { + // macOS: Always rely on family check + // iOS/tvOS: API added in 10.0 + // visionOS: Always rely on family check + version.at_least(OS_NOT_SUPPORT, (10, 0), (10, 0), OS_NOT_SUPPORT, os_type) + }, supported_vertex_amplification_factor: { let mut factor = 1; // https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=8 @@ -987,6 +996,9 @@ impl super::PrivateCapabilities { mesh_shaders, max_mesh_task_workgroup_count: if mesh_shaders { 1024 } else { 0 }, max_task_payload_size: if mesh_shaders { 16384 - 32 } else { 0 }, + supports_cooperative_matrix: family_check + && (device.supports_family(MTLGPUFamily::Apple7) + || device.supports_family(MTLGPUFamily::Mac2)), } } @@ -1106,6 +1118,12 @@ impl super::PrivateCapabilities { features.set(F::EXPERIMENTAL_MESH_SHADER, self.mesh_shaders); + // Cooperative matrix (simdgroup matrix) requires MSL 2.3+ + features.set( + F::EXPERIMENTAL_COOPERATIVE_MATRIX, + self.supports_cooperative_matrix && self.msl_version >= MTLLanguageVersion::V2_3, + ); + if self.supported_vertex_amplification_factor > 1 { features.insert(F::MULTIVIEW); } @@ -1173,9 +1191,9 @@ impl super::PrivateCapabilities { max_vertex_attributes: 31, max_vertex_buffer_array_stride: base.max_vertex_buffer_array_stride, max_immediate_size: 0x1000, + max_inter_stage_shader_variables: self.max_varying_components / 4, min_uniform_buffer_offset_alignment: self.buffer_alignment as u32, min_storage_buffer_offset_alignment: self.buffer_alignment as u32, - max_inter_stage_shader_components: self.max_varying_components, max_color_attachments: self.max_color_render_targets as u32, max_color_attachment_bytes_per_sample: self.max_color_attachment_bytes_per_sample as u32, @@ -1244,9 +1262,49 @@ impl super::PrivateCapabilities { ray_tracing_scratch_buffer_alignment: 0, }, downlevel, + cooperative_matrix_properties: self.cooperative_matrix_properties(), } } + /// Returns the supported cooperative matrix configurations for Metal. + /// + /// Metal's simdgroup_matrix supports 8x8 tiles with f16 and f32 element types. + fn cooperative_matrix_properties(&self) -> Vec<wgt::CooperativeMatrixProperties> { + if !self.supports_cooperative_matrix || self.msl_version < MTLLanguageVersion::V2_3 { + return Vec::new(); + } + + vec![ + // 8x8 f32 configuration + wgt::CooperativeMatrixProperties { + m_size: 8, + n_size: 8, + k_size: 8, + ab_type: wgt::CooperativeScalarType::F32, + cr_type: wgt::CooperativeScalarType::F32, + saturating_accumulation: false, + }, + // 8x8 f16 configuration + wgt::CooperativeMatrixProperties { + m_size: 8, + n_size: 8, + k_size: 8, + ab_type: wgt::CooperativeScalarType::F16, + cr_type: wgt::CooperativeScalarType::F16, + saturating_accumulation: false, + }, + // Mixed precision: f16 inputs, f32 accumulator + wgt::CooperativeMatrixProperties { + m_size: 8, + n_size: 8, + k_size: 8, + ab_type: wgt::CooperativeScalarType::F16, + cr_type: wgt::CooperativeScalarType::F32, + saturating_accumulation: false, + }, + ] + } + pub fn map_format(&self, format: wgt::TextureFormat) -> MTLPixelFormat { use wgt::TextureFormat as Tf; use MTLPixelFormat as MTL; diff --git a/third_party/rust/wgpu-hal/src/metal/mod.rs b/third_party/rust/wgpu-hal/src/metal/mod.rs @@ -113,7 +113,7 @@ impl Instance { impl crate::Instance for Instance { type A = Api; - unsafe fn init(_desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(_desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { profiling::scope!("Init Metal Backend"); // We do not enable metal validation based on the validation flags as it affects the entire // process. Instead, we enable the validation inside the test harness itself in tests/src/native.rs. @@ -310,6 +310,7 @@ struct PrivateCapabilities { has_unified_memory: Option<bool>, timestamp_query_support: TimestampQuerySupport, supports_simd_scoped_operations: bool, + supports_cooperative_matrix: bool, int64: bool, int64_atomics_min_max: bool, int64_atomics: bool, diff --git a/third_party/rust/wgpu-hal/src/noop/mod.rs b/third_party/rust/wgpu-hal/src/noop/mod.rs @@ -88,7 +88,7 @@ impl core::borrow::Borrow<dyn crate::DynTexture> for Resource { impl crate::Instance for Context { type A = Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { let crate::InstanceDescriptor { backend_options: wgt::BackendOptions { @@ -99,6 +99,7 @@ impl crate::Instance for Context { flags: _, memory_budget_thresholds: _, telemetry: _, + display: _, } = *desc; if enable { Ok(Context) @@ -181,9 +182,9 @@ pub const CAPABILITIES: crate::Capabilities = { max_buffer_size: ALLOC_MAX_U32 as u64, max_vertex_attributes: ALLOC_MAX_U32, max_vertex_buffer_array_stride: ALLOC_MAX_U32, + max_inter_stage_shader_variables: ALLOC_MAX_U32, min_uniform_buffer_offset_alignment: 1, min_storage_buffer_offset_alignment: 1, - max_inter_stage_shader_components: ALLOC_MAX_U32, max_color_attachments: ALLOC_MAX_U32, max_color_attachment_bytes_per_sample: ALLOC_MAX_U32, max_compute_workgroup_storage_size: ALLOC_MAX_U32, @@ -227,6 +228,7 @@ pub const CAPABILITIES: crate::Capabilities = { limits: wgt::DownlevelLimits {}, shader_model: wgt::ShaderModel::Sm5, }, + cooperative_matrix_properties: Vec::new(), } }; diff --git a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs @@ -135,6 +135,12 @@ pub struct PhysicalDeviceFeatures { /// /// Strictly speaking this tells us what features we *don't* have compared to core. portability_subset: Option<vk::PhysicalDevicePortabilitySubsetFeaturesKHR<'static>>, + + /// Features provided by `VK_KHR_cooperative_matrix` + cooperative_matrix: Option<vk::PhysicalDeviceCooperativeMatrixFeaturesKHR<'static>>, + + /// Features provided by `VK_KHR_vulkan_memory_model`, promoted to Vulkan 1.2 + vulkan_memory_model: Option<vk::PhysicalDeviceVulkanMemoryModelFeaturesKHR<'static>>, } impl PhysicalDeviceFeatures { @@ -214,6 +220,12 @@ impl PhysicalDeviceFeatures { if let Some(ref mut feature) = self.portability_subset { info = info.push_next(feature); } + if let Some(ref mut feature) = self.cooperative_matrix { + info = info.push_next(feature); + } + if let Some(ref mut feature) = self.vulkan_memory_model { + info = info.push_next(feature); + } info } @@ -570,6 +582,28 @@ impl PhysicalDeviceFeatures { } else { None }, + cooperative_matrix: if enabled_extensions.contains(&khr::cooperative_matrix::NAME) { + let needed = + requested_features.contains(wgt::Features::EXPERIMENTAL_COOPERATIVE_MATRIX); + Some( + vk::PhysicalDeviceCooperativeMatrixFeaturesKHR::default() + .cooperative_matrix(needed), + ) + } else { + None + }, + vulkan_memory_model: if device_api_version >= vk::API_VERSION_1_2 + || enabled_extensions.contains(&khr::vulkan_memory_model::NAME) + { + let needed = + requested_features.contains(wgt::Features::EXPERIMENTAL_COOPERATIVE_MATRIX); + Some( + vk::PhysicalDeviceVulkanMemoryModelFeaturesKHR::default() + .vulkan_memory_model(needed), + ) + } else { + None + }, } } @@ -959,6 +993,11 @@ impl PhysicalDeviceFeatures { .map(|p| p.multisample_array_image == vk::TRUE) .unwrap_or(true), ); + // Enable cooperative matrix if any configuration is supported + features.set( + F::EXPERIMENTAL_COOPERATIVE_MATRIX, + !caps.cooperative_matrix_properties.is_empty(), + ); (features, dl_flags) } @@ -1038,6 +1077,11 @@ pub struct PhysicalDeviceProperties { /// /// It is associated with a `VkPhysicalDevice` and its children. device_api_version: u32, + + /// Supported cooperative matrix configurations. + /// + /// This is determined by querying `vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR`. + cooperative_matrix_properties: Vec<wgt::CooperativeMatrixProperties>, } impl PhysicalDeviceProperties { @@ -1253,6 +1297,11 @@ impl PhysicalDeviceProperties { extensions.push(khr::fragment_shader_barycentric::NAME); } + // Require `VK_KHR_cooperative_matrix` if the associated feature was requested + if requested_features.contains(wgt::Features::EXPERIMENTAL_COOPERATIVE_MATRIX) { + extensions.push(khr::cooperative_matrix::NAME); + } + extensions } @@ -1382,11 +1431,12 @@ impl PhysicalDeviceProperties { max_vertex_attributes: limits.max_vertex_input_attributes, max_vertex_buffer_array_stride: limits.max_vertex_input_binding_stride, max_immediate_size: limits.max_push_constants_size, + max_inter_stage_shader_variables: limits + .max_vertex_output_components + .min(limits.max_fragment_input_components) + / 4, min_uniform_buffer_offset_alignment: limits.min_uniform_buffer_offset_alignment as u32, min_storage_buffer_offset_alignment: limits.min_storage_buffer_offset_alignment as u32, - max_inter_stage_shader_components: limits - .max_vertex_output_components - .min(limits.max_fragment_input_components), max_color_attachments: limits.max_color_attachments, max_color_attachment_bytes_per_sample, max_compute_workgroup_storage_size: limits.max_compute_shared_memory_size, @@ -1576,6 +1626,14 @@ impl super::InstanceShared { get_device_properties.get_physical_device_properties2(phd, &mut properties2) }; + // Query cooperative matrix properties + if capabilities.supports_extension(khr::cooperative_matrix::NAME) { + let coop_matrix = + khr::cooperative_matrix::Instance::new(&self.entry, &self.raw); + capabilities.cooperative_matrix_properties = + query_cooperative_matrix_properties(&coop_matrix, phd); + } + if is_intel_igpu_outdated_for_robustness2( capabilities.properties, capabilities.driver, @@ -1754,6 +1812,13 @@ impl super::InstanceShared { features2 = features2.push_next(next); } + if capabilities.supports_extension(khr::cooperative_matrix::NAME) { + let next = features + .cooperative_matrix + .insert(vk::PhysicalDeviceCooperativeMatrixFeaturesKHR::default()); + features2 = features2.push_next(next); + } + unsafe { get_device_properties.get_physical_device_features2(phd, &mut features2) }; features2.features } else { @@ -2007,6 +2072,7 @@ impl super::Instance { limits: wgt::DownlevelLimits {}, shader_model: wgt::ShaderModel::Sm5, //TODO? }, + cooperative_matrix_properties: phd_capabilities.cooperative_matrix_properties.clone(), }; let adapter = super::Adapter { @@ -2310,6 +2376,11 @@ impl super::Adapter { if features.contains(wgt::Features::EXPERIMENTAL_MESH_SHADER) { capabilities.push(spv::Capability::MeshShadingEXT); } + if features.contains(wgt::Features::EXPERIMENTAL_COOPERATIVE_MATRIX) { + capabilities.push(spv::Capability::CooperativeMatrixKHR); + // TODO: expose this more generally + capabilities.push(spv::Capability::VulkanMemoryModel); + } if self.private_caps.shader_integer_dot_product { // See <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_shader_integer_dot_product.html#_new_spir_v_capabilities>. capabilities.extend(&[ @@ -2881,3 +2952,127 @@ fn is_intel_igpu_outdated_for_robustness2( } is_outdated } + +/// Convert Vulkan component type to wgt::CooperativeScalarType. +fn map_vk_component_type(ty: vk::ComponentTypeKHR) -> Option<wgt::CooperativeScalarType> { + match ty { + vk::ComponentTypeKHR::FLOAT16 => Some(wgt::CooperativeScalarType::F16), + vk::ComponentTypeKHR::FLOAT32 => Some(wgt::CooperativeScalarType::F32), + vk::ComponentTypeKHR::SINT32 => Some(wgt::CooperativeScalarType::I32), + vk::ComponentTypeKHR::UINT32 => Some(wgt::CooperativeScalarType::U32), + _ => None, + } +} + +/// Convert Vulkan matrix size. +fn map_vk_cooperative_size(size: u32) -> Option<u32> { + match size { + 8 | 16 => Some(size), + _ => None, + } +} + +/// Query all supported cooperative matrix configurations from Vulkan. +fn query_cooperative_matrix_properties( + coop_matrix: &khr::cooperative_matrix::Instance, + phd: vk::PhysicalDevice, +) -> Vec<wgt::CooperativeMatrixProperties> { + let vk_properties = + match unsafe { coop_matrix.get_physical_device_cooperative_matrix_properties(phd) } { + Ok(props) => props, + Err(e) => { + log::warn!("Failed to query cooperative matrix properties: {e:?}"); + return Vec::new(); + } + }; + + log::debug!( + "Vulkan reports {} cooperative matrix configurations", + vk_properties.len() + ); + + let mut result = Vec::new(); + for prop in &vk_properties { + log::debug!( + " Vulkan coop matrix: M={} N={} K={} A={:?} B={:?} C={:?} Result={:?} scope={:?} saturating={}", + prop.m_size, + prop.n_size, + prop.k_size, + prop.a_type, + prop.b_type, + prop.c_type, + prop.result_type, + prop.scope, + prop.saturating_accumulation + ); + + // Only include subgroup-scoped operations (the only scope we support) + if prop.scope != vk::ScopeKHR::SUBGROUP { + log::debug!(" Skipped: scope is not SUBGROUP"); + continue; + } + + // Map sizes - skip configurations with sizes we don't support + let m_size = match map_vk_cooperative_size(prop.m_size) { + Some(s) => s, + None => { + log::debug!(" Skipped: M size {} not supported", prop.m_size); + continue; + } + }; + let n_size = match map_vk_cooperative_size(prop.n_size) { + Some(s) => s, + None => { + log::debug!(" Skipped: N size {} not supported", prop.n_size); + continue; + } + }; + let k_size = match map_vk_cooperative_size(prop.k_size) { + Some(s) => s, + None => { + log::debug!(" Skipped: K size {} not supported", prop.k_size); + continue; + } + }; + + // Map the component types - A and B must match, C and Result must match + let ab_type = match map_vk_component_type(prop.a_type) { + Some(t) if Some(t) == map_vk_component_type(prop.b_type) => t, + _ => { + log::debug!( + " Skipped: A/B types {:?}/{:?} not supported or don't match", + prop.a_type, + prop.b_type + ); + continue; + } + }; + let cr_type = match map_vk_component_type(prop.c_type) { + Some(t) if Some(t) == map_vk_component_type(prop.result_type) => t, + _ => { + log::debug!( + " Skipped: C/Result types {:?}/{:?} not supported or don't match", + prop.c_type, + prop.result_type + ); + continue; + } + }; + + log::debug!(" Accepted!"); + result.push(wgt::CooperativeMatrixProperties { + m_size, + n_size, + k_size, + ab_type, + cr_type, + saturating_accumulation: prop.saturating_accumulation != 0, + }); + } + + log::info!( + "Found {} cooperative matrix configurations supported by wgpu", + result.len() + ); + result +} diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -567,7 +567,7 @@ impl super::Instance { /// - Callback must not remove features. /// - Callback must not change anything to what the instance does not support. pub unsafe fn init_with_callback( - desc: &crate::InstanceDescriptor, + desc: &crate::InstanceDescriptor<'_>, callback: Option<Box<super::CreateInstanceCallback>>, ) -> Result<Self, crate::InstanceError> { profiling::scope!("Init Vulkan Backend"); @@ -870,7 +870,7 @@ impl Drop for super::InstanceShared { impl crate::Instance for super::Instance { type A = super::Api; - unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { + unsafe fn init(desc: &crate::InstanceDescriptor<'_>) -> Result<Self, crate::InstanceError> { unsafe { Self::init_with_callback(desc, None) } } diff --git a/third_party/rust/wgpu-types/.cargo-checksum.json b/third_party/rust/wgpu-types/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"88f5c2cf560dd3f41042435d751c86123a6499b0b473ada111f39c0b3d58fd58","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","src/adapter.rs":"a4090392d78c62a12e4f070385190ca95781ff4c5ef91a694a372d07e639d5fd","src/assertions.rs":"e4d2d40bc1e870a59637f4b9574743e19565a62f6dbcc21cb18a76b666b796eb","src/backend.rs":"cca0b725680cdc601a2735f64da0371b77b4ff741d76c56401866816a07f47e9","src/binding.rs":"907bab2a89a818ff5da925bff3eb07c6aad82b97bc71b8812cf0c43593626ec2","src/buffer.rs":"bc1d2976e3d54b81686f4597db7155d40d806a2b97d0eeb291bbaabf4b1eaefb","src/cast_utils.rs":"33f03a57ccbedef2699f2305bec584c623db1fd28bfdf584d1260da4fbecd529","src/counters.rs":"e85dc9fa3b52896b35a051de78b2e8d351df5bbf56923aece2d4756c8490fdd0","src/device.rs":"5c82d48cd0482ef53fd0fd8c3c29f80b9054d02f4f0a805c66f79e520647cb54","src/env.rs":"26ffc91867625784159bcf391881187aa92cf92b81b1f40959ce1b96ae6d554d","src/error.rs":"0109e6209cf152abbfd0cee85dd934fb24f2304bf6adad6fb684b77f151fb158","src/features.rs":"55e1a0e9a51df6cd29aa62fd4e44dcf65467eeff408e6003be884613cfccbf73","src/instance.rs":"81e4819d9c266eb2a4965c06ed74f5defe5e7bb8b438c54fd0376adef623f075","src/lib.rs":"68a435e552a2f4605150855ee1b2f3dbfabec8514803262c162fa6eefce66a65","src/limits.rs":"22e40b273afb9d60a9e1668e40e2f38929bcb9d70fdd983e77b2df4eb4df2f8b","src/math.rs":"916d78724b50ed6e9f84240e0aa19b0afc886e21a1b18428ca6ace5a1e6cc80c","src/origin_extent.rs":"31a6956c59c86046aac284bcd6b2d65462554db4ee6552b8fa0f660838113f97","src/ray_tracing.rs":"349245d907020947a40b99fc8fe78b2d0a34ddce6190415284aec2c37d6ba4e2","src/render.rs":"206cc471da7650e72a0d8e2d5b856e48c162f76acd422f9a735e32d3b5125352","src/send_sync.rs":"8d1db3a9b78eecab2e082751aea3b249dbd1a22a6274fe3cebc5384280dd474e","src/shader.rs":"1ccb7e213c77126964bbe5fd927d13146034ea8a1e5731dab136baac28cbe9ee","src/surface.rs":"a073c28347eb2756b7268ae44bcac0562d90614eba24a286f1e7b0632a75fcc0","src/texture.rs":"ed85930050d64b0fd9b0629d12f7797cea9583ddf74ef844f9e14b0de866b9bb","src/texture/external_image.rs":"2bb94e9f8c2f7d9df92b320c2dcc628e4a681204b32a8fbcf4da7f0ee32da9da","src/texture/external_texture.rs":"c4be6cd9f352141f72ae0dfbc4a2baa0995bbe968c9973c7067a2a879542eb3a","src/texture/format.rs":"771ae2bcac55ea8336ae86fed5f1eff9b7911f1b6587ef68d6d38972ce4ac625","src/tokens.rs":"db51d2ea67b9ba65347197db69b87202bfc6863104a44b10abb246139dcccb8c","src/transfers.rs":"25f47e9cbc5887f849f5eb4d8952d89de6377df40f480ebbea61c58d2e0e7fc6","src/vertex.rs":"3c66086cb02edbaf7a36b0b62b6e022e8f81333db20d80fa892ce2fc84da9814"},"package":null} -\ No newline at end of file +{"files":{"Cargo.toml":"601b37ef3f153fae439f17ee89fb69286b8e2bcb1a049623cd5593bf090a5ce7","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","src/adapter.rs":"4be5fe713a0691b15447487d0b6cf3f0c1e84cc9959f6e258b62d7183b944879","src/assertions.rs":"e4d2d40bc1e870a59637f4b9574743e19565a62f6dbcc21cb18a76b666b796eb","src/backend.rs":"cca0b725680cdc601a2735f64da0371b77b4ff741d76c56401866816a07f47e9","src/binding.rs":"907bab2a89a818ff5da925bff3eb07c6aad82b97bc71b8812cf0c43593626ec2","src/buffer.rs":"bc1d2976e3d54b81686f4597db7155d40d806a2b97d0eeb291bbaabf4b1eaefb","src/cast_utils.rs":"33f03a57ccbedef2699f2305bec584c623db1fd28bfdf584d1260da4fbecd529","src/counters.rs":"e85dc9fa3b52896b35a051de78b2e8d351df5bbf56923aece2d4756c8490fdd0","src/device.rs":"5c82d48cd0482ef53fd0fd8c3c29f80b9054d02f4f0a805c66f79e520647cb54","src/env.rs":"26ffc91867625784159bcf391881187aa92cf92b81b1f40959ce1b96ae6d554d","src/error.rs":"0109e6209cf152abbfd0cee85dd934fb24f2304bf6adad6fb684b77f151fb158","src/features.rs":"4817efef7fd056029f45e59327682947cc85278bc1ad1bfc8d0d7c25e0e9b5b6","src/instance.rs":"266b004e388a566ea43d4c202e6b43ed2c43c4f4d09c4948952b1721ee6dcf91","src/lib.rs":"4e9e917a99af5f2a454e5aba09ccc4708bb0ea68938f818d1d357467f31070d8","src/limits.rs":"3c443695e0997bcf47be8a5cf04f928df2d2557c0ab8cd75877e3a957c22a22e","src/math.rs":"916d78724b50ed6e9f84240e0aa19b0afc886e21a1b18428ca6ace5a1e6cc80c","src/origin_extent.rs":"31a6956c59c86046aac284bcd6b2d65462554db4ee6552b8fa0f660838113f97","src/ray_tracing.rs":"349245d907020947a40b99fc8fe78b2d0a34ddce6190415284aec2c37d6ba4e2","src/render.rs":"206cc471da7650e72a0d8e2d5b856e48c162f76acd422f9a735e32d3b5125352","src/send_sync.rs":"8d1db3a9b78eecab2e082751aea3b249dbd1a22a6274fe3cebc5384280dd474e","src/shader.rs":"1ccb7e213c77126964bbe5fd927d13146034ea8a1e5731dab136baac28cbe9ee","src/surface.rs":"a073c28347eb2756b7268ae44bcac0562d90614eba24a286f1e7b0632a75fcc0","src/texture.rs":"ed85930050d64b0fd9b0629d12f7797cea9583ddf74ef844f9e14b0de866b9bb","src/texture/external_image.rs":"2bb94e9f8c2f7d9df92b320c2dcc628e4a681204b32a8fbcf4da7f0ee32da9da","src/texture/external_texture.rs":"c4be6cd9f352141f72ae0dfbc4a2baa0995bbe968c9973c7067a2a879542eb3a","src/texture/format.rs":"771ae2bcac55ea8336ae86fed5f1eff9b7911f1b6587ef68d6d38972ce4ac625","src/tokens.rs":"db51d2ea67b9ba65347197db69b87202bfc6863104a44b10abb246139dcccb8c","src/transfers.rs":"25f47e9cbc5887f849f5eb4d8952d89de6377df40f480ebbea61c58d2e0e7fc6","src/vertex.rs":"3c66086cb02edbaf7a36b0b62b6e022e8f81333db20d80fa892ce2fc84da9814"},"package":null} +\ No newline at end of file diff --git a/third_party/rust/wgpu-types/Cargo.toml b/third_party/rust/wgpu-types/Cargo.toml @@ -78,6 +78,10 @@ features = [ [dependencies.log] version = "0.4.21" +[dependencies.raw-window-handle] +version = "0.6.2" +default-features = false + [dependencies.serde] version = "1.0.219" features = [ diff --git a/third_party/rust/wgpu-types/src/adapter.rs b/third_party/rust/wgpu-types/src/adapter.rs @@ -243,3 +243,42 @@ impl fmt::Display for RequestAdapterError { Ok(()) } } + +/// The underlying scalar type of the cooperative matrix component. +#[repr(u8)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub enum CooperativeScalarType { + /// 32-bit floating point. + F32, + /// 16-bit floating point. + F16, + /// 32-bit signed integer. + I32, + /// 32-bit unsigned integer. + U32, +} + +/// Describes a supported cooperative matrix configuration. +/// +/// Cooperative matrices perform the operation `C = A * B + C` where: +/// - `A` is an M×K matrix +/// - `B` is a K×N matrix +/// - `C` is an M×N matrix (both input accumulator and output) +#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] +pub struct CooperativeMatrixProperties { + /// Number of rows in matrices A and C (M dimension) + pub m_size: u32, + /// Number of columns in matrices B and C (N dimension) + pub n_size: u32, + /// Number of columns in A / rows in B (K dimension) + pub k_size: u32, + /// Element type for input matrices A and B + pub ab_type: CooperativeScalarType, + /// Element type for accumulator matrix C and the result + pub cr_type: CooperativeScalarType, + /// Whether saturating accumulation is supported. + /// + /// When true, the multiply-add operation clamps the result to prevent overflow. + pub saturating_accumulation: bool, +} diff --git a/third_party/rust/wgpu-types/src/features.rs b/third_party/rust/wgpu-types/src/features.rs @@ -635,9 +635,9 @@ bitflags_array! { /// /// This is a native only feature with a [proposal](https://github.com/gpuweb/gpuweb/blob/0008bd30da2366af88180b511a5d0d0c1dffbc36/proposals/pipeline-statistics-query.md) for the web. /// - /// [`RenderPass::begin_pipeline_statistics_query`]: https://docs.rs/wgpu/latest/wgpu/struct.RenderPass.html#method.begin_pipeline_statistics_query - /// [`RenderPass::end_pipeline_statistics_query`]: https://docs.rs/wgpu/latest/wgpu/struct.RenderPass.html#method.end_pipeline_statistics_query - /// [`CommandEncoder::resolve_query_set`]: https://docs.rs/wgpu/latest/wgpu/struct.CommandEncoder.html#method.resolve_query_set + #[doc = link_to_wgpu_docs!(["`RenderPass::begin_pipeline_statistics_query`"]: "struct.RenderPass.html#method.begin_pipeline_statistics_query")] + #[doc = link_to_wgpu_docs!(["`RenderPass::end_pipeline_statistics_query`"]: "struct.RenderPass.html#method.end_pipeline_statistics_query")] + #[doc = link_to_wgpu_docs!(["`CommandEncoder::resolve_query_set`"]: "struct.CommandEncoder.html#method.resolve_query_set")] /// [`PipelineStatisticsTypes`]: super::PipelineStatisticsTypes const PIPELINE_STATISTICS_QUERY = 1 << 4; /// Allows for timestamp queries directly on command encoders. @@ -654,7 +654,7 @@ bitflags_array! { /// /// This is a native only feature. /// - /// [`CommandEncoder::write_timestamp`]: https://docs.rs/wgpu/latest/wgpu/struct.CommandEncoder.html#method.write_timestamp + #[doc = link_to_wgpu_docs!(["`CommandEncoder::write_timestamp`"]: "struct.CommandEncoder.html#method.write_timestamp")] const TIMESTAMP_QUERY_INSIDE_ENCODERS = 1 << 5; /// Allows for timestamp queries directly on command encoders. /// @@ -673,8 +673,8 @@ bitflags_array! { /// /// This is a native only feature with a [proposal](https://github.com/gpuweb/gpuweb/blob/0008bd30da2366af88180b511a5d0d0c1dffbc36/proposals/timestamp-query-inside-passes.md) for the web. /// - /// [`RenderPass::write_timestamp`]: https://docs.rs/wgpu/latest/wgpu/struct.RenderPass.html#method.write_timestamp - /// [`ComputePass::write_timestamp`]: https://docs.rs/wgpu/latest/wgpu/struct.ComputePass.html#method.write_timestamp + #[doc = link_to_wgpu_docs!(["`RenderPass::write_timestamp`"]: "struct.RenderPass.html#method.write_timestamp")] + #[doc = link_to_wgpu_docs!(["`ComputePass::write_timestamp`"]: "struct.ComputePass.html#method.write_timestamp")] const TIMESTAMP_QUERY_INSIDE_PASSES = 1 << 6; /// Webgpu only allows the MAP_READ and MAP_WRITE buffer usage to be matched with /// COPY_DST and COPY_SRC respectively. This removes this requirement. @@ -1103,7 +1103,7 @@ bitflags_array! { /// This is a native only feature. /// /// [VK_GOOGLE_display_timing]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_GOOGLE_display_timing.html - /// [`Surface::as_hal()`]: https://docs.rs/wgpu/latest/wgpu/struct.Surface.html#method.as_hal + #[doc = link_to_wgpu_docs!(["`Surface::as_hal()`"]: "struct.Surface.html#method.as_hal")] const VULKAN_GOOGLE_DISPLAY_TIMING = 1 << 44; /// Allows using the [VK_KHR_external_memory_win32] Vulkan extension. @@ -1213,7 +1213,7 @@ bitflags_array! { /// Ideally, in the future, all platforms will be supported. For more info, see /// [this comment](https://github.com/gfx-rs/wgpu/issues/3103#issuecomment-2833058367). /// - /// [`Device::create_shader_module_passthrough`]: https://docs.rs/wgpu/latest/wgpu/struct.Device.html#method.create_shader_module_passthrough + #[doc = link_to_wgpu_docs!(["`Device::create_shader_module_passthrough`"]: "struct.Device.html#method.create_shader_module_passthrough")] const EXPERIMENTAL_PASSTHROUGH_SHADERS = 1 << 52; /// Enables shader barycentric coordinates. @@ -1255,6 +1255,25 @@ bitflags_array! { /// Supported platforms: /// - Vulkan (except VK_KHR_portability_subset if multisampleArrayImage is not available) const MULTISAMPLE_ARRAY = 1 << 56; + + /// Enables cooperative matrix operations (also known as tensor cores on NVIDIA GPUs + /// or simdgroup matrix operations on Apple GPUs). + /// + /// Cooperative matrices allow a workgroup to collectively load, store, and perform + /// matrix multiply-accumulate operations on small tiles of data, enabling + /// hardware-accelerated matrix math. + /// + /// **Current limitations:** The implementation currently only supports 8x8 f32 matrices. + /// On Vulkan, support is determined by querying `vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR` + /// for configurations matching 8x8x8 f32. Most Vulkan implementations (NVIDIA, AMD) primarily + /// support f16 inputs at larger sizes (e.g., 16x16), so Vulkan support may be limited. + /// + /// Supported platforms: + /// - Metal (with MSL 2.3+ and Apple7+/Mac2+, using simdgroup matrix operations) + /// - Vulkan (with [VK_KHR_cooperative_matrix](https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_cooperative_matrix.html), if 8x8 f32 is supported) + /// + /// This is a native only feature. + const EXPERIMENTAL_COOPERATIVE_MATRIX = 1 << 57; } /// Features that are not guaranteed to be supported. @@ -1406,10 +1425,10 @@ bitflags_array! { /// /// This is a web and native feature. /// - /// [`RenderPassDescriptor::timestamp_writes`]: https://docs.rs/wgpu/latest/wgpu/struct.RenderPassDescriptor.html#structfield.timestamp_writes - /// [`ComputePassDescriptor::timestamp_writes`]: https://docs.rs/wgpu/latest/wgpu/struct.ComputePassDescriptor.html#structfield.timestamp_writes - /// [`CommandEncoder::resolve_query_set`]: https://docs.rs/wgpu/latest/wgpu/struct.CommandEncoder.html#method.resolve_query_set - /// [`Queue::get_timestamp_period`]: https://docs.rs/wgpu/latest/wgpu/struct.Queue.html#method.get_timestamp_period + #[doc = link_to_wgpu_docs!(["`RenderPassDescriptor::timestamp_writes`"]: "struct.RenderPassDescriptor.html#structfield.timestamp_writes")] + #[doc = link_to_wgpu_docs!(["`ComputePassDescriptor::timestamp_writes`"]: "struct.ComputePassDescriptor.html#structfield.timestamp_writes")] + #[doc = link_to_wgpu_docs!(["`CommandEncoder::resolve_query_set`"]: "struct.CommandEncoder.html#method.resolve_query_set")] + #[doc = link_to_wgpu_docs!(["`Queue::get_timestamp_period`"]: "struct.Queue.html#method.get_timestamp_period")] const TIMESTAMP_QUERY = WEBGPU_FEATURE_TIMESTAMP_QUERY; /// Allows non-zero value for the `first_instance` member in indirect draw calls. @@ -1566,7 +1585,8 @@ impl Features { | FeaturesWGPU::EXPERIMENTAL_MESH_SHADER_POINTS.bits() | FeaturesWGPU::EXPERIMENTAL_RAY_QUERY.bits() | FeaturesWGPU::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN.bits() - | FeaturesWGPU::EXPERIMENTAL_PASSTHROUGH_SHADERS.bits(), + | FeaturesWGPU::EXPERIMENTAL_PASSTHROUGH_SHADERS.bits() + | FeaturesWGPU::EXPERIMENTAL_COOPERATIVE_MATRIX.bits(), FeaturesWebGPU::empty().bits(), ])) } diff --git a/third_party/rust/wgpu-types/src/instance.rs b/third_party/rust/wgpu-types/src/instance.rs @@ -5,13 +5,25 @@ use crate::{link_to_wgpu_docs, Backends}; #[cfg(doc)] use crate::{Backend, DownlevelFlags}; +/// A [`raw_window_handle::HasDisplayHandle`] that can be shared across threads and has no borrows. +/// +/// This blanket trait is automatically implemented for all objects that qualify. +pub trait WgpuHasDisplayHandle: + raw_window_handle::HasDisplayHandle + core::fmt::Debug + Send + Sync + 'static +{ +} +impl<T: raw_window_handle::HasDisplayHandle + core::fmt::Debug + Send + Sync + 'static> + WgpuHasDisplayHandle for T +{ +} + /// Options for creating an instance. /// /// If you want to allow control of instance settings via environment variables, call either /// [`InstanceDescriptor::from_env_or_default()`] or [`InstanceDescriptor::with_env()`]. Each type /// within this descriptor has its own equivalent methods, so you can select which options you want /// to expose to influence from the environment. -#[derive(Clone, Debug, Default)] +#[derive(Debug, Default)] pub struct InstanceDescriptor { /// Which [`Backends`] to enable. /// @@ -35,6 +47,21 @@ pub struct InstanceDescriptor { pub memory_budget_thresholds: MemoryBudgetThresholds, /// Options the control the behavior of specific backends. pub backend_options: crate::BackendOptions, + /// System platform or compositor connection to connect this `Instance` to. + /// + /// If not [`None`], it is invalid to pass a different [`raw_window_handle::HasDisplayHandle`] to `create_surface()`. + /// + /// - On GLES, this is required when intending to present on the platform, especially for Wayland. + /// - On Vulkan, Metal and Dx12, this is currently unused. + /// + /// When used with `winit`, callers are expected to pass its [`OwnedDisplayHandle`] (created from + /// the `EventLoop`) here. + /// + /// [`OwnedDisplayHandle`]: https://docs.rs/winit/latest/winit/event_loop/struct.OwnedDisplayHandle.html + // FUTURE: The RawDisplayHandle trait can/should be removed entirely from create_display()? At + // least `trait WindowHandle: HasWindowHandle + HasDisplayHandle` should really be removed as + // it's impractical and not implementable everywhere. + pub display: Option<alloc::boxed::Box<dyn WgpuHasDisplayHandle>>, } impl InstanceDescriptor { @@ -59,6 +86,16 @@ impl InstanceDescriptor { flags, memory_budget_thresholds: MemoryBudgetThresholds::default(), backend_options, + display: None, + } + } + + /// Appends the given `display` object to the descriptor. + #[must_use] + pub fn with_display_handle(self, display: alloc::boxed::Box<dyn WgpuHasDisplayHandle>) -> Self { + Self { + display: Some(display), + ..self } } } diff --git a/third_party/rust/wgpu-types/src/lib.rs b/third_party/rust/wgpu-types/src/lib.rs @@ -123,7 +123,7 @@ macro_rules! link_to_wgpu_docs { macro_rules! link_to_wgpu_item { ($kind:ident $name:ident) => { $crate::link_to_wgpu_docs!( - [concat!("`", stringify!($name), "`")]: concat!("$kind.", stringify!($name), ".html") + [concat!("`", stringify!($name), "`")]: concat!(stringify!($kind), ".", stringify!($name), ".html") ) }; } @@ -203,7 +203,7 @@ pub const IMMEDIATE_DATA_ALIGNMENT: u32 = 4; #[doc(hidden)] pub const STORAGE_BINDING_SIZE_ALIGNMENT: u32 = 4; -/// Maximum queries in a [`QuerySetDescriptor`]. +/// Maximum number of query result slots that can be requested in a [`QuerySetDescriptor`]. pub const QUERY_SET_MAX_QUERIES: u32 = 4096; /// Size in bytes of a single piece of [query] data. @@ -467,7 +467,7 @@ pub struct QuerySetDescriptor<L> { pub label: L, /// Kind of query that this query set should contain. pub ty: QueryType, - /// Total count of queries the set contains. Must not be zero. + /// Total number of query result slots the set contains. Must not be zero. /// Must not be greater than [`QUERY_SET_MAX_QUERIES`]. pub count: u32, } @@ -484,7 +484,9 @@ impl<L> QuerySetDescriptor<L> { } } -/// Type of query contained in a [`QuerySet`]. +/// Type of queries contained in a [`QuerySet`]. +/// +/// Each query set may contain any number of queries, but they must all be of the same type. /// /// Corresponds to [WebGPU `GPUQueryType`]( /// https://gpuweb.github.io/gpuweb/#enumdef-gpuquerytype). @@ -493,27 +495,66 @@ impl<L> QuerySetDescriptor<L> { #[derive(Copy, Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum QueryType { - /// Query returns a single 64-bit number, serving as an occlusion boolean. - Occlusion, - /// Query returns up to 5 64-bit numbers based on the given flags. + /// An occlusion query reports whether any of the fragments drawn within the scope of the query + /// passed all per-fragment tests (i.e. were not occluded). /// - /// See [`PipelineStatisticsTypes`]'s documentation for more information - /// on how they get resolved. + /// Occlusion queries are performed by setting [`RenderPassDescriptor::occlusion_query_set`], + /// then calling [`RenderPass::begin_occlusion_query()`] and + /// [`RenderPass::end_occlusion_query()`]. + /// The query writes to a single result slot in the query set, whose value will be either 0 or 1 + /// as a boolean. /// - /// [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled to use this query type. - PipelineStatistics(PipelineStatisticsTypes), - /// Query returns a 64-bit number indicating the GPU-timestamp - /// where all previous commands have finished executing. + #[doc = link_to_wgpu_docs!(["`RenderPassDescriptor::occlusion_query_set`"]: "struct.RenderPassDescriptor.html#structfield.occlusion_query_set")] + #[doc = link_to_wgpu_docs!(["`RenderPass::begin_occlusion_query()`"]: "struct.RenderPass.html#structfield.begin_occlusion_query")] + #[doc = link_to_wgpu_docs!(["`RenderPass::end_occlusion_query()`"]: "struct.RenderPass.html#structfield.end_occlusion_query")] + Occlusion, + + /// A timestamp query records a GPU-timestamp value + /// at which a certain command started or finished executing. /// - /// Must be multiplied by [`Queue::get_timestamp_period`][Qgtp] to get - /// the value in nanoseconds. Absolute values have no meaning, - /// but timestamps can be subtracted to get the time it takes + /// Timestamp queries are performed by any one of: + /// * Setting [`ComputePassDescriptor::timestamp_writes`] + /// * Setting [`RenderPassDescriptor::timestamp_writes`] + /// * Calling [`CommandEncoder::write_timestamp()`] + /// * Calling [`RenderPass::write_timestamp()`] + /// * Calling [`ComputePass::write_timestamp()`] + /// + /// Each timestamp query writes to a single result slot in the query set. + /// The timestamp value must be multiplied by [`Queue::get_timestamp_period()`][Qgtp] to get + /// the time in nanoseconds. + /// Absolute values have no meaning, but timestamps can be subtracted to get the time it takes /// for a string of operations to complete. + /// Timestamps may overflow and wrap to 0, resulting in occasional spurious negative deltas. + /// + /// Additionally, passes may be executed in parallel or out of the order they were submitted; + /// this does not affect their results but is observable via these timestamps. /// /// [`Features::TIMESTAMP_QUERY`] must be enabled to use this query type. /// + #[doc = link_to_wgpu_docs!(["`CommandEncoder::write_timestamp()`"]: "struct.CommandEncoder.html#method.write_timestamp")] + #[doc = link_to_wgpu_docs!(["`ComputePass::write_timestamp()`"]: "struct.ComputePass.html#method.write_timestamp")] + #[doc = link_to_wgpu_docs!(["`RenderPass::write_timestamp()`"]: "struct.RenderPass.html#method.write_timestamp")] + #[doc = link_to_wgpu_docs!(["`ComputePassDescriptor::timestamp_writes`"]: "struct.ComputePassDescriptor.html#structfield.timestamp_writes")] + #[doc = link_to_wgpu_docs!(["`RenderPassDescriptor::timestamp_writes`"]: "struct.RenderPassDescriptor.html#structfield.timestamp_writes")] #[doc = link_to_wgpu_docs!(["Qgtp"]: "struct.Queue.html#method.get_timestamp_period")] Timestamp, + + /// A pipeline statistics query records information about the execution of pipelines; + /// see [`PipelineStatisticsTypes`]'s documentation for details. + /// + /// Pipeline statistics queries are performed by: + /// + /// * [`ComputePass::begin_pipeline_statistics_query()`] + /// * [`RenderPass::begin_pipeline_statistics_query()`] + /// + /// A single query may occupy up to 5 result slots in the query set, based on the flags given + /// here. + /// + /// [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled to use this query type. + /// + #[doc = link_to_wgpu_docs!(["`ComputePass::begin_pipeline_statistics_query()`"]: "struct.ComputePass.html#method.begin_pipeline_statistics_query")] + #[doc = link_to_wgpu_docs!(["`RenderPass::begin_pipeline_statistics_query()`"]: "struct.RenderPass.html#method.begin_pipeline_statistics_query")] + PipelineStatistics(PipelineStatisticsTypes), } bitflags::bitflags! { diff --git a/third_party/rust/wgpu-types/src/limits.rs b/third_party/rust/wgpu-types/src/limits.rs @@ -46,7 +46,6 @@ macro_rules! with_limits { $macro_name!(max_vertex_buffer_array_stride, Ordering::Less); $macro_name!(min_uniform_buffer_offset_alignment, Ordering::Greater); $macro_name!(min_storage_buffer_offset_alignment, Ordering::Greater); - $macro_name!(max_inter_stage_shader_components, Ordering::Less); $macro_name!(max_color_attachments, Ordering::Less); $macro_name!(max_color_attachment_bytes_per_sample, Ordering::Less); $macro_name!(max_compute_workgroup_storage_size, Ordering::Less); @@ -180,6 +179,11 @@ pub struct Limits { /// Maximum value for `VertexBufferLayout::array_stride` when creating a `RenderPipeline`. /// Defaults to 2048. Higher is "better". pub max_vertex_buffer_array_stride: u32, + /// Maximum value for the number of input or output variables for inter-stage communication + /// (like vertex outputs or fragment inputs) `@location(…)`s (in WGSL parlance) + /// when creating a `RenderPipeline`. + /// Defaults to 16. Higher is "better". + pub max_inter_stage_shader_variables: u32, /// Required `BufferBindingType::Uniform` alignment for `BufferBinding::offset` /// when creating a `BindGroup`, or for `set_bind_group` `dynamicOffsets`. /// Defaults to 256. Lower is "better". @@ -188,10 +192,6 @@ pub struct Limits { /// when creating a `BindGroup`, or for `set_bind_group` `dynamicOffsets`. /// Defaults to 256. Lower is "better". pub min_storage_buffer_offset_alignment: u32, - /// Maximum allowed number of components (scalars) of input or output locations for - /// inter-stage communication (vertex outputs to fragment inputs). Defaults to 60. - /// Higher is "better". - pub max_inter_stage_shader_components: u32, /// The maximum allowed number of color attachments. pub max_color_attachments: u32, /// The maximum number of bytes necessary to hold one sample (pixel or subpixel) of render @@ -325,9 +325,9 @@ impl Limits { /// max_buffer_size: 256 << 20, // (256 MiB) /// max_vertex_attributes: 16, /// max_vertex_buffer_array_stride: 2048, + /// max_inter_stage_shader_variables: 16, /// min_uniform_buffer_offset_alignment: 256, /// min_storage_buffer_offset_alignment: 256, - /// max_inter_stage_shader_components: 60, /// max_color_attachments: 8, /// max_color_attachment_bytes_per_sample: 32, /// max_compute_workgroup_storage_size: 16384, @@ -383,9 +383,9 @@ impl Limits { max_buffer_size: 256 << 20, // (256 MiB) max_vertex_attributes: 16, max_vertex_buffer_array_stride: 2048, + max_inter_stage_shader_variables: 16, min_uniform_buffer_offset_alignment: 256, min_storage_buffer_offset_alignment: 256, - max_inter_stage_shader_components: 60, max_color_attachments: 8, max_color_attachment_bytes_per_sample: 32, max_compute_workgroup_storage_size: 16384, @@ -447,7 +447,7 @@ impl Limits { /// max_immediate_size: 0, /// min_uniform_buffer_offset_alignment: 256, /// min_storage_buffer_offset_alignment: 256, - /// max_inter_stage_shader_components: 60, + /// max_inter_stage_shader_variables: 15, /// max_color_attachments: 4, /// max_color_attachment_bytes_per_sample: 32, /// max_compute_workgroup_storage_size: 16352, // * @@ -487,6 +487,7 @@ impl Limits { max_texture_dimension_3d: 256, max_storage_buffers_per_shader_stage: 4, max_uniform_buffer_binding_size: 16 << 10, // (16 KiB) + max_inter_stage_shader_variables: 15, max_color_attachments: 4, // see: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=7 max_compute_workgroup_storage_size: 16352, @@ -524,7 +525,7 @@ impl Limits { /// max_immediate_size: 0, /// min_uniform_buffer_offset_alignment: 256, /// min_storage_buffer_offset_alignment: 256, - /// max_inter_stage_shader_components: 31, + /// max_inter_stage_shader_variables: 15, /// max_color_attachments: 4, /// max_color_attachment_bytes_per_sample: 32, /// max_compute_workgroup_storage_size: 0, // + @@ -573,7 +574,7 @@ impl Limits { max_compute_workgroups_per_dimension: 0, // Value supported by Intel Celeron B830 on Windows (OpenGL 3.1) - max_inter_stage_shader_components: 31, + max_inter_stage_shader_variables: 15, // Most of the values should be the same as the downlevel defaults ..Self::downlevel_defaults()