diff --git a/.cargo/config.in b/.cargo/config.in index 2deaab3f46a5d..a470e76e09eb2 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -25,9 +25,9 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7"] +[source."git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d"] git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" replace-with = "vendored-sources" [source."git+https://github.com/hsivonen/chardetng?rev=3484d3e3ebdc8931493aa5df4d7ee9360a90e76b"] diff --git a/Cargo.lock b/Cargo.lock index c0cd98fe98fbe..df199130db8ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "d3d12" version = "0.7.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7#46757372cc02d6608124502104a0c225e1744fd7" +source = "git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d#4b82121501a61c2c2e11cb472d70ba54af3aa12d" dependencies = [ "bitflags 2.4.0", "libloading", @@ -3796,7 +3796,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "0.14.2" -source = "git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7#46757372cc02d6608124502104a0c225e1744fd7" +source = "git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d#4b82121501a61c2c2e11cb472d70ba54af3aa12d" dependencies = [ "bit-set", "bitflags 2.4.0", @@ -4937,9 +4937,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] @@ -4965,9 +4965,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", @@ -5178,12 +5178,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.999.999", - "num-traits", + "bitflags 2.4.0", ] [[package]] @@ -6412,14 +6411,16 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7#46757372cc02d6608124502104a0c225e1744fd7" +source = "git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d#4b82121501a61c2c2e11cb472d70ba54af3aa12d" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.4.0", "codespan-reporting", + "indexmap 2.999.999", "log", "naga", + "once_cell", "parking_lot", "profiling", "ron", @@ -6435,7 +6436,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7#46757372cc02d6608124502104a0c225e1744fd7" +source = "git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d#4b82121501a61c2c2e11cb472d70ba54af3aa12d" dependencies = [ "android_system_properties", "arrayvec", @@ -6472,7 +6473,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=46757372cc02d6608124502104a0c225e1744fd7#46757372cc02d6608124502104a0c225e1744fd7" +source = "git+https://github.com/gfx-rs/wgpu?rev=4b82121501a61c2c2e11cb472d70ba54af3aa12d#4b82121501a61c2c2e11cb472d70ba54af3aa12d" dependencies = [ "bitflags 2.4.0", "js-sys", diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml index 7bdcd4c32289a..24cf66cb5f98c 100644 --- a/gfx/wgpu_bindings/Cargo.toml +++ b/gfx/wgpu_bindings/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" #Note: "replay" shouldn't ideally be needed, # but it allows us to serialize everything across IPC. features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl", "api_log_info"] @@ -27,36 +27,36 @@ features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl", "api_log [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" 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 = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" 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 = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" [target.'cfg(windows)'.dependencies.d3d12] git = "https://github.com/gfx-rs/wgpu" -rev = "46757372cc02d6608124502104a0c225e1744fd7" +rev = "4b82121501a61c2c2e11cb472d70ba54af3aa12d" [target.'cfg(windows)'.dependencies] winapi = "0.3" diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml index 65da492fc3087..07e4a75c792b3 100644 --- a/gfx/wgpu_bindings/moz.yaml +++ b/gfx/wgpu_bindings/moz.yaml @@ -20,11 +20,11 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: commit 46757372cc02d6608124502104a0c225e1744fd7 + release: commit 4b82121501a61c2c2e11cb472d70ba54af3aa12d # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: 46757372cc02d6608124502104a0c225e1744fd7 + revision: 4b82121501a61c2c2e11cb472d70ba54af3aa12d license: ['MIT', 'Apache-2.0'] diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 9140f24d83b7b..7e43b4322f7f5 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -1269,7 +1269,7 @@ who = [ "Nicolas Silva ", ] criteria = "safe-to-deploy" -delta = "0.7.0 -> 0.7.0@git:46757372cc02d6608124502104a0c225e1744fd7" +delta = "0.7.0 -> 0.7.0@git:4b82121501a61c2c2e11cb472d70ba54af3aa12d" importable = false [[audits.darling]] @@ -2541,7 +2541,7 @@ delta = "0.13.0 -> 0.14.0" [[audits.naga]] who = ["Jim Blandy ", "Nicolas Silva "] criteria = "safe-to-deploy" -delta = "0.14.0 -> 0.14.2@git:46757372cc02d6608124502104a0c225e1744fd7" +delta = "0.14.0 -> 0.14.2@git:4b82121501a61c2c2e11cb472d70ba54af3aa12d" importable = false [[audits.net2]] @@ -3519,6 +3519,11 @@ who = "Mike Hommey " criteria = "safe-to-deploy" delta = "0.4.4 -> 0.4.7" +[[audits.spirv]] +who = "Nicolas Silva " +criteria = "safe-to-deploy" +delta = "0.2.0+1.5.4 -> 0.3.0+sdk-1.3.268.0" + [[audits.strck]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -4308,7 +4313,7 @@ delta = "0.17.0 -> 0.18.0" [[audits.wgpu-core]] who = ["Jim Blandy ", "Nicolas Silva "] criteria = "safe-to-deploy" -delta = "0.18.0 -> 0.18.0@git:46757372cc02d6608124502104a0c225e1744fd7" +delta = "0.18.0 -> 0.18.0@git:4b82121501a61c2c2e11cb472d70ba54af3aa12d" importable = false [[audits.wgpu-hal]] @@ -4357,7 +4362,7 @@ delta = "0.17.0 -> 0.18.0" [[audits.wgpu-hal]] who = ["Jim Blandy ", "Nicolas Silva "] criteria = "safe-to-deploy" -delta = "0.18.0 -> 0.18.0@git:46757372cc02d6608124502104a0c225e1744fd7" +delta = "0.18.0 -> 0.18.0@git:4b82121501a61c2c2e11cb472d70ba54af3aa12d" importable = false [[audits.wgpu-types]] @@ -4406,7 +4411,7 @@ delta = "0.17.0 -> 0.18.0" [[audits.wgpu-types]] who = ["Jim Blandy ", "Nicolas Silva "] criteria = "safe-to-deploy" -delta = "0.18.0 -> 0.18.0@git:46757372cc02d6608124502104a0c225e1744fd7" +delta = "0.18.0 -> 0.18.0@git:4b82121501a61c2c2e11cb472d70ba54af3aa12d" importable = false [[audits.whatsys]] diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 204d1d760ad37..b23930ebc95a3 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -545,6 +545,13 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" +[[publisher.serde]] +version = "1.0.194" +when = "2024-01-02" +user-id = 3618 +user-login = "dtolnay" +user-name = "David Tolnay" + [[publisher.serde_bytes]] version = "0.11.9" when = "2023-02-05" @@ -573,6 +580,13 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" +[[publisher.serde_derive]] +version = "1.0.194" +when = "2024-01-02" +user-id = 3618 +user-login = "dtolnay" +user-name = "David Tolnay" + [[publisher.serde_json]] version = "1.0.93" when = "2023-02-08" diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json index f2a66cdcdb2b4..5323ad0b2c712 100644 --- a/third_party/rust/naga/.cargo-checksum.json +++ b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"772216b2e6d35621ab36c985e8114b54403e2f3fb49bf1f8540c451fd06f8387","Cargo.toml":"db839f1b4ab6abd390be6fceaa0c79b0b7a61eed2ab2cf88a90ed92339167837","README.md":"a76b47b656e7390265312709b62b357a4f39c7509ec9ebe0b133c5841a8ab60b","benches/criterion.rs":"f45e38b26e1323e934d32623572ff5395a53fed06f760eb1e07b22ed07858a38","src/arena.rs":"33ed2ec7b36429b133ed2a7de6fb9735827f69ea8b6c2ce97f64746a24a5bf36","src/back/dot/mod.rs":"a40050a73ac00c8fa43dd0b45a84fca6959d28c8c99ab3046b01f33c02f8c8f4","src/back/glsl/features.rs":"90c6a6255d550e9d97a04d6b6660c1a7af8e2433dd9379dc1d527693fa56523b","src/back/glsl/keywords.rs":"1546facbaddf696602102f32e47db7afc875f8ca3fbccc2122e0bcc45e022b53","src/back/glsl/mod.rs":"bba387392e3b9b22835d78a1db7d1490e7199cafcb347d54b22373b7b76b2900","src/back/hlsl/conv.rs":"5e40946f2d5ad6589dd2b0570d2c300dd96f92f0f954b829dc54a822de7774e8","src/back/hlsl/help.rs":"8f4ec24f74f3153a58b04f441bef16ecc8d400466d53187b06fb6b60a934a1ec","src/back/hlsl/keywords.rs":"eb4af8d697fb7f3991859d66339b5b2eac27c9fe41b73146ac838b207f462c9c","src/back/hlsl/mod.rs":"c677ebbb649a1c5f85f350d8da7129457d50ff52b1c88c1f0fac4a9d11eb020c","src/back/hlsl/storage.rs":"3170f165ff68d2482f8a8dbfa4bbf4b65d2446a7f208f33eea9eb187bb57eb09","src/back/hlsl/writer.rs":"8e61501bae6982273a525734d3e446694d4bf7a081419ec312c32b354e89d3ef","src/back/mod.rs":"b941caed50c086f49d25e76228d247ba6c2da6dbeea18d968c02dc68bb97f409","src/back/msl/keywords.rs":"998c0d86a26e5cf031c75f35cde28f2b390fe207a2e7d0eed8516ffdb99c1a8e","src/back/msl/mod.rs":"16d905902e30cf900ec924b66ff496adbbbc54af15c59713f358bfac042a625a","src/back/msl/sampler.rs":"9b01d68669e12ff7123243284b85e1a9d2c4d49140bd74ca32dedc007cbf15af","src/back/msl/writer.rs":"9503df4ae10d1d7b6840cb68e2e2ff4f7ed8761b217faa99e6927d87da546071","src/back/spv/block.rs":"2881cbc6c0a3e310a777b61c950dd97bbee5776583fe6ef13ee04095a8214768","src/back/spv/helpers.rs":"a4e260130f39c7345decec40dadf1e94419c8f6d236ce7a53b5300aa72952a1b","src/back/spv/image.rs":"5840a6d5cdffbf30cb20a76ddfdb468041fc6b687a476b3b2fc2553bda6f4af7","src/back/spv/index.rs":"26611dd50df5cfd214900e19415f5374dd301d3b7d3bfedbc5ec0f254328287a","src/back/spv/instructions.rs":"d0ced535fdec49323105a7d6ee40a8ed6b4966ac5f0f40b062f0eb11a531b106","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"31b0229f59b5784b57851fcf6325095add58af6de3afa85d518a4e266c4b99a9","src/back/spv/ray.rs":"a34bf6b26d873f7270caa45841d9ef291aca8d9732ecd086b14d8856038e1e41","src/back/spv/recyclable.rs":"114db0ea12774d6514f995d07295cb9a42631ab75165fc60980c10e9b5ecb832","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/writer.rs":"a76a73c0692162da24ab5508bc3ca70eb5e01367fe54472d100e237dbd594467","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"15ba0e1ab7358b725d1cbc2e0b0b2284c33cc240ae84b20e186519efbb5d96d9","src/block.rs":"c69089e5bbb6de6ba24efb15b21d5d434fcabfbc4d48feae948d2a4da135aae7","src/compact/expressions.rs":"7a4c916282a5b484519ed29ab451c7b595d8dea73c83c5c2cf7efc6fbc648fda","src/compact/functions.rs":"174bd9167ecf6353afb8c36d365ba3f9b483233eb4bacf578e50183c7433aa15","src/compact/handle_set_map.rs":"817c5193352d5fd6a61a5c970daba23224e14a65aea15f8f1c8679c99f834ca2","src/compact/mod.rs":"8abea7a8a9870d953fb628a32bac2bc15e87e077910cb95aa1f26e58a0a35c2a","src/compact/statements.rs":"4df33ee9589300e769e75c674bdc30578e93704ec3eb2aabc7132121745b55c8","src/compact/types.rs":"18343f2ca2c123eea2531cffc1d54a7798797caccecaa1f9b8c4fd5dd6ca1a05","src/front/glsl/ast.rs":"2ae292c09fed43951e20ec6ce0b7b99efe91726cf90487d6c129137b08618e01","src/front/glsl/builtins.rs":"d35501d5b42b61c261da24436b82eafdf96371b1600d148648d90d041f736ae4","src/front/glsl/context.rs":"2f07a63209258a8459ae6a6ef8277313c4dc771ab96ef6f5ab3a383a0d3599ba","src/front/glsl/error.rs":"08409f8cc13b73c6eda938ff7ebf2b46e9d27c66d718d640ad8d6a33fddbb7a1","src/front/glsl/functions.rs":"60838c34b8295112e5696b52d710acebb93e0a982e05f8eb87d3b80f52eb7793","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"c8e435a894d641e6c92fcd7d357d51e1136af1a69410fbaedb88c7262b2269df","src/front/glsl/offset.rs":"9358602ca4f9ef21d5066d674dae757bf88fdf5c289c4360534354d13bd41dc0","src/front/glsl/parser.rs":"fe5291512db412b33b6c09d5b3dcf7c54ff6ec55b47f0a078dcc11695e78471d","src/front/glsl/parser/declarations.rs":"d637cc52e553910a2e97b70b3366c15aefbe737f413adb11c27efd184c1fbf9d","src/front/glsl/parser/expressions.rs":"520cfc9402d5fbd48e52ef1d36562c6b74794c09ec33ec1ebb10aa48d129b66f","src/front/glsl/parser/functions.rs":"670ca6bba5a56f3919968658966b05ba824c2d76427b8927d4b111f715091629","src/front/glsl/parser/types.rs":"0971bc98cbde1d70c0ced1717c8726a12a5bfafa9a72b127ed242db5435ec8a8","src/front/glsl/parser_tests.rs":"fc2120fff132af850b52f9ac5d19f0c2fce7997b17ba49881b155d173359cfd3","src/front/glsl/token.rs":"fbfa7dd1b90e10ec92ffb994fa4eea7bd8a309feec6372cacbacbd92900c3336","src/front/glsl/types.rs":"58c9cf3d570dff8cb68f2931faf5b18e875e510741bf035ec10b9ff6df27c5d8","src/front/glsl/variables.rs":"fb2a09e386b6e98ca9fb8fb744afac1e8b19d1b67c6ede5c474e3ba860d3d4cb","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"6f77ca3ff925cc16e5ae46132bd6196ca4c9c80a7db123f0d2ec09aae93ba51f","src/front/spv/convert.rs":"9b4ecc53131b6250cde4cae93557eb467127e9e8d0536d29a851538684ae5371","src/front/spv/error.rs":"3129fd1fe346441d61d0f641734df7e919919db15df706788d16402ebf480607","src/front/spv/function.rs":"3a3f0c07862750f79f8ebc273c5df11efc67272566458410f776bd8fa271a0f8","src/front/spv/image.rs":"5d55cfbf6752732a594114cd09a9a207216e1ee85d8f2c9bc4310217a55ea321","src/front/spv/mod.rs":"ccbeb4b80959c00323b2459e316b7c5c7e3f313ab94f2151fa44a2dee6255d4e","src/front/spv/null.rs":"e1446d99d04c76a9c3bbd24dd9b20c4711ce8a918a9b403be6cccbde1175b3b4","src/front/type_gen.rs":"b4f1df23380e06c9fdad4140810ce96ab041dbb1d371a07045b4e0069aa8ba55","src/front/wgsl/error.rs":"dfe96023d82afaa028644568ac550a3ccef053c9f2a6d787d5f14db59a4c7c65","src/front/wgsl/index.rs":"2b9a4929a46bd822d3ed6f9a150e24d437e5bdca8293eb748aebe80ce7e74153","src/front/wgsl/lower/construction.rs":"db15eadf96157ac741eb46d73380df8e326c84402fa49196e8d5a8b52579a626","src/front/wgsl/lower/conversion.rs":"961b19bf8ddd4667c6caf854a1889f3d6477757f4125538c3e9ca7d730975dd7","src/front/wgsl/lower/mod.rs":"3c05236144dda95de54460820aa6586437c5344ee170a083b4fb1085cde24711","src/front/wgsl/mod.rs":"02b194a0a29ef7281f71b424564e18ada4a8b1a0d8c26ec40b6be195bd4c4904","src/front/wgsl/parse/ast.rs":"c7eaae40179f0889f2b142d3b31968cbfab6d3cfe02e425912c6da8dadac51df","src/front/wgsl/parse/conv.rs":"01b25edbe80b263a3fa51bc980c075630bb31d4af851441323383eb4f3b83360","src/front/wgsl/parse/lexer.rs":"17db87d0017f8f9a80fa151b8545f04e1b40c4e5feef6197f4a117efa03488bf","src/front/wgsl/parse/mod.rs":"3b4895a2baf91c719b95f0afb6441ffac2036c2a9ff817e633882fd257afcc38","src/front/wgsl/parse/number.rs":"43b2a03963e61ee047eeac144ab817bf9f9e9a9517b26b68ff40f2f6236de05d","src/front/wgsl/tests.rs":"39d0b44d0f073a7599c88b7c4efd1572886f3af074fa2015454623be313b297f","src/front/wgsl/to_wgsl.rs":"2e2e30d86b07f209b866e530d3a882803bf28b39ce379052561a749f628e8e28","src/keywords/mod.rs":"0138f3931f8af0b0a05174549d0fd2152945b027dc3febefc1bbd676581d2e45","src/keywords/wgsl.rs":"7c3b364b60ca29cb8a68ef781de9ecd28b76b74bed18bf18a35d2ebffaa855ab","src/lib.rs":"c5d91c603ae310a7ef9ff8444898959a3dbbc32ba262cabb1fd5682823921d98","src/proc/constant_evaluator.rs":"112563dea58b1f2dc32644f71931c667bfbf3e5131ce4f7040d6d162c20ab951","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"f4250f6944c2b631e8140979024e8deb86fa8d5352d8641ba954a388b2c0940e","src/proc/layouter.rs":"b3d061c87424f36981c902716f37ab7b72f2bb2d0c2d7e900c51149318ea1a0a","src/proc/mod.rs":"221472328c410213fe9e794a1d2336af3798cc0e9f2cd027c754ea29f251cbfc","src/proc/namer.rs":"7328fac41e40890c64c7ee2fa985a4395424f18b08d30f30ca2583fdabd2fd35","src/proc/terminator.rs":"13c59bf00f5b26171d971effc421091f5e00dedddd246c2daa44fe65aeda060a","src/proc/typifier.rs":"99de19270d01c12ec49d14323aa1d9b8774f1ee715804af7235deff70739ba3d","src/span.rs":"6560599f20b8bc2de746ee9fd6b05c32bb630af914fce8845d84fdc72f9a636c","src/valid/analyzer.rs":"8472b98f16a4a4a0fa7079197db25696f77ef3e1602a7cddea1930daebd27917","src/valid/compose.rs":"83e4c09c39f853cf085b83b87e48b3db571da619132960d3ec954ebdfb0a74f2","src/valid/expression.rs":"1cdbd594dbdb33d8473d93c11112cf717e262bb8c35cee10b01db4322b2237d7","src/valid/function.rs":"5ec31146aacf7daae689836ff3e2978f075f2cc62b3fd829d09c760a6e606501","src/valid/handles.rs":"0878915e67b16d7c41cf8245d9ab3b3f4a604e7d4e87527ea40e03efcbf1f74a","src/valid/interface.rs":"6ddf5f8d5150342d2e8c754a71c92c85d8533fd1d4c6b7a83a05b508e8e8114d","src/valid/mod.rs":"9e2bafa06bea16db2c5a8f825eed4d008c474b87cda2fc7e82ca7a21229c6f20","src/valid/type.rs":"09e18bb9510dbb0cfb4a8ac054afee4c4f56063d614159ab5b956aa1e5850468"},"package":null} \ No newline at end of file +{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"772216b2e6d35621ab36c985e8114b54403e2f3fb49bf1f8540c451fd06f8387","Cargo.toml":"7d17ae22195889b93b02b2adaff36d76ecf7a9ed24917f2c0eec44e7548bc75e","README.md":"a76b47b656e7390265312709b62b357a4f39c7509ec9ebe0b133c5841a8ab60b","benches/criterion.rs":"f45e38b26e1323e934d32623572ff5395a53fed06f760eb1e07b22ed07858a38","src/arena.rs":"33ed2ec7b36429b133ed2a7de6fb9735827f69ea8b6c2ce97f64746a24a5bf36","src/back/dot/mod.rs":"a40050a73ac00c8fa43dd0b45a84fca6959d28c8c99ab3046b01f33c02f8c8f4","src/back/glsl/features.rs":"90c6a6255d550e9d97a04d6b6660c1a7af8e2433dd9379dc1d527693fa56523b","src/back/glsl/keywords.rs":"1546facbaddf696602102f32e47db7afc875f8ca3fbccc2122e0bcc45e022b53","src/back/glsl/mod.rs":"bba387392e3b9b22835d78a1db7d1490e7199cafcb347d54b22373b7b76b2900","src/back/hlsl/conv.rs":"5e40946f2d5ad6589dd2b0570d2c300dd96f92f0f954b829dc54a822de7774e8","src/back/hlsl/help.rs":"8f4ec24f74f3153a58b04f441bef16ecc8d400466d53187b06fb6b60a934a1ec","src/back/hlsl/keywords.rs":"eb4af8d697fb7f3991859d66339b5b2eac27c9fe41b73146ac838b207f462c9c","src/back/hlsl/mod.rs":"c677ebbb649a1c5f85f350d8da7129457d50ff52b1c88c1f0fac4a9d11eb020c","src/back/hlsl/storage.rs":"3170f165ff68d2482f8a8dbfa4bbf4b65d2446a7f208f33eea9eb187bb57eb09","src/back/hlsl/writer.rs":"8e61501bae6982273a525734d3e446694d4bf7a081419ec312c32b354e89d3ef","src/back/mod.rs":"b941caed50c086f49d25e76228d247ba6c2da6dbeea18d968c02dc68bb97f409","src/back/msl/keywords.rs":"998c0d86a26e5cf031c75f35cde28f2b390fe207a2e7d0eed8516ffdb99c1a8e","src/back/msl/mod.rs":"16d905902e30cf900ec924b66ff496adbbbc54af15c59713f358bfac042a625a","src/back/msl/sampler.rs":"9b01d68669e12ff7123243284b85e1a9d2c4d49140bd74ca32dedc007cbf15af","src/back/msl/writer.rs":"9503df4ae10d1d7b6840cb68e2e2ff4f7ed8761b217faa99e6927d87da546071","src/back/spv/block.rs":"2881cbc6c0a3e310a777b61c950dd97bbee5776583fe6ef13ee04095a8214768","src/back/spv/helpers.rs":"a4e260130f39c7345decec40dadf1e94419c8f6d236ce7a53b5300aa72952a1b","src/back/spv/image.rs":"5840a6d5cdffbf30cb20a76ddfdb468041fc6b687a476b3b2fc2553bda6f4af7","src/back/spv/index.rs":"26611dd50df5cfd214900e19415f5374dd301d3b7d3bfedbc5ec0f254328287a","src/back/spv/instructions.rs":"d0ced535fdec49323105a7d6ee40a8ed6b4966ac5f0f40b062f0eb11a531b106","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"31b0229f59b5784b57851fcf6325095add58af6de3afa85d518a4e266c4b99a9","src/back/spv/ray.rs":"a34bf6b26d873f7270caa45841d9ef291aca8d9732ecd086b14d8856038e1e41","src/back/spv/recyclable.rs":"114db0ea12774d6514f995d07295cb9a42631ab75165fc60980c10e9b5ecb832","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/writer.rs":"a76a73c0692162da24ab5508bc3ca70eb5e01367fe54472d100e237dbd594467","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"15ba0e1ab7358b725d1cbc2e0b0b2284c33cc240ae84b20e186519efbb5d96d9","src/block.rs":"c69089e5bbb6de6ba24efb15b21d5d434fcabfbc4d48feae948d2a4da135aae7","src/compact/expressions.rs":"7a4c916282a5b484519ed29ab451c7b595d8dea73c83c5c2cf7efc6fbc648fda","src/compact/functions.rs":"174bd9167ecf6353afb8c36d365ba3f9b483233eb4bacf578e50183c7433aa15","src/compact/handle_set_map.rs":"817c5193352d5fd6a61a5c970daba23224e14a65aea15f8f1c8679c99f834ca2","src/compact/mod.rs":"8abea7a8a9870d953fb628a32bac2bc15e87e077910cb95aa1f26e58a0a35c2a","src/compact/statements.rs":"4df33ee9589300e769e75c674bdc30578e93704ec3eb2aabc7132121745b55c8","src/compact/types.rs":"18343f2ca2c123eea2531cffc1d54a7798797caccecaa1f9b8c4fd5dd6ca1a05","src/front/glsl/ast.rs":"2ae292c09fed43951e20ec6ce0b7b99efe91726cf90487d6c129137b08618e01","src/front/glsl/builtins.rs":"d35501d5b42b61c261da24436b82eafdf96371b1600d148648d90d041f736ae4","src/front/glsl/context.rs":"57b48140713241a92c8786791a02002076b1bc1869acd1d8651c6f082c7641f1","src/front/glsl/error.rs":"08409f8cc13b73c6eda938ff7ebf2b46e9d27c66d718d640ad8d6a33fddbb7a1","src/front/glsl/functions.rs":"60838c34b8295112e5696b52d710acebb93e0a982e05f8eb87d3b80f52eb7793","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"c8e435a894d641e6c92fcd7d357d51e1136af1a69410fbaedb88c7262b2269df","src/front/glsl/offset.rs":"9358602ca4f9ef21d5066d674dae757bf88fdf5c289c4360534354d13bd41dc0","src/front/glsl/parser.rs":"fe5291512db412b33b6c09d5b3dcf7c54ff6ec55b47f0a078dcc11695e78471d","src/front/glsl/parser/declarations.rs":"d637cc52e553910a2e97b70b3366c15aefbe737f413adb11c27efd184c1fbf9d","src/front/glsl/parser/expressions.rs":"520cfc9402d5fbd48e52ef1d36562c6b74794c09ec33ec1ebb10aa48d129b66f","src/front/glsl/parser/functions.rs":"670ca6bba5a56f3919968658966b05ba824c2d76427b8927d4b111f715091629","src/front/glsl/parser/types.rs":"0971bc98cbde1d70c0ced1717c8726a12a5bfafa9a72b127ed242db5435ec8a8","src/front/glsl/parser_tests.rs":"fc2120fff132af850b52f9ac5d19f0c2fce7997b17ba49881b155d173359cfd3","src/front/glsl/token.rs":"fbfa7dd1b90e10ec92ffb994fa4eea7bd8a309feec6372cacbacbd92900c3336","src/front/glsl/types.rs":"58c9cf3d570dff8cb68f2931faf5b18e875e510741bf035ec10b9ff6df27c5d8","src/front/glsl/variables.rs":"fb2a09e386b6e98ca9fb8fb744afac1e8b19d1b67c6ede5c474e3ba860d3d4cb","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"6f77ca3ff925cc16e5ae46132bd6196ca4c9c80a7db123f0d2ec09aae93ba51f","src/front/spv/convert.rs":"dccc6671e6a4a7f1139aecdf979faa3689609081af5fa2cbbd6a2e8c4128c004","src/front/spv/error.rs":"3129fd1fe346441d61d0f641734df7e919919db15df706788d16402ebf480607","src/front/spv/function.rs":"3a3f0c07862750f79f8ebc273c5df11efc67272566458410f776bd8fa271a0f8","src/front/spv/image.rs":"5d55cfbf6752732a594114cd09a9a207216e1ee85d8f2c9bc4310217a55ea321","src/front/spv/mod.rs":"363775ff0e025963f95ec71b95221e79dee126efc6838bed0ee677f365c531d0","src/front/spv/null.rs":"e1446d99d04c76a9c3bbd24dd9b20c4711ce8a918a9b403be6cccbde1175b3b4","src/front/type_gen.rs":"b4f1df23380e06c9fdad4140810ce96ab041dbb1d371a07045b4e0069aa8ba55","src/front/wgsl/error.rs":"dfe96023d82afaa028644568ac550a3ccef053c9f2a6d787d5f14db59a4c7c65","src/front/wgsl/index.rs":"2b9a4929a46bd822d3ed6f9a150e24d437e5bdca8293eb748aebe80ce7e74153","src/front/wgsl/lower/construction.rs":"db15eadf96157ac741eb46d73380df8e326c84402fa49196e8d5a8b52579a626","src/front/wgsl/lower/conversion.rs":"961b19bf8ddd4667c6caf854a1889f3d6477757f4125538c3e9ca7d730975dd7","src/front/wgsl/lower/mod.rs":"3c05236144dda95de54460820aa6586437c5344ee170a083b4fb1085cde24711","src/front/wgsl/mod.rs":"02b194a0a29ef7281f71b424564e18ada4a8b1a0d8c26ec40b6be195bd4c4904","src/front/wgsl/parse/ast.rs":"c7eaae40179f0889f2b142d3b31968cbfab6d3cfe02e425912c6da8dadac51df","src/front/wgsl/parse/conv.rs":"01b25edbe80b263a3fa51bc980c075630bb31d4af851441323383eb4f3b83360","src/front/wgsl/parse/lexer.rs":"17db87d0017f8f9a80fa151b8545f04e1b40c4e5feef6197f4a117efa03488bf","src/front/wgsl/parse/mod.rs":"3b4895a2baf91c719b95f0afb6441ffac2036c2a9ff817e633882fd257afcc38","src/front/wgsl/parse/number.rs":"43b2a03963e61ee047eeac144ab817bf9f9e9a9517b26b68ff40f2f6236de05d","src/front/wgsl/tests.rs":"39d0b44d0f073a7599c88b7c4efd1572886f3af074fa2015454623be313b297f","src/front/wgsl/to_wgsl.rs":"2e2e30d86b07f209b866e530d3a882803bf28b39ce379052561a749f628e8e28","src/keywords/mod.rs":"0138f3931f8af0b0a05174549d0fd2152945b027dc3febefc1bbd676581d2e45","src/keywords/wgsl.rs":"7c3b364b60ca29cb8a68ef781de9ecd28b76b74bed18bf18a35d2ebffaa855ab","src/lib.rs":"c5d91c603ae310a7ef9ff8444898959a3dbbc32ba262cabb1fd5682823921d98","src/proc/constant_evaluator.rs":"112563dea58b1f2dc32644f71931c667bfbf3e5131ce4f7040d6d162c20ab951","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"f4250f6944c2b631e8140979024e8deb86fa8d5352d8641ba954a388b2c0940e","src/proc/layouter.rs":"b3d061c87424f36981c902716f37ab7b72f2bb2d0c2d7e900c51149318ea1a0a","src/proc/mod.rs":"221472328c410213fe9e794a1d2336af3798cc0e9f2cd027c754ea29f251cbfc","src/proc/namer.rs":"7328fac41e40890c64c7ee2fa985a4395424f18b08d30f30ca2583fdabd2fd35","src/proc/terminator.rs":"13c59bf00f5b26171d971effc421091f5e00dedddd246c2daa44fe65aeda060a","src/proc/typifier.rs":"99de19270d01c12ec49d14323aa1d9b8774f1ee715804af7235deff70739ba3d","src/span.rs":"6560599f20b8bc2de746ee9fd6b05c32bb630af914fce8845d84fdc72f9a636c","src/valid/analyzer.rs":"8472b98f16a4a4a0fa7079197db25696f77ef3e1602a7cddea1930daebd27917","src/valid/compose.rs":"83e4c09c39f853cf085b83b87e48b3db571da619132960d3ec954ebdfb0a74f2","src/valid/expression.rs":"1cdbd594dbdb33d8473d93c11112cf717e262bb8c35cee10b01db4322b2237d7","src/valid/function.rs":"5ec31146aacf7daae689836ff3e2978f075f2cc62b3fd829d09c760a6e606501","src/valid/handles.rs":"0878915e67b16d7c41cf8245d9ab3b3f4a604e7d4e87527ea40e03efcbf1f74a","src/valid/interface.rs":"6ddf5f8d5150342d2e8c754a71c92c85d8533fd1d4c6b7a83a05b508e8e8114d","src/valid/mod.rs":"9e2bafa06bea16db2c5a8f825eed4d008c474b87cda2fc7e82ca7a21229c6f20","src/valid/type.rs":"09e18bb9510dbb0cfb4a8ac054afee4c4f56063d614159ab5b956aa1e5850468"},"package":null} \ No newline at end of file diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml index 046386ce594d2..ed67269486ce7 100644 --- a/third_party/rust/naga/Cargo.toml +++ b/third_party/rust/naga/Cargo.toml @@ -51,7 +51,7 @@ bitflags = "2.2" log = "0.4" num-traits = "0.2" rustc-hash = "1.1.0" -thiserror = "1.0.52" +thiserror = "1.0.56" [dependencies.arbitrary] version = "1.3" @@ -78,12 +78,12 @@ version = "0.2.1" optional = true [dependencies.serde] -version = "1.0.193" +version = "1.0.194" features = ["derive"] optional = true [dependencies.spirv] -version = "0.2" +version = "0.3" optional = true [dependencies.termcolor] @@ -113,7 +113,7 @@ version = "1.0" features = ["derive"] [dev-dependencies.spirv] -version = "0.2" +version = "0.3" features = ["deserialize"] [features] diff --git a/third_party/rust/naga/src/front/glsl/context.rs b/third_party/rust/naga/src/front/glsl/context.rs index 8a5249211e8ea..98ec021a5a103 100644 --- a/third_party/rust/naga/src/front/glsl/context.rs +++ b/third_party/rust/naga/src/front/glsl/context.rs @@ -1478,7 +1478,11 @@ impl Index> for Context<'_> { type Output = Expression; fn index(&self, index: Handle) -> &Self::Output { - &self.expressions[index] + if self.is_const { + &self.module.const_expressions[index] + } else { + &self.expressions[index] + } } } diff --git a/third_party/rust/naga/src/front/spv/convert.rs b/third_party/rust/naga/src/front/spv/convert.rs index efd95898b8809..f0a714fbeb9e8 100644 --- a/third_party/rust/naga/src/front/spv/convert.rs +++ b/third_party/rust/naga/src/front/spv/convert.rs @@ -1,5 +1,4 @@ use super::error::Error; -use num_traits::cast::FromPrimitive; use std::convert::TryInto; pub(super) const fn map_binary_operator(word: spirv::Op) -> Result { diff --git a/third_party/rust/naga/src/front/spv/mod.rs b/third_party/rust/naga/src/front/spv/mod.rs index e7f07ebc580b8..d347302825a6d 100644 --- a/third_party/rust/naga/src/front/spv/mod.rs +++ b/third_party/rust/naga/src/front/spv/mod.rs @@ -43,7 +43,6 @@ use crate::{ FastHashMap, FastHashSet, FastIndexMap, }; -use num_traits::cast::FromPrimitive; use petgraph::graphmap::GraphMap; use std::{convert::TryInto, mem, num::NonZeroU32, path::PathBuf}; @@ -661,7 +660,7 @@ impl> Frontend { if wc == 0 { return Err(Error::InvalidWordCount); } - let op = spirv::Op::from_u16(opcode).ok_or(Error::UnknownInstruction(opcode))?; + let op = spirv::Op::from_u32(opcode as u32).ok_or(Error::UnknownInstruction(opcode))?; Ok(Instruction { op, wc }) } diff --git a/third_party/rust/serde/.cargo-checksum.json b/third_party/rust/serde/.cargo-checksum.json index 4abb3465dc2b4..f3c54ce86f395 100644 --- a/third_party/rust/serde/.cargo-checksum.json +++ b/third_party/rust/serde/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"931117d542e190ad20b9c984a357c900c39fe8d59df2c229b6e3a711622a98c8","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","build.rs":"f9ba30324b9ce085c903595fb55a5293f8c2348ff36bfe870521b935ae6d105c","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/de/format.rs":"c85071b016df643b161859682d21ce34fa0ebf2a3bdbeeea69859da48f5d934f","src/de/ignored_any.rs":"6480f2b2a83dc4764d01b2eec7309729eef2492eede2e5ee98d23a60b05198eb","src/de/impls.rs":"2857d734176a0b78a41c9358354b0b0b83c6b2d948590be072d98606a8cae9d6","src/de/mod.rs":"07cbf58cc8f45d8009558adfed7f7340ea68ad9296bb79d7c4a872ae1a635d09","src/de/seed.rs":"045d890712a04eb33ffc5a021e5d948a63c89402b8ffeea749df2171b7484f8f","src/de/size_hint.rs":"fff83dc39d30e75e8e611991f9c5399188a1aad23a6462dbca2c8b62655cfedb","src/de/value.rs":"5d8dcae3a98a2203f2c0934adb84dbf741f120f246dfc02aa6d0d10673dc39c7","src/integer128.rs":"29ef30b7d94507b34807090e68173767cdc7aff62edccd38affe69e75338dddc","src/lib.rs":"45e8ba8590fc9e78a7bd0bbfac14cdb1eeea5cb16f920997e0efc10e0b55e540","src/macros.rs":"e3486ef4a9a4ed1b27234aa1817ccb25ec0eb026ffc95e2c71c7b917f1f45629","src/private/de.rs":"6557a124fdaf61f9c7cd80163e40f4a453354e45b63a4eb55dafdfe0159f6881","src/private/doc.rs":"9ad740e9ea2eedf861b77116eda9a6fb74bc8553541cd17d1bc5791a3ef3271a","src/private/mod.rs":"b8f0c348621d91dd9da3db83d8877e70bc61ad0a2dc2d6fb57c6fc2c2cbafa26","src/private/ser.rs":"656613691bd8d40cb70a52d4ebe3ee96a993c8a1292d50822d9ca5bdad84426b","src/ser/fmt.rs":"77a5583e5c227ea1982b097ed6378af5c899d43761d71e33440262fd35944695","src/ser/impls.rs":"850619164b399c37cd373d24f5a2c83453f40b34bb978c5722d2c1ae226775b5","src/ser/impossible.rs":"e11b37689ec1395378d546fce74221ca9046d0761744301f12029102fd07e30e","src/ser/mod.rs":"e95dabf07216136440d6a2822cf37775f583d141c21d1b37ec9c55ae2a5024ab","src/std_error.rs":"25a07149e2e468747ffa5a58051c7f93d7b3c0fa0372f012a96c97ec8ab03b97"},"package":"25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"} \ No newline at end of file +{"files":{"Cargo.toml":"1823c76d8cb6a803a6f29bb748445814da9249561e17c21827c5ca061460f5f2","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","build.rs":"f9ba30324b9ce085c903595fb55a5293f8c2348ff36bfe870521b935ae6d105c","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/de/format.rs":"c85071b016df643b161859682d21ce34fa0ebf2a3bdbeeea69859da48f5d934f","src/de/ignored_any.rs":"6480f2b2a83dc4764d01b2eec7309729eef2492eede2e5ee98d23a60b05198eb","src/de/impls.rs":"2857d734176a0b78a41c9358354b0b0b83c6b2d948590be072d98606a8cae9d6","src/de/mod.rs":"7fb7427de1981bfa13af06c898d213a6bc34697148e96cef08d3c447c1999527","src/de/seed.rs":"045d890712a04eb33ffc5a021e5d948a63c89402b8ffeea749df2171b7484f8f","src/de/size_hint.rs":"fff83dc39d30e75e8e611991f9c5399188a1aad23a6462dbca2c8b62655cfedb","src/de/value.rs":"5d8dcae3a98a2203f2c0934adb84dbf741f120f246dfc02aa6d0d10673dc39c7","src/integer128.rs":"29ef30b7d94507b34807090e68173767cdc7aff62edccd38affe69e75338dddc","src/lib.rs":"84c4afda21e66fc28152099bcf182092fe8df409ba510296c66a54987bb4a107","src/macros.rs":"e3486ef4a9a4ed1b27234aa1817ccb25ec0eb026ffc95e2c71c7b917f1f45629","src/private/de.rs":"6557a124fdaf61f9c7cd80163e40f4a453354e45b63a4eb55dafdfe0159f6881","src/private/doc.rs":"9ad740e9ea2eedf861b77116eda9a6fb74bc8553541cd17d1bc5791a3ef3271a","src/private/mod.rs":"b8f0c348621d91dd9da3db83d8877e70bc61ad0a2dc2d6fb57c6fc2c2cbafa26","src/private/ser.rs":"656613691bd8d40cb70a52d4ebe3ee96a993c8a1292d50822d9ca5bdad84426b","src/ser/fmt.rs":"77a5583e5c227ea1982b097ed6378af5c899d43761d71e33440262fd35944695","src/ser/impls.rs":"850619164b399c37cd373d24f5a2c83453f40b34bb978c5722d2c1ae226775b5","src/ser/impossible.rs":"e11b37689ec1395378d546fce74221ca9046d0761744301f12029102fd07e30e","src/ser/mod.rs":"a7fd082203d63cbe4f0fe86d9be16bf4f3b2444653dac6bb61d82e0f4f6b4214","src/std_error.rs":"25a07149e2e468747ffa5a58051c7f93d7b3c0fa0372f012a96c97ec8ab03b97"},"package":"0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773"} \ No newline at end of file diff --git a/third_party/rust/serde/Cargo.toml b/third_party/rust/serde/Cargo.toml index f9f9f1a92a51e..ab4e6c4dd9ddc 100644 --- a/third_party/rust/serde/Cargo.toml +++ b/third_party/rust/serde/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "serde" -version = "1.0.193" +version = "1.0.194" authors = [ "Erick Tryzelaar ", "David Tolnay ", @@ -74,4 +74,4 @@ std = [] unstable = [] [target."cfg(any())".dependencies.serde_derive] -version = "=1.0.193" +version = "=1.0.194" diff --git a/third_party/rust/serde/src/de/mod.rs b/third_party/rust/serde/src/de/mod.rs index c22ed070b2341..c9919d92b88ad 100644 --- a/third_party/rust/serde/src/de/mod.rs +++ b/third_party/rust/serde/src/de/mod.rs @@ -64,8 +64,8 @@ //! - RefCell\ //! - Mutex\ //! - RwLock\ -//! - Rc\ *(if* features = ["rc"] *is enabled)* -//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - Rc\ *(if* features = \["rc"\] *is enabled)* +//! - Arc\ *(if* features = \["rc"\] *is enabled)* //! - **Collection types**: //! - BTreeMap\ //! - BTreeSet\ diff --git a/third_party/rust/serde/src/lib.rs b/third_party/rust/serde/src/lib.rs index b9fbefed42cf8..a8522dd5c1942 100644 --- a/third_party/rust/serde/src/lib.rs +++ b/third_party/rust/serde/src/lib.rs @@ -95,7 +95,7 @@ //////////////////////////////////////////////////////////////////////////////// // Serde types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/serde/1.0.193")] +#![doc(html_root_url = "https://docs.rs/serde/1.0.194")] // Support using Serde without the standard library! #![cfg_attr(not(feature = "std"), no_std)] // Show which crate feature enables conditionally compiled APIs in documentation. @@ -122,7 +122,6 @@ // things are often more readable this way clippy::cast_lossless, clippy::module_name_repetitions, - clippy::option_if_let_else, clippy::single_match_else, clippy::type_complexity, clippy::use_self, diff --git a/third_party/rust/serde/src/ser/mod.rs b/third_party/rust/serde/src/ser/mod.rs index f1820c20a9c0e..75c45140e2273 100644 --- a/third_party/rust/serde/src/ser/mod.rs +++ b/third_party/rust/serde/src/ser/mod.rs @@ -61,8 +61,8 @@ //! - RefCell\ //! - Mutex\ //! - RwLock\ -//! - Rc\ *(if* features = ["rc"] *is enabled)* -//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - Rc\ *(if* features = \["rc"\] *is enabled)* +//! - Arc\ *(if* features = \["rc"\] *is enabled)* //! - **Collection types**: //! - BTreeMap\ //! - BTreeSet\ diff --git a/third_party/rust/serde_derive/.cargo-checksum.json b/third_party/rust/serde_derive/.cargo-checksum.json index fc12fe7671bf2..f9c6545ee0596 100644 --- a/third_party/rust/serde_derive/.cargo-checksum.json +++ b/third_party/rust/serde_derive/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"e1855acc71acc2ca2c973f774d5942b647b954cfcc509832e828e22d7cb96cfa","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/bound.rs":"1b4504ae82ec3dc287eeb4262a57380af484f483c1d6b6c8ebb121370fda135a","src/de.rs":"c221ab2b94a5d80dccff74a37f3448b3d695656552b452595dc289c73b12fb2b","src/dummy.rs":"9533dfee23f20d92ea75734c739022820c2787ded0d54f459feacdeb770ec912","src/fragment.rs":"6757cb4c3131d4300f093572efc273c4ab5a20e3e1efb54a311dcfa52d0bd6eb","src/internals/ast.rs":"7dc997e4090033bbd1d0bdd870e8bb87b096b7f66cfd02047f6b85ebdd569b12","src/internals/attr.rs":"7ec05ffad5b049ba2c91cfb9eedc5d472030682d9c8bcd81040f646525dcc7cd","src/internals/case.rs":"10c8dda2b32d8c6c6b63cf09cdc63d02375af7e95ecefe8fecb34f93b65191bb","src/internals/check.rs":"d842eb9912fd29311060b67f3bc62c438eb7b5d86093355acb4de7eee02a0ef8","src/internals/ctxt.rs":"83a4e6fbe0e439d578478883594407e03f2f340541be479bdf0b04a202633a37","src/internals/mod.rs":"ed021ca635c18132a0e5c3d90f21b7f65def0a61e946421a30200b5b9ab6ad43","src/internals/receiver.rs":"105d72145d1e6a45cdccee3694fcba599ece59194d2e070e8c5669c6f18c81da","src/internals/respan.rs":"899753859c58ce5f532a3ec4584796a52f13ed5a0533191e48c953ba5c1b52ff","src/internals/symbol.rs":"d619e88caa3c7a09b03014257f2b349ee922290062d9b97b4dd19d0e64532690","src/lib.rs":"9b755f1f68c5e18fb7be0ab32dd56dd4be2f919826fe1a9d3830c01a23662e52","src/pretend.rs":"2c79785bc42e975534d7d88c04b46377cefd3db948b63a32234707531c55b099","src/ser.rs":"e3341471cea9d7e2fb4043e5d1746862beb9a4e25196170879eeac529d460920","src/this.rs":"87818dc80cbb521b51938a653d09daf10aafc220bb10425948de82ad670fcb85"},"package":"43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"} \ No newline at end of file +{"files":{"Cargo.toml":"6edb5218a4acfe9c7a8934931364e42e79afa74cb3c526bb88cbe954dfafe508","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/bound.rs":"1b4504ae82ec3dc287eeb4262a57380af484f483c1d6b6c8ebb121370fda135a","src/de.rs":"c221ab2b94a5d80dccff74a37f3448b3d695656552b452595dc289c73b12fb2b","src/dummy.rs":"9533dfee23f20d92ea75734c739022820c2787ded0d54f459feacdeb770ec912","src/fragment.rs":"6757cb4c3131d4300f093572efc273c4ab5a20e3e1efb54a311dcfa52d0bd6eb","src/internals/ast.rs":"7dc997e4090033bbd1d0bdd870e8bb87b096b7f66cfd02047f6b85ebdd569b12","src/internals/attr.rs":"7ec05ffad5b049ba2c91cfb9eedc5d472030682d9c8bcd81040f646525dcc7cd","src/internals/case.rs":"10c8dda2b32d8c6c6b63cf09cdc63d02375af7e95ecefe8fecb34f93b65191bb","src/internals/check.rs":"d842eb9912fd29311060b67f3bc62c438eb7b5d86093355acb4de7eee02a0ef8","src/internals/ctxt.rs":"83a4e6fbe0e439d578478883594407e03f2f340541be479bdf0b04a202633a37","src/internals/mod.rs":"ed021ca635c18132a0e5c3d90f21b7f65def0a61e946421a30200b5b9ab6ad43","src/internals/receiver.rs":"105d72145d1e6a45cdccee3694fcba599ece59194d2e070e8c5669c6f18c81da","src/internals/respan.rs":"899753859c58ce5f532a3ec4584796a52f13ed5a0533191e48c953ba5c1b52ff","src/internals/symbol.rs":"d619e88caa3c7a09b03014257f2b349ee922290062d9b97b4dd19d0e64532690","src/lib.rs":"5007fb78556e468731d63f2e5973714a8c11bfa74ec593e6309913737f7e1861","src/pretend.rs":"2c79785bc42e975534d7d88c04b46377cefd3db948b63a32234707531c55b099","src/ser.rs":"e3341471cea9d7e2fb4043e5d1746862beb9a4e25196170879eeac529d460920","src/this.rs":"87818dc80cbb521b51938a653d09daf10aafc220bb10425948de82ad670fcb85"},"package":"a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0"} \ No newline at end of file diff --git a/third_party/rust/serde_derive/Cargo.toml b/third_party/rust/serde_derive/Cargo.toml index eda2a43d43014..1fd545dea227f 100644 --- a/third_party/rust/serde_derive/Cargo.toml +++ b/third_party/rust/serde_derive/Cargo.toml @@ -12,7 +12,7 @@ [package] rust-version = "1.56" name = "serde_derive" -version = "1.0.193" +version = "1.0.194" authors = [ "Erick Tryzelaar ", "David Tolnay ", @@ -43,13 +43,13 @@ name = "serde_derive" proc-macro = true [dependencies.proc-macro2] -version = "1.0" +version = "1.0.74" [dependencies.quote] -version = "1.0" +version = "1.0.35" [dependencies.syn] -version = "2.0.28" +version = "2.0.46" [dev-dependencies.serde] version = "1" diff --git a/third_party/rust/serde_derive/src/lib.rs b/third_party/rust/serde_derive/src/lib.rs index dba48d4eba52c..200ce84758e64 100644 --- a/third_party/rust/serde_derive/src/lib.rs +++ b/third_party/rust/serde_derive/src/lib.rs @@ -13,7 +13,7 @@ //! //! [https://serde.rs/derive.html]: https://serde.rs/derive.html -#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.193")] +#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.194")] // Ignored clippy lints #![allow( // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054 @@ -50,7 +50,6 @@ clippy::match_wildcard_for_single_variants, clippy::module_name_repetitions, clippy::must_use_candidate, - clippy::option_if_let_else, clippy::similar_names, clippy::single_match_else, clippy::struct_excessive_bools, diff --git a/third_party/rust/spirv/.cargo-checksum.json b/third_party/rust/spirv/.cargo-checksum.json index ea0335b0d1378..961c519b5dfa5 100644 --- a/third_party/rust/spirv/.cargo-checksum.json +++ b/third_party/rust/spirv/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"965504451cd792223d66d76e77778f823e5274acf1a06371815c6fcdc39cb602","README.md":"b2fb89fc821eb3ecb38a229ed3dfed36a2f30ba9338b3695ee6ce96eab438d60","autogen_spirv.rs":"6408f8408001fd1012e2731a737cb08f032114b390c3cf10d813ab89a7c84c03","lib.rs":"334f71db6c449cbea3c6f7485abf9c8b91be968e532758ead3a7a834f1284440","release.toml":"acbbc8f28fd56745b98909e9f0928d97cdadeab242652a8596e716fe6d405b5e"},"package":"246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"} \ No newline at end of file +{"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 diff --git a/third_party/rust/spirv/Cargo.toml b/third_party/rust/spirv/Cargo.toml index 5c7192dc425f4..92f2cb7ebc8a8 100644 --- a/third_party/rust/spirv/Cargo.toml +++ b/third_party/rust/spirv/Cargo.toml @@ -3,33 +3,34 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" authors = ["Lei Zhang "] description = "Rust definition of SPIR-V structs and enums" documentation = "https://docs.rs/spirv" readme = "README.md" -keywords = ["spirv", "definition", "struct", "enum"] +keywords = [ + "spirv", + "definition", + "struct", + "enum", +] license = "Apache-2.0" repository = "https://github.com/gfx-rs/rspirv" [lib] path = "lib.rs" -[dependencies.bitflags] -version = "1" -[dependencies.num-traits] -version = "0.2" -default-features = false +[dependencies.bitflags] +version = "2.0" [dependencies.serde] version = "1" @@ -37,5 +38,11 @@ features = ["derive"] optional = true [features] -deserialize = ["serde"] -serialize = ["serde"] +deserialize = [ + "serde", + "bitflags/serde", +] +serialize = [ + "serde", + "bitflags/serde", +] diff --git a/third_party/rust/spirv/README.md b/third_party/rust/spirv/README.md index 540854da95b92..7f57598e33e6d 100644 --- a/third_party/rust/spirv/README.md +++ b/third_party/rust/spirv/README.md @@ -18,7 +18,7 @@ First add to your `Cargo.toml`: ```toml [dependencies] -spirv = "0.2.0+1.5.4" +spirv = "0.3.0" ``` Version diff --git a/third_party/rust/spirv/autogen_spirv.rs b/third_party/rust/spirv/autogen_spirv.rs index e3256485d2305..b0d4c7b47aafc 100644 --- a/third_party/rust/spirv/autogen_spirv.rs +++ b/third_party/rust/spirv/autogen_spirv.rs @@ -5,19 +5,19 @@ pub type Word = u32; pub const MAGIC_NUMBER: u32 = 0x07230203; pub const MAJOR_VERSION: u8 = 1u8; -pub const MINOR_VERSION: u8 = 5u8; -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)"] # [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 ; } } -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)"] # [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 ; } } -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)"] # [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)"] # [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 ; } } -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)"] # [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 ; } } -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)"] # [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)"] # [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 ; } } -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)"] # [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)"] # [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 ; } } -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)"] # [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 ; } } -#[doc = "/// SPIR-V operand kind: [SourceLanguage](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_source_language_a_source_language)"] +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 ; } } +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: [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 ; } } +#[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)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -30,26 +30,23 @@ pub enum SourceLanguage { OpenCL_C = 3u32, OpenCL_CPP = 4u32, HLSL = 5u32, -} -#[allow(non_upper_case_globals)] -impl SourceLanguage {} -impl num_traits::FromPrimitive for SourceLanguage { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Unknown, - 1u32 => Self::ESSL, - 2u32 => Self::GLSL, - 3u32 => Self::OpenCL_C, - 4u32 => Self::OpenCL_CPP, - 5u32 => Self::HLSL, + CPP_for_OpenCL = 6u32, + SYCL = 7u32, + HERO_C = 8u32, + NZSL = 9u32, + WGSL = 10u32, + Slang = 11u32, +} +impl SourceLanguage { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=11u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl SourceLanguage {} impl core::str::FromStr for SourceLanguage { type Err = (); fn from_str(s: &str) -> Result { @@ -60,11 +57,17 @@ impl core::str::FromStr for SourceLanguage { "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(()), } } } -#[doc = "/// SPIR-V operand kind: [ExecutionModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_model_a_execution_model)"] +#[doc = "SPIR-V operand kind: [ExecutionModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_model_a_execution_model)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -86,6 +89,19 @@ pub enum ExecutionModel { ClosestHitNV = 5316u32, MissNV = 5317u32, CallableNV = 5318u32, + TaskEXT = 5364u32, + MeshEXT = 5365u32, +} +impl ExecutionModel { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 5267u32..=5268u32 => unsafe { core::mem::transmute::(n) }, + 5313u32..=5318u32 => unsafe { core::mem::transmute::(n) }, + 5364u32..=5365u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } } #[allow(non_upper_case_globals)] impl ExecutionModel { @@ -96,32 +112,6 @@ impl ExecutionModel { pub const MissKHR: Self = Self::MissNV; pub const CallableKHR: Self = Self::CallableNV; } -impl num_traits::FromPrimitive for ExecutionModel { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Vertex, - 1u32 => Self::TessellationControl, - 2u32 => Self::TessellationEvaluation, - 3u32 => Self::Geometry, - 4u32 => Self::Fragment, - 5u32 => Self::GLCompute, - 6u32 => Self::Kernel, - 5267u32 => Self::TaskNV, - 5268u32 => Self::MeshNV, - 5313u32 => Self::RayGenerationNV, - 5314u32 => Self::IntersectionNV, - 5315u32 => Self::AnyHitNV, - 5316u32 => Self::ClosestHitNV, - 5317u32 => Self::MissNV, - 5318u32 => Self::CallableNV, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } -} impl core::str::FromStr for ExecutionModel { type Err = (); fn from_str(s: &str) -> Result { @@ -147,11 +137,13 @@ impl core::str::FromStr for ExecutionModel { "MissKHR" => Ok(Self::MissNV), "CallableNV" => Ok(Self::CallableNV), "CallableKHR" => Ok(Self::CallableNV), + "TaskEXT" => Ok(Self::TaskEXT), + "MeshEXT" => Ok(Self::MeshEXT), _ => 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)"] +#[doc = "SPIR-V operand kind: [AddressingModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_addressing_model_a_addressing_model)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -163,24 +155,18 @@ pub enum AddressingModel { Physical64 = 2u32, PhysicalStorageBuffer64 = 5348u32, } -#[allow(non_upper_case_globals)] impl AddressingModel { - pub const PhysicalStorageBuffer64EXT: Self = Self::PhysicalStorageBuffer64; -} -impl num_traits::FromPrimitive for AddressingModel { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Logical, - 1u32 => Self::Physical32, - 2u32 => Self::Physical64, - 5348u32 => Self::PhysicalStorageBuffer64, + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 5348u32 => unsafe { core::mem::transmute::(5348u32) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } +} +#[allow(non_upper_case_globals)] +impl AddressingModel { + pub const PhysicalStorageBuffer64EXT: Self = Self::PhysicalStorageBuffer64; } impl core::str::FromStr for AddressingModel { type Err = (); @@ -195,7 +181,7 @@ impl core::str::FromStr for AddressingModel { } } } -#[doc = "/// SPIR-V operand kind: [MemoryModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_model_a_memory_model)"] +#[doc = "SPIR-V operand kind: [MemoryModel](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_model_a_memory_model)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -207,24 +193,17 @@ pub enum MemoryModel { OpenCL = 2u32, Vulkan = 3u32, } -#[allow(non_upper_case_globals)] impl MemoryModel { - pub const VulkanKHR: Self = Self::Vulkan; -} -impl num_traits::FromPrimitive for MemoryModel { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Simple, - 1u32 => Self::GLSL450, - 2u32 => Self::OpenCL, - 3u32 => Self::Vulkan, + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } +} +#[allow(non_upper_case_globals)] +impl MemoryModel { + pub const VulkanKHR: Self = Self::Vulkan; } impl core::str::FromStr for MemoryModel { type Err = (); @@ -239,7 +218,7 @@ impl core::str::FromStr for MemoryModel { } } } -#[doc = "/// SPIR-V operand kind: [ExecutionMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_mode_a_execution_mode)"] +#[doc = "SPIR-V operand kind: [ExecutionMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_execution_mode_a_execution_mode)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -284,13 +263,29 @@ pub enum ExecutionMode { SubgroupsPerWorkgroupId = 37u32, LocalSizeId = 38u32, LocalSizeHintId = 39u32, + NonCoherentColorAttachmentReadEXT = 4169u32, + NonCoherentDepthAttachmentReadEXT = 4170u32, + NonCoherentStencilAttachmentReadEXT = 4171u32, + SubgroupUniformControlFlowKHR = 4421u32, PostDepthCoverage = 4446u32, DenormPreserve = 4459u32, DenormFlushToZero = 4460u32, SignedZeroInfNanPreserve = 4461u32, RoundingModeRTE = 4462u32, RoundingModeRTZ = 4463u32, + EarlyAndLateFragmentTestsAMD = 5017u32, StencilRefReplacingEXT = 5027u32, + CoalescingAMDX = 5069u32, + MaxNodeRecursionAMDX = 5071u32, + StaticNumWorkgroupsAMDX = 5072u32, + ShaderIndexAMDX = 5073u32, + MaxNumWorkgroupsAMDX = 5077u32, + StencilRefUnchangedFrontAMD = 5079u32, + StencilRefGreaterFrontAMD = 5080u32, + StencilRefLessFrontAMD = 5081u32, + StencilRefUnchangedBackAMD = 5082u32, + StencilRefGreaterBackAMD = 5083u32, + StencilRefLessBackAMD = 5084u32, OutputLinesNV = 5269u32, OutputPrimitivesNV = 5270u32, DerivativeGroupQuadsNV = 5289u32, @@ -302,83 +297,56 @@ pub enum ExecutionMode { SampleInterlockUnorderedEXT = 5369u32, ShadingRateInterlockOrderedEXT = 5370u32, ShadingRateInterlockUnorderedEXT = 5371u32, + SharedLocalMemorySizeINTEL = 5618u32, + RoundingModeRTPINTEL = 5620u32, + RoundingModeRTNINTEL = 5621u32, + FloatingPointModeALTINTEL = 5622u32, + FloatingPointModeIEEEINTEL = 5623u32, MaxWorkgroupSizeINTEL = 5893u32, MaxWorkDimINTEL = 5894u32, NoGlobalOffsetINTEL = 5895u32, NumSIMDWorkitemsINTEL = 5896u32, -} -#[allow(non_upper_case_globals)] -impl ExecutionMode {} -impl num_traits::FromPrimitive for ExecutionMode { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Invocations, - 1u32 => Self::SpacingEqual, - 2u32 => Self::SpacingFractionalEven, - 3u32 => Self::SpacingFractionalOdd, - 4u32 => Self::VertexOrderCw, - 5u32 => Self::VertexOrderCcw, - 6u32 => Self::PixelCenterInteger, - 7u32 => Self::OriginUpperLeft, - 8u32 => Self::OriginLowerLeft, - 9u32 => Self::EarlyFragmentTests, - 10u32 => Self::PointMode, - 11u32 => Self::Xfb, - 12u32 => Self::DepthReplacing, - 14u32 => Self::DepthGreater, - 15u32 => Self::DepthLess, - 16u32 => Self::DepthUnchanged, - 17u32 => Self::LocalSize, - 18u32 => Self::LocalSizeHint, - 19u32 => Self::InputPoints, - 20u32 => Self::InputLines, - 21u32 => Self::InputLinesAdjacency, - 22u32 => Self::Triangles, - 23u32 => Self::InputTrianglesAdjacency, - 24u32 => Self::Quads, - 25u32 => Self::Isolines, - 26u32 => Self::OutputVertices, - 27u32 => Self::OutputPoints, - 28u32 => Self::OutputLineStrip, - 29u32 => Self::OutputTriangleStrip, - 30u32 => Self::VecTypeHint, - 31u32 => Self::ContractionOff, - 33u32 => Self::Initializer, - 34u32 => Self::Finalizer, - 35u32 => Self::SubgroupSize, - 36u32 => Self::SubgroupsPerWorkgroup, - 37u32 => Self::SubgroupsPerWorkgroupId, - 38u32 => Self::LocalSizeId, - 39u32 => Self::LocalSizeHintId, - 4446u32 => Self::PostDepthCoverage, - 4459u32 => Self::DenormPreserve, - 4460u32 => Self::DenormFlushToZero, - 4461u32 => Self::SignedZeroInfNanPreserve, - 4462u32 => Self::RoundingModeRTE, - 4463u32 => Self::RoundingModeRTZ, - 5027u32 => Self::StencilRefReplacingEXT, - 5269u32 => Self::OutputLinesNV, - 5270u32 => Self::OutputPrimitivesNV, - 5289u32 => Self::DerivativeGroupQuadsNV, - 5290u32 => Self::DerivativeGroupLinearNV, - 5298u32 => Self::OutputTrianglesNV, - 5366u32 => Self::PixelInterlockOrderedEXT, - 5367u32 => Self::PixelInterlockUnorderedEXT, - 5368u32 => Self::SampleInterlockOrderedEXT, - 5369u32 => Self::SampleInterlockUnorderedEXT, - 5370u32 => Self::ShadingRateInterlockOrderedEXT, - 5371u32 => Self::ShadingRateInterlockUnorderedEXT, - 5893u32 => Self::MaxWorkgroupSizeINTEL, - 5894u32 => Self::MaxWorkDimINTEL, - 5895u32 => Self::NoGlobalOffsetINTEL, - 5896u32 => Self::NumSIMDWorkitemsINTEL, + SchedulerTargetFmaxMhzINTEL = 5903u32, + StreamingInterfaceINTEL = 6154u32, + RegisterMapInterfaceINTEL = 6160u32, + NamedBarrierCountINTEL = 6417u32, +} +impl ExecutionMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 14u32..=31u32 => unsafe { core::mem::transmute::(n) }, + 33u32..=39u32 => unsafe { core::mem::transmute::(n) }, + 4169u32..=4171u32 => unsafe { core::mem::transmute::(n) }, + 4421u32 => unsafe { core::mem::transmute::(4421u32) }, + 4446u32 => unsafe { core::mem::transmute::(4446u32) }, + 4459u32..=4463u32 => unsafe { core::mem::transmute::(n) }, + 5017u32 => unsafe { core::mem::transmute::(5017u32) }, + 5027u32 => unsafe { core::mem::transmute::(5027u32) }, + 5069u32 => unsafe { core::mem::transmute::(5069u32) }, + 5071u32..=5073u32 => unsafe { core::mem::transmute::(n) }, + 5077u32 => unsafe { core::mem::transmute::(5077u32) }, + 5079u32..=5084u32 => unsafe { core::mem::transmute::(n) }, + 5269u32..=5270u32 => unsafe { core::mem::transmute::(n) }, + 5289u32..=5290u32 => unsafe { core::mem::transmute::(n) }, + 5298u32 => unsafe { core::mem::transmute::(5298u32) }, + 5366u32..=5371u32 => unsafe { core::mem::transmute::(n) }, + 5618u32 => unsafe { core::mem::transmute::(5618u32) }, + 5620u32..=5623u32 => unsafe { core::mem::transmute::(n) }, + 5893u32..=5896u32 => unsafe { core::mem::transmute::(n) }, + 5903u32 => unsafe { core::mem::transmute::(5903u32) }, + 6154u32 => unsafe { core::mem::transmute::(6154u32) }, + 6160u32 => unsafe { core::mem::transmute::(6160u32) }, + 6417u32 => unsafe { core::mem::transmute::(6417u32) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } +} +#[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; } impl core::str::FromStr for ExecutionMode { type Err = (); @@ -422,33 +390,61 @@ impl core::str::FromStr for ExecutionMode { "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(()), } } } -#[doc = "/// SPIR-V operand kind: [StorageClass](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_storage_class_a_storage_class)"] +#[doc = "SPIR-V operand kind: [StorageClass](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_storage_class_a_storage_class)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -468,6 +464,9 @@ pub enum StorageClass { AtomicCounter = 10u32, Image = 11u32, StorageBuffer = 12u32, + TileImageEXT = 4172u32, + NodePayloadAMDX = 5068u32, + NodeOutputPayloadAMDX = 5076u32, CallableDataNV = 5328u32, IncomingCallableDataNV = 5329u32, RayPayloadNV = 5338u32, @@ -475,7 +474,30 @@ pub enum StorageClass { IncomingRayPayloadNV = 5342u32, ShaderRecordBufferNV = 5343u32, PhysicalStorageBuffer = 5349u32, + HitObjectAttributeNV = 5385u32, + TaskPayloadWorkgroupEXT = 5402u32, CodeSectionINTEL = 5605u32, + DeviceOnlyINTEL = 5936u32, + HostOnlyINTEL = 5937u32, +} +impl StorageClass { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 4172u32 => unsafe { core::mem::transmute::(4172u32) }, + 5068u32 => unsafe { core::mem::transmute::(5068u32) }, + 5076u32 => unsafe { core::mem::transmute::(5076u32) }, + 5328u32..=5329u32 => unsafe { core::mem::transmute::(n) }, + 5338u32..=5339u32 => unsafe { core::mem::transmute::(n) }, + 5342u32..=5343u32 => unsafe { core::mem::transmute::(n) }, + 5349u32 => unsafe { core::mem::transmute::(5349u32) }, + 5385u32 => unsafe { core::mem::transmute::(5385u32) }, + 5402u32 => unsafe { core::mem::transmute::(5402u32) }, + 5605u32 => unsafe { core::mem::transmute::(5605u32) }, + 5936u32..=5937u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } } #[allow(non_upper_case_globals)] impl StorageClass { @@ -487,38 +509,6 @@ impl StorageClass { pub const ShaderRecordBufferKHR: Self = Self::ShaderRecordBufferNV; pub const PhysicalStorageBufferEXT: Self = Self::PhysicalStorageBuffer; } -impl num_traits::FromPrimitive for StorageClass { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::UniformConstant, - 1u32 => Self::Input, - 2u32 => Self::Uniform, - 3u32 => Self::Output, - 4u32 => Self::Workgroup, - 5u32 => Self::CrossWorkgroup, - 6u32 => Self::Private, - 7u32 => Self::Function, - 8u32 => Self::Generic, - 9u32 => Self::PushConstant, - 10u32 => Self::AtomicCounter, - 11u32 => Self::Image, - 12u32 => Self::StorageBuffer, - 5328u32 => Self::CallableDataNV, - 5329u32 => Self::IncomingCallableDataNV, - 5338u32 => Self::RayPayloadNV, - 5339u32 => Self::HitAttributeNV, - 5342u32 => Self::IncomingRayPayloadNV, - 5343u32 => Self::ShaderRecordBufferNV, - 5349u32 => Self::PhysicalStorageBuffer, - 5605u32 => Self::CodeSectionINTEL, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } -} impl core::str::FromStr for StorageClass { type Err = (); fn from_str(s: &str) -> Result { @@ -536,6 +526,9 @@ impl core::str::FromStr for StorageClass { "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), @@ -550,12 +543,16 @@ impl core::str::FromStr for StorageClass { "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(()), } } } -#[doc = "/// SPIR-V operand kind: [Dim](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_dim_a_dim)"] +#[doc = "SPIR-V operand kind: [Dim](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_dim_a_dim)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -569,27 +566,19 @@ pub enum Dim { DimRect = 4u32, DimBuffer = 5u32, DimSubpassData = 6u32, + DimTileImageDataEXT = 4173u32, } -#[allow(non_upper_case_globals)] -impl Dim {} -impl num_traits::FromPrimitive for Dim { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Dim1D, - 1u32 => Self::Dim2D, - 2u32 => Self::Dim3D, - 3u32 => Self::DimCube, - 4u32 => Self::DimRect, - 5u32 => Self::DimBuffer, - 6u32 => Self::DimSubpassData, +impl Dim { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 4173u32 => unsafe { core::mem::transmute::(4173u32) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl Dim {} impl core::str::FromStr for Dim { type Err = (); fn from_str(s: &str) -> Result { @@ -601,11 +590,12 @@ impl core::str::FromStr for Dim { "DimRect" => Ok(Self::DimRect), "DimBuffer" => Ok(Self::DimBuffer), "DimSubpassData" => Ok(Self::DimSubpassData), + "DimTileImageDataEXT" => Ok(Self::DimTileImageDataEXT), _ => 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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -618,24 +608,16 @@ pub enum SamplerAddressingMode { Repeat = 3u32, RepeatMirrored = 4u32, } -#[allow(non_upper_case_globals)] -impl SamplerAddressingMode {} -impl num_traits::FromPrimitive for SamplerAddressingMode { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::None, - 1u32 => Self::ClampToEdge, - 2u32 => Self::Clamp, - 3u32 => Self::Repeat, - 4u32 => Self::RepeatMirrored, +impl SamplerAddressingMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=4u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl SamplerAddressingMode {} impl core::str::FromStr for SamplerAddressingMode { type Err = (); fn from_str(s: &str) -> Result { @@ -649,7 +631,7 @@ impl core::str::FromStr for SamplerAddressingMode { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -659,21 +641,16 @@ pub enum SamplerFilterMode { Nearest = 0u32, Linear = 1u32, } -#[allow(non_upper_case_globals)] -impl SamplerFilterMode {} -impl num_traits::FromPrimitive for SamplerFilterMode { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Nearest, - 1u32 => Self::Linear, +impl SamplerFilterMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl SamplerFilterMode {} impl core::str::FromStr for SamplerFilterMode { type Err = (); fn from_str(s: &str) -> Result { @@ -684,7 +661,7 @@ impl core::str::FromStr for SamplerFilterMode { } } } -#[doc = "/// SPIR-V operand kind: [ImageFormat](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_format_a_image_format)"] +#[doc = "SPIR-V operand kind: [ImageFormat](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_format_a_image_format)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -734,61 +711,16 @@ pub enum ImageFormat { R64ui = 40u32, R64i = 41u32, } -#[allow(non_upper_case_globals)] -impl ImageFormat {} -impl num_traits::FromPrimitive for ImageFormat { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Unknown, - 1u32 => Self::Rgba32f, - 2u32 => Self::Rgba16f, - 3u32 => Self::R32f, - 4u32 => Self::Rgba8, - 5u32 => Self::Rgba8Snorm, - 6u32 => Self::Rg32f, - 7u32 => Self::Rg16f, - 8u32 => Self::R11fG11fB10f, - 9u32 => Self::R16f, - 10u32 => Self::Rgba16, - 11u32 => Self::Rgb10A2, - 12u32 => Self::Rg16, - 13u32 => Self::Rg8, - 14u32 => Self::R16, - 15u32 => Self::R8, - 16u32 => Self::Rgba16Snorm, - 17u32 => Self::Rg16Snorm, - 18u32 => Self::Rg8Snorm, - 19u32 => Self::R16Snorm, - 20u32 => Self::R8Snorm, - 21u32 => Self::Rgba32i, - 22u32 => Self::Rgba16i, - 23u32 => Self::Rgba8i, - 24u32 => Self::R32i, - 25u32 => Self::Rg32i, - 26u32 => Self::Rg16i, - 27u32 => Self::Rg8i, - 28u32 => Self::R16i, - 29u32 => Self::R8i, - 30u32 => Self::Rgba32ui, - 31u32 => Self::Rgba16ui, - 32u32 => Self::Rgba8ui, - 33u32 => Self::R32ui, - 34u32 => Self::Rgb10a2ui, - 35u32 => Self::Rg32ui, - 36u32 => Self::Rg16ui, - 37u32 => Self::Rg8ui, - 38u32 => Self::R16ui, - 39u32 => Self::R8ui, - 40u32 => Self::R64ui, - 41u32 => Self::R64i, +impl ImageFormat { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=41u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl ImageFormat {} impl core::str::FromStr for ImageFormat { type Err = (); fn from_str(s: &str) -> Result { @@ -839,7 +771,7 @@ impl core::str::FromStr for ImageFormat { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -867,39 +799,16 @@ pub enum ImageChannelOrder { sBGRA = 18u32, ABGR = 19u32, } -#[allow(non_upper_case_globals)] -impl ImageChannelOrder {} -impl num_traits::FromPrimitive for ImageChannelOrder { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::R, - 1u32 => Self::A, - 2u32 => Self::RG, - 3u32 => Self::RA, - 4u32 => Self::RGB, - 5u32 => Self::RGBA, - 6u32 => Self::BGRA, - 7u32 => Self::ARGB, - 8u32 => Self::Intensity, - 9u32 => Self::Luminance, - 10u32 => Self::Rx, - 11u32 => Self::RGx, - 12u32 => Self::RGBx, - 13u32 => Self::Depth, - 14u32 => Self::DepthStencil, - 15u32 => Self::sRGB, - 16u32 => Self::sRGBx, - 17u32 => Self::sRGBA, - 18u32 => Self::sBGRA, - 19u32 => Self::ABGR, +impl ImageChannelOrder { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=19u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl ImageChannelOrder {} impl core::str::FromStr for ImageChannelOrder { type Err = (); fn from_str(s: &str) -> Result { @@ -928,7 +837,7 @@ impl core::str::FromStr for ImageChannelOrder { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -952,37 +861,20 @@ pub enum ImageChannelDataType { Float = 14u32, UnormInt24 = 15u32, UnormInt101010_2 = 16u32, -} -#[allow(non_upper_case_globals)] -impl ImageChannelDataType {} -impl num_traits::FromPrimitive for ImageChannelDataType { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::SnormInt8, - 1u32 => Self::SnormInt16, - 2u32 => Self::UnormInt8, - 3u32 => Self::UnormInt16, - 4u32 => Self::UnormShort565, - 5u32 => Self::UnormShort555, - 6u32 => Self::UnormInt101010, - 7u32 => Self::SignedInt8, - 8u32 => Self::SignedInt16, - 9u32 => Self::SignedInt32, - 10u32 => Self::UnsignedInt8, - 11u32 => Self::UnsignedInt16, - 12u32 => Self::UnsignedInt32, - 13u32 => Self::HalfFloat, - 14u32 => Self::Float, - 15u32 => Self::UnormInt24, - 16u32 => Self::UnormInt101010_2, + UnsignedIntRaw10EXT = 19u32, + UnsignedIntRaw12EXT = 20u32, +} +impl ImageChannelDataType { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=16u32 => unsafe { core::mem::transmute::(n) }, + 19u32..=20u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl ImageChannelDataType {} impl core::str::FromStr for ImageChannelDataType { type Err = (); fn from_str(s: &str) -> Result { @@ -1004,11 +896,13 @@ impl core::str::FromStr for ImageChannelDataType { "Float" => Ok(Self::Float), "UnormInt24" => Ok(Self::UnormInt24), "UnormInt101010_2" => Ok(Self::UnormInt101010_2), + "UnsignedIntRaw10EXT" => Ok(Self::UnsignedIntRaw10EXT), + "UnsignedIntRaw12EXT" => Ok(Self::UnsignedIntRaw12EXT), _ => 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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1020,23 +914,16 @@ pub enum FPRoundingMode { RTP = 2u32, RTN = 3u32, } -#[allow(non_upper_case_globals)] -impl FPRoundingMode {} -impl num_traits::FromPrimitive for FPRoundingMode { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::RTE, - 1u32 => Self::RTZ, - 2u32 => Self::RTP, - 3u32 => Self::RTN, +impl FPRoundingMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl FPRoundingMode {} impl core::str::FromStr for FPRoundingMode { type Err = (); fn from_str(s: &str) -> Result { @@ -1049,7 +936,143 @@ impl core::str::FromStr for FPRoundingMode { } } } -#[doc = "/// SPIR-V operand kind: [LinkageType](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_linkage_type_a_linkage_type)"] +#[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)"] +#[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 FPDenormMode { + Preserve = 0u32, + FlushToZero = 1u32, +} +impl FPDenormMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl FPDenormMode {} +impl core::str::FromStr for FPDenormMode { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "Preserve" => Ok(Self::Preserve), + "FlushToZero" => Ok(Self::FlushToZero), + _ => 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)"] +#[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 QuantizationModes { + TRN = 0u32, + TRN_ZERO = 1u32, + RND = 2u32, + RND_ZERO = 3u32, + RND_INF = 4u32, + RND_MIN_INF = 5u32, + RND_CONV = 6u32, + RND_CONV_ODD = 7u32, +} +impl QuantizationModes { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=7u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl QuantizationModes {} +impl core::str::FromStr for QuantizationModes { + type Err = (); + fn from_str(s: &str) -> Result { + 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(()), + } + } +} +#[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)"] +#[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 FPOperationMode { + IEEE = 0u32, + ALT = 1u32, +} +impl FPOperationMode { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl FPOperationMode {} +impl core::str::FromStr for FPOperationMode { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "IEEE" => Ok(Self::IEEE), + "ALT" => Ok(Self::ALT), + _ => 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)"] +#[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 OverflowModes { + WRAP = 0u32, + SAT = 1u32, + SAT_ZERO = 2u32, + SAT_SYM = 3u32, +} +impl OverflowModes { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl OverflowModes {} +impl core::str::FromStr for OverflowModes { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "WRAP" => Ok(Self::WRAP), + "SAT" => Ok(Self::SAT), + "SAT_ZERO" => Ok(Self::SAT_ZERO), + "SAT_SYM" => Ok(Self::SAT_SYM), + _ => 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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1058,33 +1081,30 @@ impl core::str::FromStr for FPRoundingMode { pub enum LinkageType { Export = 0u32, Import = 1u32, + LinkOnceODR = 2u32, } -#[allow(non_upper_case_globals)] -impl LinkageType {} -impl num_traits::FromPrimitive for LinkageType { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Export, - 1u32 => Self::Import, +impl LinkageType { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl LinkageType {} impl core::str::FromStr for LinkageType { type Err = (); fn from_str(s: &str) -> Result { match s { "Export" => Ok(Self::Export), "Import" => Ok(Self::Import), + "LinkOnceODR" => Ok(Self::LinkOnceODR), _ => 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)"] +#[doc = "SPIR-V operand kind: [AccessQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_access_qualifier_a_access_qualifier)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1095,22 +1115,16 @@ pub enum AccessQualifier { WriteOnly = 1u32, ReadWrite = 2u32, } -#[allow(non_upper_case_globals)] -impl AccessQualifier {} -impl num_traits::FromPrimitive for AccessQualifier { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::ReadOnly, - 1u32 => Self::WriteOnly, - 2u32 => Self::ReadWrite, +impl AccessQualifier { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl AccessQualifier {} impl core::str::FromStr for AccessQualifier { type Err = (); fn from_str(s: &str) -> Result { @@ -1122,7 +1136,41 @@ impl core::str::FromStr for AccessQualifier { } } } -#[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)"] +#[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)"] +#[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 HostAccessQualifier { + NoneINTEL = 0u32, + ReadINTEL = 1u32, + WriteINTEL = 2u32, + ReadWriteINTEL = 3u32, +} +impl HostAccessQualifier { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl HostAccessQualifier {} +impl core::str::FromStr for HostAccessQualifier { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "NoneINTEL" => Ok(Self::NoneINTEL), + "ReadINTEL" => Ok(Self::ReadINTEL), + "WriteINTEL" => Ok(Self::WriteINTEL), + "ReadWriteINTEL" => Ok(Self::ReadWriteINTEL), + _ => 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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1137,28 +1185,19 @@ pub enum FunctionParameterAttribute { NoCapture = 5u32, NoWrite = 6u32, NoReadWrite = 7u32, + RuntimeAlignedINTEL = 5940u32, } -#[allow(non_upper_case_globals)] -impl FunctionParameterAttribute {} -impl num_traits::FromPrimitive for FunctionParameterAttribute { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Zext, - 1u32 => Self::Sext, - 2u32 => Self::ByVal, - 3u32 => Self::Sret, - 4u32 => Self::NoAlias, - 5u32 => Self::NoCapture, - 6u32 => Self::NoWrite, - 7u32 => Self::NoReadWrite, +impl FunctionParameterAttribute { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=7u32 => unsafe { core::mem::transmute::(n) }, + 5940u32 => unsafe { core::mem::transmute::(5940u32) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl FunctionParameterAttribute {} impl core::str::FromStr for FunctionParameterAttribute { type Err = (); fn from_str(s: &str) -> Result { @@ -1171,11 +1210,12 @@ impl core::str::FromStr for FunctionParameterAttribute { "NoCapture" => Ok(Self::NoCapture), "NoWrite" => Ok(Self::NoWrite), "NoReadWrite" => Ok(Self::NoReadWrite), + "RuntimeAlignedINTEL" => Ok(Self::RuntimeAlignedINTEL), _ => Err(()), } } } -#[doc = "/// SPIR-V operand kind: [Decoration](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_decoration_a_decoration)"] +#[doc = "SPIR-V operand kind: [Decoration](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_decoration_a_decoration)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1231,7 +1271,13 @@ pub enum Decoration { MaxByteOffsetId = 47u32, NoSignedWrap = 4469u32, NoUnsignedWrap = 4470u32, + WeightTextureQCOM = 4487u32, + BlockMatchTextureQCOM = 4488u32, ExplicitInterpAMD = 4999u32, + NodeSharesPayloadLimitsWithAMDX = 5019u32, + NodeMaxPayloadsAMDX = 5020u32, + TrackFinishWritingAMDX = 5078u32, + PayloadNodeNameAMDX = 5091u32, OverrideCoverageNV = 5248u32, PassthroughNV = 5250u32, ViewportRelativeNV = 5252u32, @@ -1239,14 +1285,29 @@ pub enum Decoration { PerPrimitiveNV = 5271u32, PerViewNV = 5272u32, PerTaskNV = 5273u32, - PerVertexNV = 5285u32, + PerVertexKHR = 5285u32, NonUniform = 5300u32, RestrictPointer = 5355u32, AliasedPointer = 5356u32, + HitObjectShaderRecordBufferNV = 5386u32, + BindlessSamplerNV = 5398u32, + BindlessImageNV = 5399u32, + BoundSamplerNV = 5400u32, + BoundImageNV = 5401u32, + SIMTCallINTEL = 5599u32, ReferencedIndirectlyINTEL = 5602u32, + ClobberINTEL = 5607u32, + SideEffectsINTEL = 5608u32, + VectorComputeVariableINTEL = 5624u32, + FuncParamIOKindINTEL = 5625u32, + VectorComputeFunctionINTEL = 5626u32, + StackCallINTEL = 5627u32, + GlobalVariableOffsetINTEL = 5628u32, CounterBuffer = 5634u32, UserSemantic = 5635u32, UserTypeGOOGLE = 5636u32, + FunctionRoundingModeINTEL = 5822u32, + FunctionDenormModeINTEL = 5823u32, RegisterINTEL = 5825u32, MemoryINTEL = 5826u32, NumbanksINTEL = 5827u32, @@ -1259,103 +1320,102 @@ pub enum Decoration { MergeINTEL = 5834u32, BankBitsINTEL = 5835u32, ForcePow2DepthINTEL = 5836u32, + BurstCoalesceINTEL = 5899u32, + CacheSizeINTEL = 5900u32, + DontStaticallyCoalesceINTEL = 5901u32, + PrefetchINTEL = 5902u32, + StallEnableINTEL = 5905u32, + FuseLoopsInFunctionINTEL = 5907u32, + MathOpDSPModeINTEL = 5909u32, + AliasScopeINTEL = 5914u32, + NoAliasINTEL = 5915u32, + InitiationIntervalINTEL = 5917u32, + MaxConcurrencyINTEL = 5918u32, + PipelineEnableINTEL = 5919u32, + BufferLocationINTEL = 5921u32, + IOPipeStorageINTEL = 5944u32, + FunctionFloatingPointModeINTEL = 6080u32, + SingleElementVectorINTEL = 6085u32, + VectorComputeCallableFunctionINTEL = 6087u32, + MediaBlockIOINTEL = 6140u32, + InitModeINTEL = 6147u32, + ImplementInRegisterMapINTEL = 6148u32, + HostAccessINTEL = 6168u32, + FPMaxErrorDecorationINTEL = 6170u32, + LatencyControlLabelINTEL = 6172u32, + LatencyControlConstraintINTEL = 6173u32, + ConduitKernelArgumentINTEL = 6175u32, + RegisterMapKernelArgumentINTEL = 6176u32, + MMHostInterfaceAddressWidthINTEL = 6177u32, + MMHostInterfaceDataWidthINTEL = 6178u32, + MMHostInterfaceLatencyINTEL = 6179u32, + MMHostInterfaceReadWriteModeINTEL = 6180u32, + MMHostInterfaceMaxBurstINTEL = 6181u32, + MMHostInterfaceWaitRequestINTEL = 6182u32, + StableKernelArgumentINTEL = 6183u32, + CacheControlLoadINTEL = 6442u32, + CacheControlStoreINTEL = 6443u32, +} +impl Decoration { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=11u32 => unsafe { core::mem::transmute::(n) }, + 13u32..=47u32 => unsafe { core::mem::transmute::(n) }, + 4469u32..=4470u32 => unsafe { core::mem::transmute::(n) }, + 4487u32..=4488u32 => unsafe { core::mem::transmute::(n) }, + 4999u32 => unsafe { core::mem::transmute::(4999u32) }, + 5019u32..=5020u32 => unsafe { core::mem::transmute::(n) }, + 5078u32 => unsafe { core::mem::transmute::(5078u32) }, + 5091u32 => unsafe { core::mem::transmute::(5091u32) }, + 5248u32 => unsafe { core::mem::transmute::(5248u32) }, + 5250u32 => unsafe { core::mem::transmute::(5250u32) }, + 5252u32 => unsafe { core::mem::transmute::(5252u32) }, + 5256u32 => unsafe { core::mem::transmute::(5256u32) }, + 5271u32..=5273u32 => unsafe { core::mem::transmute::(n) }, + 5285u32 => unsafe { core::mem::transmute::(5285u32) }, + 5300u32 => unsafe { core::mem::transmute::(5300u32) }, + 5355u32..=5356u32 => unsafe { core::mem::transmute::(n) }, + 5386u32 => unsafe { core::mem::transmute::(5386u32) }, + 5398u32..=5401u32 => unsafe { core::mem::transmute::(n) }, + 5599u32 => unsafe { core::mem::transmute::(5599u32) }, + 5602u32 => unsafe { core::mem::transmute::(5602u32) }, + 5607u32..=5608u32 => unsafe { core::mem::transmute::(n) }, + 5624u32..=5628u32 => unsafe { core::mem::transmute::(n) }, + 5634u32..=5636u32 => unsafe { core::mem::transmute::(n) }, + 5822u32..=5823u32 => unsafe { core::mem::transmute::(n) }, + 5825u32..=5836u32 => unsafe { core::mem::transmute::(n) }, + 5899u32..=5902u32 => unsafe { core::mem::transmute::(n) }, + 5905u32 => unsafe { core::mem::transmute::(5905u32) }, + 5907u32 => unsafe { core::mem::transmute::(5907u32) }, + 5909u32 => unsafe { core::mem::transmute::(5909u32) }, + 5914u32..=5915u32 => unsafe { core::mem::transmute::(n) }, + 5917u32..=5919u32 => unsafe { core::mem::transmute::(n) }, + 5921u32 => unsafe { core::mem::transmute::(5921u32) }, + 5944u32 => unsafe { core::mem::transmute::(5944u32) }, + 6080u32 => unsafe { core::mem::transmute::(6080u32) }, + 6085u32 => unsafe { core::mem::transmute::(6085u32) }, + 6087u32 => unsafe { core::mem::transmute::(6087u32) }, + 6140u32 => unsafe { core::mem::transmute::(6140u32) }, + 6147u32..=6148u32 => unsafe { core::mem::transmute::(n) }, + 6168u32 => unsafe { core::mem::transmute::(6168u32) }, + 6170u32 => unsafe { core::mem::transmute::(6170u32) }, + 6172u32..=6173u32 => unsafe { core::mem::transmute::(n) }, + 6175u32..=6183u32 => unsafe { core::mem::transmute::(n) }, + 6442u32..=6443u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } } #[allow(non_upper_case_globals)] impl Decoration { + pub const PerPrimitiveEXT: Self = Self::PerPrimitiveNV; + pub const PerVertexNV: Self = Self::PerVertexKHR; pub const NonUniformEXT: Self = Self::NonUniform; pub const RestrictPointerEXT: Self = Self::RestrictPointer; pub const AliasedPointerEXT: Self = Self::AliasedPointer; pub const HlslCounterBufferGOOGLE: Self = Self::CounterBuffer; pub const HlslSemanticGOOGLE: Self = Self::UserSemantic; } -impl num_traits::FromPrimitive for Decoration { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::RelaxedPrecision, - 1u32 => Self::SpecId, - 2u32 => Self::Block, - 3u32 => Self::BufferBlock, - 4u32 => Self::RowMajor, - 5u32 => Self::ColMajor, - 6u32 => Self::ArrayStride, - 7u32 => Self::MatrixStride, - 8u32 => Self::GLSLShared, - 9u32 => Self::GLSLPacked, - 10u32 => Self::CPacked, - 11u32 => Self::BuiltIn, - 13u32 => Self::NoPerspective, - 14u32 => Self::Flat, - 15u32 => Self::Patch, - 16u32 => Self::Centroid, - 17u32 => Self::Sample, - 18u32 => Self::Invariant, - 19u32 => Self::Restrict, - 20u32 => Self::Aliased, - 21u32 => Self::Volatile, - 22u32 => Self::Constant, - 23u32 => Self::Coherent, - 24u32 => Self::NonWritable, - 25u32 => Self::NonReadable, - 26u32 => Self::Uniform, - 27u32 => Self::UniformId, - 28u32 => Self::SaturatedConversion, - 29u32 => Self::Stream, - 30u32 => Self::Location, - 31u32 => Self::Component, - 32u32 => Self::Index, - 33u32 => Self::Binding, - 34u32 => Self::DescriptorSet, - 35u32 => Self::Offset, - 36u32 => Self::XfbBuffer, - 37u32 => Self::XfbStride, - 38u32 => Self::FuncParamAttr, - 39u32 => Self::FPRoundingMode, - 40u32 => Self::FPFastMathMode, - 41u32 => Self::LinkageAttributes, - 42u32 => Self::NoContraction, - 43u32 => Self::InputAttachmentIndex, - 44u32 => Self::Alignment, - 45u32 => Self::MaxByteOffset, - 46u32 => Self::AlignmentId, - 47u32 => Self::MaxByteOffsetId, - 4469u32 => Self::NoSignedWrap, - 4470u32 => Self::NoUnsignedWrap, - 4999u32 => Self::ExplicitInterpAMD, - 5248u32 => Self::OverrideCoverageNV, - 5250u32 => Self::PassthroughNV, - 5252u32 => Self::ViewportRelativeNV, - 5256u32 => Self::SecondaryViewportRelativeNV, - 5271u32 => Self::PerPrimitiveNV, - 5272u32 => Self::PerViewNV, - 5273u32 => Self::PerTaskNV, - 5285u32 => Self::PerVertexNV, - 5300u32 => Self::NonUniform, - 5355u32 => Self::RestrictPointer, - 5356u32 => Self::AliasedPointer, - 5602u32 => Self::ReferencedIndirectlyINTEL, - 5634u32 => Self::CounterBuffer, - 5635u32 => Self::UserSemantic, - 5636u32 => Self::UserTypeGOOGLE, - 5825u32 => Self::RegisterINTEL, - 5826u32 => Self::MemoryINTEL, - 5827u32 => Self::NumbanksINTEL, - 5828u32 => Self::BankwidthINTEL, - 5829u32 => Self::MaxPrivateCopiesINTEL, - 5830u32 => Self::SinglepumpINTEL, - 5831u32 => Self::DoublepumpINTEL, - 5832u32 => Self::MaxReplicatesINTEL, - 5833u32 => Self::SimpleDualPortINTEL, - 5834u32 => Self::MergeINTEL, - 5835u32 => Self::BankBitsINTEL, - 5836u32 => Self::ForcePow2DepthINTEL, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } -} impl core::str::FromStr for Decoration { type Err = (); fn from_str(s: &str) -> Result { @@ -1409,27 +1469,50 @@ impl core::str::FromStr for Decoration { "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), - "PerVertexNV" => Ok(Self::PerVertexNV), + "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), @@ -1442,11 +1525,46 @@ impl core::str::FromStr for Decoration { "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(()), } } } -#[doc = "/// SPIR-V operand kind: [BuiltIn](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_built_in_a_built_in)"] +#[doc = "SPIR-V operand kind: [BuiltIn](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_built_in_a_built_in)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1494,6 +1612,11 @@ pub enum BuiltIn { SubgroupLocalInvocationId = 41u32, VertexIndex = 42u32, InstanceIndex = 43u32, + CoreIDARM = 4160u32, + CoreCountARM = 4161u32, + CoreMaxIDARM = 4162u32, + WarpIDARM = 4163u32, + WarpMaxIDARM = 4164u32, SubgroupEqMask = 4416u32, SubgroupGeMask = 4417u32, SubgroupGtMask = 4418u32, @@ -1514,6 +1637,8 @@ pub enum BuiltIn { BaryCoordSmoothSampleAMD = 4997u32, BaryCoordPullModelAMD = 4998u32, FragStencilRefEXT = 5014u32, + CoalescedInputCountAMDX = 5021u32, + ShaderIndexAMDX = 5073u32, ViewportMaskNV = 5253u32, SecondaryPositionNV = 5257u32, SecondaryViewportMaskNV = 5258u32, @@ -1528,10 +1653,14 @@ pub enum BuiltIn { LayerPerViewNV = 5279u32, MeshViewCountNV = 5280u32, MeshViewIndicesNV = 5281u32, - BaryCoordNV = 5286u32, - BaryCoordNoPerspNV = 5287u32, + BaryCoordKHR = 5286u32, + BaryCoordNoPerspKHR = 5287u32, FragSizeEXT = 5292u32, FragInvocationCountEXT = 5293u32, + PrimitivePointIndicesEXT = 5294u32, + PrimitiveLineIndicesEXT = 5295u32, + PrimitiveTriangleIndicesEXT = 5296u32, + CullPrimitiveEXT = 5299u32, LaunchIdNV = 5319u32, LaunchSizeNV = 5320u32, WorldRayOriginNV = 5321u32, @@ -1545,12 +1674,57 @@ pub enum BuiltIn { WorldToObjectNV = 5331u32, HitTNV = 5332u32, HitKindNV = 5333u32, + CurrentRayTimeNV = 5334u32, + HitTriangleVertexPositionsKHR = 5335u32, + HitMicroTriangleVertexPositionsNV = 5337u32, + HitMicroTriangleVertexBarycentricsNV = 5344u32, IncomingRayFlagsNV = 5351u32, RayGeometryIndexKHR = 5352u32, WarpsPerSMNV = 5374u32, SMCountNV = 5375u32, WarpIDNV = 5376u32, SMIDNV = 5377u32, + HitKindFrontFacingMicroTriangleNV = 5405u32, + HitKindBackFacingMicroTriangleNV = 5406u32, + CullMaskKHR = 6021u32, +} +impl BuiltIn { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 3u32..=20u32 => unsafe { core::mem::transmute::(n) }, + 22u32..=34u32 => unsafe { core::mem::transmute::(n) }, + 36u32..=43u32 => unsafe { core::mem::transmute::(n) }, + 4160u32..=4164u32 => unsafe { core::mem::transmute::(n) }, + 4416u32..=4420u32 => unsafe { core::mem::transmute::(n) }, + 4424u32..=4426u32 => unsafe { core::mem::transmute::(n) }, + 4432u32 => unsafe { core::mem::transmute::(4432u32) }, + 4438u32 => unsafe { core::mem::transmute::(4438u32) }, + 4440u32 => unsafe { core::mem::transmute::(4440u32) }, + 4444u32 => unsafe { core::mem::transmute::(4444u32) }, + 4992u32..=4998u32 => unsafe { core::mem::transmute::(n) }, + 5014u32 => unsafe { core::mem::transmute::(5014u32) }, + 5021u32 => unsafe { core::mem::transmute::(5021u32) }, + 5073u32 => unsafe { core::mem::transmute::(5073u32) }, + 5253u32 => unsafe { core::mem::transmute::(5253u32) }, + 5257u32..=5258u32 => unsafe { core::mem::transmute::(n) }, + 5261u32..=5262u32 => unsafe { core::mem::transmute::(n) }, + 5264u32 => unsafe { core::mem::transmute::(5264u32) }, + 5274u32..=5281u32 => unsafe { core::mem::transmute::(n) }, + 5286u32..=5287u32 => unsafe { core::mem::transmute::(n) }, + 5292u32..=5296u32 => unsafe { core::mem::transmute::(n) }, + 5299u32 => unsafe { core::mem::transmute::(5299u32) }, + 5319u32..=5327u32 => unsafe { core::mem::transmute::(n) }, + 5330u32..=5335u32 => unsafe { core::mem::transmute::(n) }, + 5337u32 => unsafe { core::mem::transmute::(5337u32) }, + 5344u32 => unsafe { core::mem::transmute::(5344u32) }, + 5351u32..=5352u32 => unsafe { core::mem::transmute::(n) }, + 5374u32..=5377u32 => unsafe { core::mem::transmute::(n) }, + 5405u32..=5406u32 => unsafe { core::mem::transmute::(n) }, + 6021u32 => unsafe { core::mem::transmute::(6021u32) }, + _ => return None, + }) + } } #[allow(non_upper_case_globals)] impl BuiltIn { @@ -1559,6 +1733,8 @@ impl BuiltIn { pub const SubgroupGtMaskKHR: Self = Self::SubgroupGtMask; pub const SubgroupLeMaskKHR: Self = Self::SubgroupLeMask; pub const SubgroupLtMaskKHR: Self = Self::SubgroupLtMask; + pub const BaryCoordNV: Self = Self::BaryCoordKHR; + pub const BaryCoordNoPerspNV: Self = Self::BaryCoordNoPerspKHR; pub const FragmentSizeNV: Self = Self::FragSizeEXT; pub const InvocationsPerPixelNV: Self = Self::FragInvocationCountEXT; pub const LaunchIdKHR: Self = Self::LaunchIdNV; @@ -1575,115 +1751,6 @@ impl BuiltIn { pub const HitKindKHR: Self = Self::HitKindNV; pub const IncomingRayFlagsKHR: Self = Self::IncomingRayFlagsNV; } -impl num_traits::FromPrimitive for BuiltIn { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Position, - 1u32 => Self::PointSize, - 3u32 => Self::ClipDistance, - 4u32 => Self::CullDistance, - 5u32 => Self::VertexId, - 6u32 => Self::InstanceId, - 7u32 => Self::PrimitiveId, - 8u32 => Self::InvocationId, - 9u32 => Self::Layer, - 10u32 => Self::ViewportIndex, - 11u32 => Self::TessLevelOuter, - 12u32 => Self::TessLevelInner, - 13u32 => Self::TessCoord, - 14u32 => Self::PatchVertices, - 15u32 => Self::FragCoord, - 16u32 => Self::PointCoord, - 17u32 => Self::FrontFacing, - 18u32 => Self::SampleId, - 19u32 => Self::SamplePosition, - 20u32 => Self::SampleMask, - 22u32 => Self::FragDepth, - 23u32 => Self::HelperInvocation, - 24u32 => Self::NumWorkgroups, - 25u32 => Self::WorkgroupSize, - 26u32 => Self::WorkgroupId, - 27u32 => Self::LocalInvocationId, - 28u32 => Self::GlobalInvocationId, - 29u32 => Self::LocalInvocationIndex, - 30u32 => Self::WorkDim, - 31u32 => Self::GlobalSize, - 32u32 => Self::EnqueuedWorkgroupSize, - 33u32 => Self::GlobalOffset, - 34u32 => Self::GlobalLinearId, - 36u32 => Self::SubgroupSize, - 37u32 => Self::SubgroupMaxSize, - 38u32 => Self::NumSubgroups, - 39u32 => Self::NumEnqueuedSubgroups, - 40u32 => Self::SubgroupId, - 41u32 => Self::SubgroupLocalInvocationId, - 42u32 => Self::VertexIndex, - 43u32 => Self::InstanceIndex, - 4416u32 => Self::SubgroupEqMask, - 4417u32 => Self::SubgroupGeMask, - 4418u32 => Self::SubgroupGtMask, - 4419u32 => Self::SubgroupLeMask, - 4420u32 => Self::SubgroupLtMask, - 4424u32 => Self::BaseVertex, - 4425u32 => Self::BaseInstance, - 4426u32 => Self::DrawIndex, - 4432u32 => Self::PrimitiveShadingRateKHR, - 4438u32 => Self::DeviceIndex, - 4440u32 => Self::ViewIndex, - 4444u32 => Self::ShadingRateKHR, - 4992u32 => Self::BaryCoordNoPerspAMD, - 4993u32 => Self::BaryCoordNoPerspCentroidAMD, - 4994u32 => Self::BaryCoordNoPerspSampleAMD, - 4995u32 => Self::BaryCoordSmoothAMD, - 4996u32 => Self::BaryCoordSmoothCentroidAMD, - 4997u32 => Self::BaryCoordSmoothSampleAMD, - 4998u32 => Self::BaryCoordPullModelAMD, - 5014u32 => Self::FragStencilRefEXT, - 5253u32 => Self::ViewportMaskNV, - 5257u32 => Self::SecondaryPositionNV, - 5258u32 => Self::SecondaryViewportMaskNV, - 5261u32 => Self::PositionPerViewNV, - 5262u32 => Self::ViewportMaskPerViewNV, - 5264u32 => Self::FullyCoveredEXT, - 5274u32 => Self::TaskCountNV, - 5275u32 => Self::PrimitiveCountNV, - 5276u32 => Self::PrimitiveIndicesNV, - 5277u32 => Self::ClipDistancePerViewNV, - 5278u32 => Self::CullDistancePerViewNV, - 5279u32 => Self::LayerPerViewNV, - 5280u32 => Self::MeshViewCountNV, - 5281u32 => Self::MeshViewIndicesNV, - 5286u32 => Self::BaryCoordNV, - 5287u32 => Self::BaryCoordNoPerspNV, - 5292u32 => Self::FragSizeEXT, - 5293u32 => Self::FragInvocationCountEXT, - 5319u32 => Self::LaunchIdNV, - 5320u32 => Self::LaunchSizeNV, - 5321u32 => Self::WorldRayOriginNV, - 5322u32 => Self::WorldRayDirectionNV, - 5323u32 => Self::ObjectRayOriginNV, - 5324u32 => Self::ObjectRayDirectionNV, - 5325u32 => Self::RayTminNV, - 5326u32 => Self::RayTmaxNV, - 5327u32 => Self::InstanceCustomIndexNV, - 5330u32 => Self::ObjectToWorldNV, - 5331u32 => Self::WorldToObjectNV, - 5332u32 => Self::HitTNV, - 5333u32 => Self::HitKindNV, - 5351u32 => Self::IncomingRayFlagsNV, - 5352u32 => Self::RayGeometryIndexKHR, - 5374u32 => Self::WarpsPerSMNV, - 5375u32 => Self::SMCountNV, - 5376u32 => Self::WarpIDNV, - 5377u32 => Self::SMIDNV, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } -} impl core::str::FromStr for BuiltIn { type Err = (); fn from_str(s: &str) -> Result { @@ -1729,15 +1796,20 @@ impl core::str::FromStr for BuiltIn { "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), - "SubgroupGeMask" => Ok(Self::SubgroupGeMask), - "SubgroupGtMask" => Ok(Self::SubgroupGtMask), - "SubgroupLeMask" => Ok(Self::SubgroupLeMask), - "SubgroupLtMask" => Ok(Self::SubgroupLtMask), "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), @@ -1754,6 +1826,8 @@ impl core::str::FromStr for BuiltIn { "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), @@ -1768,12 +1842,18 @@ impl core::str::FromStr for BuiltIn { "LayerPerViewNV" => Ok(Self::LayerPerViewNV), "MeshViewCountNV" => Ok(Self::MeshViewCountNV), "MeshViewIndicesNV" => Ok(Self::MeshViewIndicesNV), - "BaryCoordNV" => Ok(Self::BaryCoordNV), - "BaryCoordNoPerspNV" => Ok(Self::BaryCoordNoPerspNV), + "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), @@ -1799,6 +1879,12 @@ impl core::str::FromStr for BuiltIn { "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), @@ -1806,11 +1892,14 @@ impl core::str::FromStr for BuiltIn { "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(()), } } } -#[doc = "/// SPIR-V operand kind: [Scope](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_scope_a_scope)"] +#[doc = "SPIR-V operand kind: [Scope](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_scope_a_scope)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1825,27 +1914,17 @@ pub enum Scope { QueueFamily = 5u32, ShaderCallKHR = 6u32, } -#[allow(non_upper_case_globals)] impl Scope { - pub const QueueFamilyKHR: Self = Self::QueueFamily; -} -impl num_traits::FromPrimitive for Scope { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::CrossDevice, - 1u32 => Self::Device, - 2u32 => Self::Workgroup, - 3u32 => Self::Subgroup, - 4u32 => Self::Invocation, - 5u32 => Self::QueueFamily, - 6u32 => Self::ShaderCallKHR, + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } +} +#[allow(non_upper_case_globals)] +impl Scope { + pub const QueueFamilyKHR: Self = Self::QueueFamily; } impl core::str::FromStr for Scope { type Err = (); @@ -1863,7 +1942,7 @@ impl core::str::FromStr for Scope { } } } -#[doc = "/// SPIR-V operand kind: [GroupOperation](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_group_operation_a_group_operation)"] +#[doc = "SPIR-V operand kind: [GroupOperation](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_group_operation_a_group_operation)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1878,26 +1957,17 @@ pub enum GroupOperation { PartitionedInclusiveScanNV = 7u32, PartitionedExclusiveScanNV = 8u32, } -#[allow(non_upper_case_globals)] -impl GroupOperation {} -impl num_traits::FromPrimitive for GroupOperation { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Reduce, - 1u32 => Self::InclusiveScan, - 2u32 => Self::ExclusiveScan, - 3u32 => Self::ClusteredReduce, - 6u32 => Self::PartitionedReduceNV, - 7u32 => Self::PartitionedInclusiveScanNV, - 8u32 => Self::PartitionedExclusiveScanNV, +impl GroupOperation { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 6u32..=8u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl GroupOperation {} impl core::str::FromStr for GroupOperation { type Err = (); fn from_str(s: &str) -> Result { @@ -1913,7 +1983,7 @@ impl core::str::FromStr for GroupOperation { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -1924,22 +1994,16 @@ pub enum KernelEnqueueFlags { WaitKernel = 1u32, WaitWorkGroup = 2u32, } -#[allow(non_upper_case_globals)] -impl KernelEnqueueFlags {} -impl num_traits::FromPrimitive for KernelEnqueueFlags { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::NoWait, - 1u32 => Self::WaitKernel, - 2u32 => Self::WaitWorkGroup, +impl KernelEnqueueFlags { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl KernelEnqueueFlags {} impl core::str::FromStr for KernelEnqueueFlags { type Err = (); fn from_str(s: &str) -> Result { @@ -1951,7 +2015,7 @@ impl core::str::FromStr for KernelEnqueueFlags { } } } -#[doc = "/// SPIR-V operand kind: [Capability](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_capability_a_capability)"] +#[doc = "SPIR-V operand kind: [Capability](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_capability_a_capability)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -2027,9 +2091,17 @@ pub enum Capability { GroupNonUniformQuad = 68u32, ShaderLayer = 69u32, ShaderViewportIndex = 70u32, + UniformDecoration = 71u32, + CoreBuiltinsARM = 4165u32, + TileImageColorReadAccessEXT = 4166u32, + TileImageDepthReadAccessEXT = 4167u32, + TileImageStencilReadAccessEXT = 4168u32, FragmentShadingRateKHR = 4422u32, SubgroupBallotKHR = 4423u32, DrawParameters = 4427u32, + WorkgroupMemoryExplicitLayoutKHR = 4428u32, + WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429u32, + WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430u32, SubgroupVoteKHR = 4431u32, StorageBuffer16BitAccess = 4433u32, UniformAndStorageBuffer16BitAccess = 4434u32, @@ -2053,6 +2125,9 @@ pub enum Capability { RayQueryKHR = 4472u32, RayTraversalPrimitiveCullingKHR = 4478u32, RayTracingKHR = 4479u32, + TextureSampleWeightedQCOM = 4484u32, + TextureBoxFilterQCOM = 4485u32, + TextureBlockMatchQCOM = 4486u32, Float16ImageAMD = 5008u32, ImageGatherBiasLodAMD = 5009u32, FragmentMaskAMD = 5010u32, @@ -2060,6 +2135,7 @@ pub enum Capability { ImageReadWriteLodAMD = 5015u32, Int64ImageEXT = 5016u32, ShaderClockKHR = 5055u32, + ShaderEnqueueAMDX = 5067u32, SampleMaskOverrideCoverageNV = 5249u32, GeometryShaderPassthroughNV = 5251u32, ShaderViewportIndexLayerEXT = 5254u32, @@ -2069,7 +2145,8 @@ pub enum Capability { FragmentFullyCoveredEXT = 5265u32, MeshShadingNV = 5266u32, ImageFootprintNV = 5282u32, - FragmentBarycentricNV = 5284u32, + MeshShadingEXT = 5283u32, + FragmentBarycentricKHR = 5284u32, ComputeDerivativeGroupQuadsNV = 5288u32, FragmentDensityEXT = 5291u32, GroupNonUniformPartitionedNV = 5297u32, @@ -2085,7 +2162,9 @@ pub enum Capability { InputAttachmentArrayNonUniformIndexing = 5310u32, UniformTexelBufferArrayNonUniformIndexing = 5311u32, StorageTexelBufferArrayNonUniformIndexing = 5312u32, + RayTracingPositionFetchKHR = 5336u32, RayTracingNV = 5340u32, + RayTracingMotionBlurNV = 5341u32, VulkanMemoryModel = 5345u32, VulkanMemoryModelDeviceScope = 5346u32, PhysicalStorageBufferAddresses = 5347u32, @@ -2096,32 +2175,182 @@ pub enum Capability { FragmentShaderShadingRateInterlockEXT = 5372u32, ShaderSMBuiltinsNV = 5373u32, FragmentShaderPixelInterlockEXT = 5378u32, - DemoteToHelperInvocationEXT = 5379u32, + DemoteToHelperInvocation = 5379u32, + DisplacementMicromapNV = 5380u32, + RayTracingOpacityMicromapEXT = 5381u32, + ShaderInvocationReorderNV = 5383u32, + BindlessTextureNV = 5390u32, + RayQueryPositionFetchKHR = 5391u32, + RayTracingDisplacementMicromapNV = 5409u32, SubgroupShuffleINTEL = 5568u32, SubgroupBufferBlockIOINTEL = 5569u32, SubgroupImageBlockIOINTEL = 5570u32, SubgroupImageMediaBlockIOINTEL = 5579u32, + RoundToInfinityINTEL = 5582u32, + FloatingPointModeINTEL = 5583u32, IntegerFunctions2INTEL = 5584u32, FunctionPointersINTEL = 5603u32, IndirectReferencesINTEL = 5604u32, + AsmINTEL = 5606u32, + AtomicFloat32MinMaxEXT = 5612u32, + AtomicFloat64MinMaxEXT = 5613u32, + AtomicFloat16MinMaxEXT = 5616u32, + VectorComputeINTEL = 5617u32, + VectorAnyINTEL = 5619u32, + ExpectAssumeKHR = 5629u32, SubgroupAvcMotionEstimationINTEL = 5696u32, SubgroupAvcMotionEstimationIntraINTEL = 5697u32, SubgroupAvcMotionEstimationChromaINTEL = 5698u32, + VariableLengthArrayINTEL = 5817u32, + FunctionFloatControlINTEL = 5821u32, FPGAMemoryAttributesINTEL = 5824u32, + FPFastMathModeINTEL = 5837u32, + ArbitraryPrecisionIntegersINTEL = 5844u32, + ArbitraryPrecisionFloatingPointINTEL = 5845u32, UnstructuredLoopControlsINTEL = 5886u32, FPGALoopControlsINTEL = 5888u32, KernelAttributesINTEL = 5892u32, FPGAKernelAttributesINTEL = 5897u32, + FPGAMemoryAccessesINTEL = 5898u32, + FPGAClusterAttributesINTEL = 5904u32, + LoopFuseINTEL = 5906u32, + FPGADSPControlINTEL = 5908u32, + MemoryAccessAliasingINTEL = 5910u32, + FPGAInvocationPipeliningAttributesINTEL = 5916u32, + FPGABufferLocationINTEL = 5920u32, + ArbitraryPrecisionFixedPointINTEL = 5922u32, + USMStorageClassesINTEL = 5935u32, + RuntimeAlignedAttributeINTEL = 5939u32, + IOPipesINTEL = 5943u32, BlockingPipesINTEL = 5945u32, FPGARegINTEL = 5948u32, + DotProductInputAll = 6016u32, + DotProductInput4x8Bit = 6017u32, + DotProductInput4x8BitPacked = 6018u32, + DotProduct = 6019u32, + RayCullMaskKHR = 6020u32, + CooperativeMatrixKHR = 6022u32, + BitInstructions = 6025u32, + GroupNonUniformRotateKHR = 6026u32, AtomicFloat32AddEXT = 6033u32, AtomicFloat64AddEXT = 6034u32, + LongConstantCompositeINTEL = 6089u32, + OptNoneINTEL = 6094u32, + AtomicFloat16AddEXT = 6095u32, + DebugInfoModuleINTEL = 6114u32, + BFloat16ConversionINTEL = 6115u32, + SplitBarrierINTEL = 6141u32, + GlobalVariableFPGADecorationsINTEL = 6146u32, + FPGAKernelAttributesv2INTEL = 6161u32, + GlobalVariableHostAccessINTEL = 6167u32, + FPMaxErrorINTEL = 6169u32, + FPGALatencyControlINTEL = 6171u32, + FPGAArgumentInterfacesINTEL = 6174u32, + GroupUniformArithmeticKHR = 6400u32, + CacheControlsINTEL = 6441u32, +} +impl Capability { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=15u32 => unsafe { core::mem::transmute::(n) }, + 17u32..=25u32 => unsafe { core::mem::transmute::(n) }, + 27u32..=71u32 => unsafe { core::mem::transmute::(n) }, + 4165u32..=4168u32 => unsafe { core::mem::transmute::(n) }, + 4422u32..=4423u32 => unsafe { core::mem::transmute::(n) }, + 4427u32..=4431u32 => unsafe { core::mem::transmute::(n) }, + 4433u32..=4437u32 => unsafe { core::mem::transmute::(n) }, + 4439u32 => unsafe { core::mem::transmute::(4439u32) }, + 4441u32..=4442u32 => unsafe { core::mem::transmute::(n) }, + 4445u32 => unsafe { core::mem::transmute::(4445u32) }, + 4447u32..=4450u32 => unsafe { core::mem::transmute::(n) }, + 4464u32..=4468u32 => unsafe { core::mem::transmute::(n) }, + 4471u32..=4472u32 => unsafe { core::mem::transmute::(n) }, + 4478u32..=4479u32 => unsafe { core::mem::transmute::(n) }, + 4484u32..=4486u32 => unsafe { core::mem::transmute::(n) }, + 5008u32..=5010u32 => unsafe { core::mem::transmute::(n) }, + 5013u32 => unsafe { core::mem::transmute::(5013u32) }, + 5015u32..=5016u32 => unsafe { core::mem::transmute::(n) }, + 5055u32 => unsafe { core::mem::transmute::(5055u32) }, + 5067u32 => unsafe { core::mem::transmute::(5067u32) }, + 5249u32 => unsafe { core::mem::transmute::(5249u32) }, + 5251u32 => unsafe { core::mem::transmute::(5251u32) }, + 5254u32..=5255u32 => unsafe { core::mem::transmute::(n) }, + 5259u32..=5260u32 => unsafe { core::mem::transmute::(n) }, + 5265u32..=5266u32 => unsafe { core::mem::transmute::(n) }, + 5282u32..=5284u32 => unsafe { core::mem::transmute::(n) }, + 5288u32 => unsafe { core::mem::transmute::(5288u32) }, + 5291u32 => unsafe { core::mem::transmute::(5291u32) }, + 5297u32 => unsafe { core::mem::transmute::(5297u32) }, + 5301u32..=5312u32 => unsafe { core::mem::transmute::(n) }, + 5336u32 => unsafe { core::mem::transmute::(5336u32) }, + 5340u32..=5341u32 => unsafe { core::mem::transmute::(n) }, + 5345u32..=5347u32 => unsafe { core::mem::transmute::(n) }, + 5350u32 => unsafe { core::mem::transmute::(5350u32) }, + 5353u32 => unsafe { core::mem::transmute::(5353u32) }, + 5357u32 => unsafe { core::mem::transmute::(5357u32) }, + 5363u32 => unsafe { core::mem::transmute::(5363u32) }, + 5372u32..=5373u32 => unsafe { core::mem::transmute::(n) }, + 5378u32..=5381u32 => unsafe { core::mem::transmute::(n) }, + 5383u32 => unsafe { core::mem::transmute::(5383u32) }, + 5390u32..=5391u32 => unsafe { core::mem::transmute::(n) }, + 5409u32 => unsafe { core::mem::transmute::(5409u32) }, + 5568u32..=5570u32 => unsafe { core::mem::transmute::(n) }, + 5579u32 => unsafe { core::mem::transmute::(5579u32) }, + 5582u32..=5584u32 => unsafe { core::mem::transmute::(n) }, + 5603u32..=5604u32 => unsafe { core::mem::transmute::(n) }, + 5606u32 => unsafe { core::mem::transmute::(5606u32) }, + 5612u32..=5613u32 => unsafe { core::mem::transmute::(n) }, + 5616u32..=5617u32 => unsafe { core::mem::transmute::(n) }, + 5619u32 => unsafe { core::mem::transmute::(5619u32) }, + 5629u32 => unsafe { core::mem::transmute::(5629u32) }, + 5696u32..=5698u32 => unsafe { core::mem::transmute::(n) }, + 5817u32 => unsafe { core::mem::transmute::(5817u32) }, + 5821u32 => unsafe { core::mem::transmute::(5821u32) }, + 5824u32 => unsafe { core::mem::transmute::(5824u32) }, + 5837u32 => unsafe { core::mem::transmute::(5837u32) }, + 5844u32..=5845u32 => unsafe { core::mem::transmute::(n) }, + 5886u32 => unsafe { core::mem::transmute::(5886u32) }, + 5888u32 => unsafe { core::mem::transmute::(5888u32) }, + 5892u32 => unsafe { core::mem::transmute::(5892u32) }, + 5897u32..=5898u32 => unsafe { core::mem::transmute::(n) }, + 5904u32 => unsafe { core::mem::transmute::(5904u32) }, + 5906u32 => unsafe { core::mem::transmute::(5906u32) }, + 5908u32 => unsafe { core::mem::transmute::(5908u32) }, + 5910u32 => unsafe { core::mem::transmute::(5910u32) }, + 5916u32 => unsafe { core::mem::transmute::(5916u32) }, + 5920u32 => unsafe { core::mem::transmute::(5920u32) }, + 5922u32 => unsafe { core::mem::transmute::(5922u32) }, + 5935u32 => unsafe { core::mem::transmute::(5935u32) }, + 5939u32 => unsafe { core::mem::transmute::(5939u32) }, + 5943u32 => unsafe { core::mem::transmute::(5943u32) }, + 5945u32 => unsafe { core::mem::transmute::(5945u32) }, + 5948u32 => unsafe { core::mem::transmute::(5948u32) }, + 6016u32..=6020u32 => unsafe { core::mem::transmute::(n) }, + 6022u32 => unsafe { core::mem::transmute::(6022u32) }, + 6025u32..=6026u32 => unsafe { core::mem::transmute::(n) }, + 6033u32..=6034u32 => unsafe { core::mem::transmute::(n) }, + 6089u32 => unsafe { core::mem::transmute::(6089u32) }, + 6094u32..=6095u32 => unsafe { core::mem::transmute::(n) }, + 6114u32..=6115u32 => unsafe { core::mem::transmute::(n) }, + 6141u32 => unsafe { core::mem::transmute::(6141u32) }, + 6146u32 => unsafe { core::mem::transmute::(6146u32) }, + 6161u32 => unsafe { core::mem::transmute::(6161u32) }, + 6167u32 => unsafe { core::mem::transmute::(6167u32) }, + 6169u32 => unsafe { core::mem::transmute::(6169u32) }, + 6171u32 => unsafe { core::mem::transmute::(6171u32) }, + 6174u32 => unsafe { core::mem::transmute::(6174u32) }, + 6400u32 => unsafe { core::mem::transmute::(6400u32) }, + 6441u32 => unsafe { core::mem::transmute::(6441u32) }, + _ => return None, + }) + } } #[allow(non_upper_case_globals)] impl Capability { pub const StorageUniformBufferBlock16: Self = Self::StorageBuffer16BitAccess; pub const StorageUniform16: Self = Self::UniformAndStorageBuffer16BitAccess; pub const ShaderViewportIndexLayerNV: Self = Self::ShaderViewportIndexLayerEXT; + pub const FragmentBarycentricNV: Self = Self::FragmentBarycentricKHR; pub const ShadingRateNV: Self = Self::FragmentDensityEXT; pub const ShaderNonUniformEXT: Self = Self::ShaderNonUniform; pub const RuntimeDescriptorArrayEXT: Self = Self::RuntimeDescriptorArray; @@ -2148,175 +2377,11 @@ impl Capability { pub const VulkanMemoryModelKHR: Self = Self::VulkanMemoryModel; pub const VulkanMemoryModelDeviceScopeKHR: Self = Self::VulkanMemoryModelDeviceScope; pub const PhysicalStorageBufferAddressesEXT: Self = Self::PhysicalStorageBufferAddresses; -} -impl num_traits::FromPrimitive for Capability { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::Matrix, - 1u32 => Self::Shader, - 2u32 => Self::Geometry, - 3u32 => Self::Tessellation, - 4u32 => Self::Addresses, - 5u32 => Self::Linkage, - 6u32 => Self::Kernel, - 7u32 => Self::Vector16, - 8u32 => Self::Float16Buffer, - 9u32 => Self::Float16, - 10u32 => Self::Float64, - 11u32 => Self::Int64, - 12u32 => Self::Int64Atomics, - 13u32 => Self::ImageBasic, - 14u32 => Self::ImageReadWrite, - 15u32 => Self::ImageMipmap, - 17u32 => Self::Pipes, - 18u32 => Self::Groups, - 19u32 => Self::DeviceEnqueue, - 20u32 => Self::LiteralSampler, - 21u32 => Self::AtomicStorage, - 22u32 => Self::Int16, - 23u32 => Self::TessellationPointSize, - 24u32 => Self::GeometryPointSize, - 25u32 => Self::ImageGatherExtended, - 27u32 => Self::StorageImageMultisample, - 28u32 => Self::UniformBufferArrayDynamicIndexing, - 29u32 => Self::SampledImageArrayDynamicIndexing, - 30u32 => Self::StorageBufferArrayDynamicIndexing, - 31u32 => Self::StorageImageArrayDynamicIndexing, - 32u32 => Self::ClipDistance, - 33u32 => Self::CullDistance, - 34u32 => Self::ImageCubeArray, - 35u32 => Self::SampleRateShading, - 36u32 => Self::ImageRect, - 37u32 => Self::SampledRect, - 38u32 => Self::GenericPointer, - 39u32 => Self::Int8, - 40u32 => Self::InputAttachment, - 41u32 => Self::SparseResidency, - 42u32 => Self::MinLod, - 43u32 => Self::Sampled1D, - 44u32 => Self::Image1D, - 45u32 => Self::SampledCubeArray, - 46u32 => Self::SampledBuffer, - 47u32 => Self::ImageBuffer, - 48u32 => Self::ImageMSArray, - 49u32 => Self::StorageImageExtendedFormats, - 50u32 => Self::ImageQuery, - 51u32 => Self::DerivativeControl, - 52u32 => Self::InterpolationFunction, - 53u32 => Self::TransformFeedback, - 54u32 => Self::GeometryStreams, - 55u32 => Self::StorageImageReadWithoutFormat, - 56u32 => Self::StorageImageWriteWithoutFormat, - 57u32 => Self::MultiViewport, - 58u32 => Self::SubgroupDispatch, - 59u32 => Self::NamedBarrier, - 60u32 => Self::PipeStorage, - 61u32 => Self::GroupNonUniform, - 62u32 => Self::GroupNonUniformVote, - 63u32 => Self::GroupNonUniformArithmetic, - 64u32 => Self::GroupNonUniformBallot, - 65u32 => Self::GroupNonUniformShuffle, - 66u32 => Self::GroupNonUniformShuffleRelative, - 67u32 => Self::GroupNonUniformClustered, - 68u32 => Self::GroupNonUniformQuad, - 69u32 => Self::ShaderLayer, - 70u32 => Self::ShaderViewportIndex, - 4422u32 => Self::FragmentShadingRateKHR, - 4423u32 => Self::SubgroupBallotKHR, - 4427u32 => Self::DrawParameters, - 4431u32 => Self::SubgroupVoteKHR, - 4433u32 => Self::StorageBuffer16BitAccess, - 4434u32 => Self::UniformAndStorageBuffer16BitAccess, - 4435u32 => Self::StoragePushConstant16, - 4436u32 => Self::StorageInputOutput16, - 4437u32 => Self::DeviceGroup, - 4439u32 => Self::MultiView, - 4441u32 => Self::VariablePointersStorageBuffer, - 4442u32 => Self::VariablePointers, - 4445u32 => Self::AtomicStorageOps, - 4447u32 => Self::SampleMaskPostDepthCoverage, - 4448u32 => Self::StorageBuffer8BitAccess, - 4449u32 => Self::UniformAndStorageBuffer8BitAccess, - 4450u32 => Self::StoragePushConstant8, - 4464u32 => Self::DenormPreserve, - 4465u32 => Self::DenormFlushToZero, - 4466u32 => Self::SignedZeroInfNanPreserve, - 4467u32 => Self::RoundingModeRTE, - 4468u32 => Self::RoundingModeRTZ, - 4471u32 => Self::RayQueryProvisionalKHR, - 4472u32 => Self::RayQueryKHR, - 4478u32 => Self::RayTraversalPrimitiveCullingKHR, - 4479u32 => Self::RayTracingKHR, - 5008u32 => Self::Float16ImageAMD, - 5009u32 => Self::ImageGatherBiasLodAMD, - 5010u32 => Self::FragmentMaskAMD, - 5013u32 => Self::StencilExportEXT, - 5015u32 => Self::ImageReadWriteLodAMD, - 5016u32 => Self::Int64ImageEXT, - 5055u32 => Self::ShaderClockKHR, - 5249u32 => Self::SampleMaskOverrideCoverageNV, - 5251u32 => Self::GeometryShaderPassthroughNV, - 5254u32 => Self::ShaderViewportIndexLayerEXT, - 5255u32 => Self::ShaderViewportMaskNV, - 5259u32 => Self::ShaderStereoViewNV, - 5260u32 => Self::PerViewAttributesNV, - 5265u32 => Self::FragmentFullyCoveredEXT, - 5266u32 => Self::MeshShadingNV, - 5282u32 => Self::ImageFootprintNV, - 5284u32 => Self::FragmentBarycentricNV, - 5288u32 => Self::ComputeDerivativeGroupQuadsNV, - 5291u32 => Self::FragmentDensityEXT, - 5297u32 => Self::GroupNonUniformPartitionedNV, - 5301u32 => Self::ShaderNonUniform, - 5302u32 => Self::RuntimeDescriptorArray, - 5303u32 => Self::InputAttachmentArrayDynamicIndexing, - 5304u32 => Self::UniformTexelBufferArrayDynamicIndexing, - 5305u32 => Self::StorageTexelBufferArrayDynamicIndexing, - 5306u32 => Self::UniformBufferArrayNonUniformIndexing, - 5307u32 => Self::SampledImageArrayNonUniformIndexing, - 5308u32 => Self::StorageBufferArrayNonUniformIndexing, - 5309u32 => Self::StorageImageArrayNonUniformIndexing, - 5310u32 => Self::InputAttachmentArrayNonUniformIndexing, - 5311u32 => Self::UniformTexelBufferArrayNonUniformIndexing, - 5312u32 => Self::StorageTexelBufferArrayNonUniformIndexing, - 5340u32 => Self::RayTracingNV, - 5345u32 => Self::VulkanMemoryModel, - 5346u32 => Self::VulkanMemoryModelDeviceScope, - 5347u32 => Self::PhysicalStorageBufferAddresses, - 5350u32 => Self::ComputeDerivativeGroupLinearNV, - 5353u32 => Self::RayTracingProvisionalKHR, - 5357u32 => Self::CooperativeMatrixNV, - 5363u32 => Self::FragmentShaderSampleInterlockEXT, - 5372u32 => Self::FragmentShaderShadingRateInterlockEXT, - 5373u32 => Self::ShaderSMBuiltinsNV, - 5378u32 => Self::FragmentShaderPixelInterlockEXT, - 5379u32 => Self::DemoteToHelperInvocationEXT, - 5568u32 => Self::SubgroupShuffleINTEL, - 5569u32 => Self::SubgroupBufferBlockIOINTEL, - 5570u32 => Self::SubgroupImageBlockIOINTEL, - 5579u32 => Self::SubgroupImageMediaBlockIOINTEL, - 5584u32 => Self::IntegerFunctions2INTEL, - 5603u32 => Self::FunctionPointersINTEL, - 5604u32 => Self::IndirectReferencesINTEL, - 5696u32 => Self::SubgroupAvcMotionEstimationINTEL, - 5697u32 => Self::SubgroupAvcMotionEstimationIntraINTEL, - 5698u32 => Self::SubgroupAvcMotionEstimationChromaINTEL, - 5824u32 => Self::FPGAMemoryAttributesINTEL, - 5886u32 => Self::UnstructuredLoopControlsINTEL, - 5888u32 => Self::FPGALoopControlsINTEL, - 5892u32 => Self::KernelAttributesINTEL, - 5897u32 => Self::FPGAKernelAttributesINTEL, - 5945u32 => Self::BlockingPipesINTEL, - 5948u32 => Self::FPGARegINTEL, - 6033u32 => Self::AtomicFloat32AddEXT, - 6034u32 => Self::AtomicFloat64AddEXT, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } + 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; } impl core::str::FromStr for Capability { type Err = (); @@ -2391,9 +2456,21 @@ impl core::str::FromStr for Capability { "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), + "WorkgroupMemoryExplicitLayout8BitAccessKHR" => { + Ok(Self::WorkgroupMemoryExplicitLayout8BitAccessKHR) + } + "WorkgroupMemoryExplicitLayout16BitAccessKHR" => { + Ok(Self::WorkgroupMemoryExplicitLayout16BitAccessKHR) + } "SubgroupVoteKHR" => Ok(Self::SubgroupVoteKHR), "StorageBuffer16BitAccess" => Ok(Self::StorageBuffer16BitAccess), "StorageUniformBufferBlock16" => Ok(Self::StorageBuffer16BitAccess), @@ -2419,6 +2496,9 @@ impl core::str::FromStr for Capability { "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), @@ -2426,6 +2506,7 @@ impl core::str::FromStr for Capability { "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), @@ -2436,7 +2517,9 @@ impl core::str::FromStr for Capability { "FragmentFullyCoveredEXT" => Ok(Self::FragmentFullyCoveredEXT), "MeshShadingNV" => Ok(Self::MeshShadingNV), "ImageFootprintNV" => Ok(Self::ImageFootprintNV), - "FragmentBarycentricNV" => Ok(Self::FragmentBarycentricNV), + "MeshShadingEXT" => Ok(Self::MeshShadingEXT), + "FragmentBarycentricKHR" => Ok(Self::FragmentBarycentricKHR), + "FragmentBarycentricNV" => Ok(Self::FragmentBarycentricKHR), "ComputeDerivativeGroupQuadsNV" => Ok(Self::ComputeDerivativeGroupQuadsNV), "FragmentDensityEXT" => Ok(Self::FragmentDensityEXT), "ShadingRateNV" => Ok(Self::FragmentDensityEXT), @@ -2499,7 +2582,9 @@ impl core::str::FromStr for Capability { "StorageTexelBufferArrayNonUniformIndexingEXT" => { Ok(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), @@ -2515,14 +2600,30 @@ impl core::str::FromStr for Capability { } "ShaderSMBuiltinsNV" => Ok(Self::ShaderSMBuiltinsNV), "FragmentShaderPixelInterlockEXT" => Ok(Self::FragmentShaderPixelInterlockEXT), - "DemoteToHelperInvocationEXT" => Ok(Self::DemoteToHelperInvocationEXT), + "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) @@ -2530,20 +2631,66 @@ impl core::str::FromStr for Capability { "SubgroupAvcMotionEstimationChromaINTEL" => { Ok(Self::SubgroupAvcMotionEstimationChromaINTEL) } + "VariableLengthArrayINTEL" => Ok(Self::VariableLengthArrayINTEL), + "FunctionFloatControlINTEL" => Ok(Self::FunctionFloatControlINTEL), "FPGAMemoryAttributesINTEL" => Ok(Self::FPGAMemoryAttributesINTEL), + "FPFastMathModeINTEL" => Ok(Self::FPFastMathModeINTEL), + "ArbitraryPrecisionIntegersINTEL" => Ok(Self::ArbitraryPrecisionIntegersINTEL), + "ArbitraryPrecisionFloatingPointINTEL" => { + Ok(Self::ArbitraryPrecisionFloatingPointINTEL) + } "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), + "FPGAInvocationPipeliningAttributesINTEL" => { + Ok(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(()), } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -2553,21 +2700,16 @@ pub enum RayQueryIntersection { RayQueryCandidateIntersectionKHR = 0u32, RayQueryCommittedIntersectionKHR = 1u32, } -#[allow(non_upper_case_globals)] -impl RayQueryIntersection {} -impl num_traits::FromPrimitive for RayQueryIntersection { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::RayQueryCandidateIntersectionKHR, - 1u32 => Self::RayQueryCommittedIntersectionKHR, +impl RayQueryIntersection { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl RayQueryIntersection {} impl core::str::FromStr for RayQueryIntersection { type Err = (); fn from_str(s: &str) -> Result { @@ -2578,7 +2720,7 @@ impl core::str::FromStr for RayQueryIntersection { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -2589,22 +2731,18 @@ pub enum RayQueryCommittedIntersectionType { RayQueryCommittedIntersectionTriangleKHR = 1u32, RayQueryCommittedIntersectionGeneratedKHR = 2u32, } -#[allow(non_upper_case_globals)] -impl RayQueryCommittedIntersectionType {} -impl num_traits::FromPrimitive for RayQueryCommittedIntersectionType { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::RayQueryCommittedIntersectionNoneKHR, - 1u32 => Self::RayQueryCommittedIntersectionTriangleKHR, - 2u32 => Self::RayQueryCommittedIntersectionGeneratedKHR, +impl RayQueryCommittedIntersectionType { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { + core::mem::transmute::(n) + }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl RayQueryCommittedIntersectionType {} impl core::str::FromStr for RayQueryCommittedIntersectionType { type Err = (); fn from_str(s: &str) -> Result { @@ -2622,7 +2760,7 @@ impl core::str::FromStr for RayQueryCommittedIntersectionType { } } } -#[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)"] +#[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)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -2632,21 +2770,18 @@ pub enum RayQueryCandidateIntersectionType { RayQueryCandidateIntersectionTriangleKHR = 0u32, RayQueryCandidateIntersectionAABBKHR = 1u32, } -#[allow(non_upper_case_globals)] -impl RayQueryCandidateIntersectionType {} -impl num_traits::FromPrimitive for RayQueryCandidateIntersectionType { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Self::RayQueryCandidateIntersectionTriangleKHR, - 1u32 => Self::RayQueryCandidateIntersectionAABBKHR, +impl RayQueryCandidateIntersectionType { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { + core::mem::transmute::(n) + }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } +#[allow(non_upper_case_globals)] +impl RayQueryCandidateIntersectionType {} impl core::str::FromStr for RayQueryCandidateIntersectionType { type Err = (); fn from_str(s: &str) -> Result { @@ -2661,6 +2796,200 @@ impl core::str::FromStr for RayQueryCandidateIntersectionType { } } } +#[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)"] +#[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 PackedVectorFormat { + PackedVectorFormat4x8Bit = 0u32, +} +impl PackedVectorFormat { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32 => unsafe { core::mem::transmute::(0u32) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl PackedVectorFormat { + pub const PackedVectorFormat4x8BitKHR: Self = Self::PackedVectorFormat4x8Bit; +} +impl core::str::FromStr for PackedVectorFormat { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "PackedVectorFormat4x8Bit" => Ok(Self::PackedVectorFormat4x8Bit), + "PackedVectorFormat4x8BitKHR" => Ok(Self::PackedVectorFormat4x8Bit), + _ => 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 ; } } +#[doc = "SPIR-V operand kind: [CooperativeMatrixLayout](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_layout_a_cooperative_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 CooperativeMatrixLayout { + RowMajorKHR = 0u32, + ColumnMajorKHR = 1u32, +} +impl CooperativeMatrixLayout { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl CooperativeMatrixLayout {} +impl core::str::FromStr for CooperativeMatrixLayout { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "RowMajorKHR" => Ok(Self::RowMajorKHR), + "ColumnMajorKHR" => Ok(Self::ColumnMajorKHR), + _ => 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)"] +#[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 CooperativeMatrixUse { + MatrixAKHR = 0u32, + MatrixBKHR = 1u32, + MatrixAccumulatorKHR = 2u32, +} +impl CooperativeMatrixUse { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl CooperativeMatrixUse {} +impl core::str::FromStr for CooperativeMatrixUse { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "MatrixAKHR" => Ok(Self::MatrixAKHR), + "MatrixBKHR" => Ok(Self::MatrixBKHR), + "MatrixAccumulatorKHR" => Ok(Self::MatrixAccumulatorKHR), + _ => Err(()), + } + } +} +#[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)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum InitializationModeQualifier { + InitOnDeviceReprogramINTEL = 0u32, + InitOnDeviceResetINTEL = 1u32, +} +impl InitializationModeQualifier { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl InitializationModeQualifier {} +impl core::str::FromStr for InitializationModeQualifier { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "InitOnDeviceReprogramINTEL" => Ok(Self::InitOnDeviceReprogramINTEL), + "InitOnDeviceResetINTEL" => Ok(Self::InitOnDeviceResetINTEL), + _ => 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)"] +#[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 LoadCacheControl { + UncachedINTEL = 0u32, + CachedINTEL = 1u32, + StreamingINTEL = 2u32, + InvalidateAfterReadINTEL = 3u32, + ConstCachedINTEL = 4u32, +} +impl LoadCacheControl { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=4u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl LoadCacheControl {} +impl core::str::FromStr for LoadCacheControl { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "UncachedINTEL" => Ok(Self::UncachedINTEL), + "CachedINTEL" => Ok(Self::CachedINTEL), + "StreamingINTEL" => Ok(Self::StreamingINTEL), + "InvalidateAfterReadINTEL" => Ok(Self::InvalidateAfterReadINTEL), + "ConstCachedINTEL" => Ok(Self::ConstCachedINTEL), + _ => 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)"] +#[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 StoreCacheControl { + UncachedINTEL = 0u32, + WriteThroughINTEL = 1u32, + WriteBackINTEL = 2u32, + StreamingINTEL = 3u32, +} +impl StoreCacheControl { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl StoreCacheControl {} +impl core::str::FromStr for StoreCacheControl { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "UncachedINTEL" => Ok(Self::UncachedINTEL), + "WriteThroughINTEL" => Ok(Self::WriteThroughINTEL), + "WriteBackINTEL" => Ok(Self::WriteBackINTEL), + "StreamingINTEL" => Ok(Self::StreamingINTEL), + _ => Err(()), + } + } +} #[doc = "SPIR-V [instructions](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_instructions_a_instructions) opcodes"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -3012,18 +3341,33 @@ pub enum Op { PtrEqual = 401u32, PtrNotEqual = 402u32, PtrDiff = 403u32, + ColorAttachmentReadEXT = 4160u32, + DepthAttachmentReadEXT = 4161u32, + StencilAttachmentReadEXT = 4162u32, TerminateInvocation = 4416u32, SubgroupBallotKHR = 4421u32, SubgroupFirstInvocationKHR = 4422u32, SubgroupAllKHR = 4428u32, SubgroupAnyKHR = 4429u32, SubgroupAllEqualKHR = 4430u32, + GroupNonUniformRotateKHR = 4431u32, SubgroupReadInvocationKHR = 4432u32, TraceRayKHR = 4445u32, ExecuteCallableKHR = 4446u32, ConvertUToAccelerationStructureKHR = 4447u32, IgnoreIntersectionKHR = 4448u32, TerminateRayKHR = 4449u32, + SDot = 4450u32, + UDot = 4451u32, + SUDot = 4452u32, + SDotAccSat = 4453u32, + UDotAccSat = 4454u32, + SUDotAccSat = 4455u32, + TypeCooperativeMatrixKHR = 4456u32, + CooperativeMatrixLoadKHR = 4457u32, + CooperativeMatrixStoreKHR = 4458u32, + CooperativeMatrixMulAddKHR = 4459u32, + CooperativeMatrixLengthKHR = 4460u32, TypeRayQueryKHR = 4472u32, RayQueryInitializeKHR = 4473u32, RayQueryTerminateKHR = 4474u32, @@ -3031,6 +3375,10 @@ pub enum Op { RayQueryConfirmIntersectionKHR = 4476u32, RayQueryProceedKHR = 4477u32, RayQueryGetIntersectionTypeKHR = 4479u32, + ImageSampleWeightedQCOM = 4480u32, + ImageBoxFilterQCOM = 4481u32, + ImageBlockMatchSSDQCOM = 4482u32, + ImageBlockMatchSADQCOM = 4483u32, GroupIAddNonUniformAMD = 5000u32, GroupFAddNonUniformAMD = 5001u32, GroupFMinNonUniformAMD = 5002u32, @@ -3042,14 +3390,57 @@ pub enum Op { FragmentMaskFetchAMD = 5011u32, FragmentFetchAMD = 5012u32, ReadClockKHR = 5056u32, + FinalizeNodePayloadsAMDX = 5075u32, + FinishWritingNodePayloadAMDX = 5078u32, + InitializeNodePayloadsAMDX = 5090u32, + HitObjectRecordHitMotionNV = 5249u32, + HitObjectRecordHitWithIndexMotionNV = 5250u32, + HitObjectRecordMissMotionNV = 5251u32, + HitObjectGetWorldToObjectNV = 5252u32, + HitObjectGetObjectToWorldNV = 5253u32, + HitObjectGetObjectRayDirectionNV = 5254u32, + HitObjectGetObjectRayOriginNV = 5255u32, + HitObjectTraceRayMotionNV = 5256u32, + HitObjectGetShaderRecordBufferHandleNV = 5257u32, + HitObjectGetShaderBindingTableRecordIndexNV = 5258u32, + HitObjectRecordEmptyNV = 5259u32, + HitObjectTraceRayNV = 5260u32, + HitObjectRecordHitNV = 5261u32, + HitObjectRecordHitWithIndexNV = 5262u32, + HitObjectRecordMissNV = 5263u32, + HitObjectExecuteShaderNV = 5264u32, + HitObjectGetCurrentTimeNV = 5265u32, + HitObjectGetAttributesNV = 5266u32, + HitObjectGetHitKindNV = 5267u32, + HitObjectGetPrimitiveIndexNV = 5268u32, + HitObjectGetGeometryIndexNV = 5269u32, + HitObjectGetInstanceIdNV = 5270u32, + HitObjectGetInstanceCustomIndexNV = 5271u32, + HitObjectGetWorldRayDirectionNV = 5272u32, + HitObjectGetWorldRayOriginNV = 5273u32, + HitObjectGetRayTMaxNV = 5274u32, + HitObjectGetRayTMinNV = 5275u32, + HitObjectIsEmptyNV = 5276u32, + HitObjectIsHitNV = 5277u32, + HitObjectIsMissNV = 5278u32, + ReorderThreadWithHitObjectNV = 5279u32, + ReorderThreadWithHintNV = 5280u32, + TypeHitObjectNV = 5281u32, ImageSampleFootprintNV = 5283u32, + EmitMeshTasksEXT = 5294u32, + SetMeshOutputsEXT = 5295u32, GroupNonUniformPartitionNV = 5296u32, WritePackedPrimitiveIndices4x8NV = 5299u32, - ReportIntersectionNV = 5334u32, + FetchMicroTriangleVertexPositionNV = 5300u32, + FetchMicroTriangleVertexBarycentricNV = 5301u32, + ReportIntersectionKHR = 5334u32, IgnoreIntersectionNV = 5335u32, TerminateRayNV = 5336u32, TraceNV = 5337u32, - TypeAccelerationStructureNV = 5341u32, + TraceMotionNV = 5338u32, + TraceRayMotionNV = 5339u32, + RayQueryGetIntersectionTriangleVertexPositionsKHR = 5340u32, + TypeAccelerationStructureKHR = 5341u32, ExecuteCallableNV = 5344u32, TypeCooperativeMatrixNV = 5358u32, CooperativeMatrixLoadNV = 5359u32, @@ -3058,8 +3449,15 @@ pub enum Op { CooperativeMatrixLengthNV = 5362u32, BeginInvocationInterlockEXT = 5364u32, EndInvocationInterlockEXT = 5365u32, - DemoteToHelperInvocationEXT = 5380u32, + DemoteToHelperInvocation = 5380u32, IsHelperInvocationEXT = 5381u32, + ConvertUToImageNV = 5391u32, + ConvertUToSamplerNV = 5392u32, + ConvertImageToUNV = 5393u32, + ConvertSamplerToUNV = 5394u32, + ConvertUToSampledImageNV = 5395u32, + ConvertSampledImageToUNV = 5396u32, + SamplerImageAddressingModeNV = 5397u32, SubgroupShuffleINTEL = 5571u32, SubgroupShuffleDownINTEL = 5572u32, SubgroupShuffleUpINTEL = 5573u32, @@ -3084,8 +3482,15 @@ pub enum Op { USubSatINTEL = 5596u32, IMul32x16INTEL = 5597u32, UMul32x16INTEL = 5598u32, - FunctionPointerINTEL = 5600u32, + ConstantFunctionPointerINTEL = 5600u32, FunctionPointerCallINTEL = 5601u32, + AsmTargetINTEL = 5609u32, + AsmINTEL = 5610u32, + AsmCallINTEL = 5611u32, + AtomicFMinEXT = 5614u32, + AtomicFMaxEXT = 5615u32, + AssumeTrueKHR = 5630u32, + ExpectKHR = 5631u32, DecorateString = 5632u32, MemberDecorateString = 5633u32, VmeImageINTEL = 5699u32, @@ -3206,7 +3611,67 @@ pub enum Op { SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814u32, SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815u32, SubgroupAvcSicGetInterRawSadsINTEL = 5816u32, + VariableLengthArrayINTEL = 5818u32, + SaveMemoryINTEL = 5819u32, + RestoreMemoryINTEL = 5820u32, + ArbitraryFloatSinCosPiINTEL = 5840u32, + ArbitraryFloatCastINTEL = 5841u32, + ArbitraryFloatCastFromIntINTEL = 5842u32, + ArbitraryFloatCastToIntINTEL = 5843u32, + ArbitraryFloatAddINTEL = 5846u32, + ArbitraryFloatSubINTEL = 5847u32, + ArbitraryFloatMulINTEL = 5848u32, + ArbitraryFloatDivINTEL = 5849u32, + ArbitraryFloatGTINTEL = 5850u32, + ArbitraryFloatGEINTEL = 5851u32, + ArbitraryFloatLTINTEL = 5852u32, + ArbitraryFloatLEINTEL = 5853u32, + ArbitraryFloatEQINTEL = 5854u32, + ArbitraryFloatRecipINTEL = 5855u32, + ArbitraryFloatRSqrtINTEL = 5856u32, + ArbitraryFloatCbrtINTEL = 5857u32, + ArbitraryFloatHypotINTEL = 5858u32, + ArbitraryFloatSqrtINTEL = 5859u32, + ArbitraryFloatLogINTEL = 5860u32, + ArbitraryFloatLog2INTEL = 5861u32, + ArbitraryFloatLog10INTEL = 5862u32, + ArbitraryFloatLog1pINTEL = 5863u32, + ArbitraryFloatExpINTEL = 5864u32, + ArbitraryFloatExp2INTEL = 5865u32, + ArbitraryFloatExp10INTEL = 5866u32, + ArbitraryFloatExpm1INTEL = 5867u32, + ArbitraryFloatSinINTEL = 5868u32, + ArbitraryFloatCosINTEL = 5869u32, + ArbitraryFloatSinCosINTEL = 5870u32, + ArbitraryFloatSinPiINTEL = 5871u32, + ArbitraryFloatCosPiINTEL = 5872u32, + ArbitraryFloatASinINTEL = 5873u32, + ArbitraryFloatASinPiINTEL = 5874u32, + ArbitraryFloatACosINTEL = 5875u32, + ArbitraryFloatACosPiINTEL = 5876u32, + ArbitraryFloatATanINTEL = 5877u32, + ArbitraryFloatATanPiINTEL = 5878u32, + ArbitraryFloatATan2INTEL = 5879u32, + ArbitraryFloatPowINTEL = 5880u32, + ArbitraryFloatPowRINTEL = 5881u32, + ArbitraryFloatPowNINTEL = 5882u32, LoopControlINTEL = 5887u32, + AliasDomainDeclINTEL = 5911u32, + AliasScopeDeclINTEL = 5912u32, + AliasScopeListDeclINTEL = 5913u32, + FixedSqrtINTEL = 5923u32, + FixedRecipINTEL = 5924u32, + FixedRsqrtINTEL = 5925u32, + FixedSinINTEL = 5926u32, + FixedCosINTEL = 5927u32, + FixedSinCosINTEL = 5928u32, + FixedSinPiINTEL = 5929u32, + FixedCosPiINTEL = 5930u32, + FixedSinCosPiINTEL = 5931u32, + FixedLogINTEL = 5932u32, + FixedExpINTEL = 5933u32, + PtrCastToCrossWorkgroupINTEL = 5934u32, + CrossWorkgroupCastToPtrINTEL = 5938u32, ReadPipeBlockingINTEL = 5946u32, WritePipeBlockingINTEL = 5947u32, FPGARegINTEL = 5949u32, @@ -3228,586 +3693,115 @@ pub enum Op { RayQueryGetIntersectionObjectToWorldKHR = 6031u32, RayQueryGetIntersectionWorldToObjectKHR = 6032u32, AtomicFAddEXT = 6035u32, + TypeBufferSurfaceINTEL = 6086u32, + TypeStructContinuedINTEL = 6090u32, + ConstantCompositeContinuedINTEL = 6091u32, + SpecConstantCompositeContinuedINTEL = 6092u32, + ConvertFToBF16INTEL = 6116u32, + ConvertBF16ToFINTEL = 6117u32, + ControlBarrierArriveINTEL = 6142u32, + ControlBarrierWaitINTEL = 6143u32, + GroupIMulKHR = 6401u32, + GroupFMulKHR = 6402u32, + GroupBitwiseAndKHR = 6403u32, + GroupBitwiseOrKHR = 6404u32, + GroupBitwiseXorKHR = 6405u32, + GroupLogicalAndKHR = 6406u32, + GroupLogicalOrKHR = 6407u32, + GroupLogicalXorKHR = 6408u32, +} +impl Op { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=8u32 => unsafe { core::mem::transmute::(n) }, + 10u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 14u32..=17u32 => unsafe { core::mem::transmute::(n) }, + 19u32..=39u32 => unsafe { core::mem::transmute::(n) }, + 41u32..=46u32 => unsafe { core::mem::transmute::(n) }, + 48u32..=52u32 => unsafe { core::mem::transmute::(n) }, + 54u32..=57u32 => unsafe { core::mem::transmute::(n) }, + 59u32..=75u32 => unsafe { core::mem::transmute::(n) }, + 77u32..=84u32 => unsafe { core::mem::transmute::(n) }, + 86u32..=107u32 => unsafe { core::mem::transmute::(n) }, + 109u32..=124u32 => unsafe { core::mem::transmute::(n) }, + 126u32..=152u32 => unsafe { core::mem::transmute::(n) }, + 154u32..=191u32 => unsafe { core::mem::transmute::(n) }, + 194u32..=205u32 => unsafe { core::mem::transmute::(n) }, + 207u32..=215u32 => unsafe { core::mem::transmute::(n) }, + 218u32..=221u32 => unsafe { core::mem::transmute::(n) }, + 224u32..=225u32 => unsafe { core::mem::transmute::(n) }, + 227u32..=242u32 => unsafe { core::mem::transmute::(n) }, + 245u32..=257u32 => unsafe { core::mem::transmute::(n) }, + 259u32..=271u32 => unsafe { core::mem::transmute::(n) }, + 274u32..=288u32 => unsafe { core::mem::transmute::(n) }, + 291u32..=366u32 => unsafe { core::mem::transmute::(n) }, + 400u32..=403u32 => unsafe { core::mem::transmute::(n) }, + 4160u32..=4162u32 => unsafe { core::mem::transmute::(n) }, + 4416u32 => unsafe { core::mem::transmute::(4416u32) }, + 4421u32..=4422u32 => unsafe { core::mem::transmute::(n) }, + 4428u32..=4432u32 => unsafe { core::mem::transmute::(n) }, + 4445u32..=4460u32 => unsafe { core::mem::transmute::(n) }, + 4472u32..=4477u32 => unsafe { core::mem::transmute::(n) }, + 4479u32..=4483u32 => unsafe { core::mem::transmute::(n) }, + 5000u32..=5007u32 => unsafe { core::mem::transmute::(n) }, + 5011u32..=5012u32 => unsafe { core::mem::transmute::(n) }, + 5056u32 => unsafe { core::mem::transmute::(5056u32) }, + 5075u32 => unsafe { core::mem::transmute::(5075u32) }, + 5078u32 => unsafe { core::mem::transmute::(5078u32) }, + 5090u32 => unsafe { core::mem::transmute::(5090u32) }, + 5249u32..=5281u32 => unsafe { core::mem::transmute::(n) }, + 5283u32 => unsafe { core::mem::transmute::(5283u32) }, + 5294u32..=5296u32 => unsafe { core::mem::transmute::(n) }, + 5299u32..=5301u32 => unsafe { core::mem::transmute::(n) }, + 5334u32..=5341u32 => unsafe { core::mem::transmute::(n) }, + 5344u32 => unsafe { core::mem::transmute::(5344u32) }, + 5358u32..=5362u32 => unsafe { core::mem::transmute::(n) }, + 5364u32..=5365u32 => unsafe { core::mem::transmute::(n) }, + 5380u32..=5381u32 => unsafe { core::mem::transmute::(n) }, + 5391u32..=5397u32 => unsafe { core::mem::transmute::(n) }, + 5571u32..=5578u32 => unsafe { core::mem::transmute::(n) }, + 5580u32..=5581u32 => unsafe { core::mem::transmute::(n) }, + 5585u32..=5598u32 => unsafe { core::mem::transmute::(n) }, + 5600u32..=5601u32 => unsafe { core::mem::transmute::(n) }, + 5609u32..=5611u32 => unsafe { core::mem::transmute::(n) }, + 5614u32..=5615u32 => unsafe { core::mem::transmute::(n) }, + 5630u32..=5633u32 => unsafe { core::mem::transmute::(n) }, + 5699u32..=5816u32 => unsafe { core::mem::transmute::(n) }, + 5818u32..=5820u32 => unsafe { core::mem::transmute::(n) }, + 5840u32..=5843u32 => unsafe { core::mem::transmute::(n) }, + 5846u32..=5882u32 => unsafe { core::mem::transmute::(n) }, + 5887u32 => unsafe { core::mem::transmute::(5887u32) }, + 5911u32..=5913u32 => unsafe { core::mem::transmute::(n) }, + 5923u32..=5934u32 => unsafe { core::mem::transmute::(n) }, + 5938u32 => unsafe { core::mem::transmute::(5938u32) }, + 5946u32..=5947u32 => unsafe { core::mem::transmute::(n) }, + 5949u32 => unsafe { core::mem::transmute::(5949u32) }, + 6016u32..=6032u32 => unsafe { core::mem::transmute::(n) }, + 6035u32 => unsafe { core::mem::transmute::(6035u32) }, + 6086u32 => unsafe { core::mem::transmute::(6086u32) }, + 6090u32..=6092u32 => unsafe { core::mem::transmute::(n) }, + 6116u32..=6117u32 => unsafe { core::mem::transmute::(n) }, + 6142u32..=6143u32 => unsafe { core::mem::transmute::(n) }, + 6401u32..=6408u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } } #[allow(clippy::upper_case_acronyms)] #[allow(non_upper_case_globals)] impl Op { - pub const ReportIntersectionKHR: Op = Op::ReportIntersectionNV; - pub const TypeAccelerationStructureKHR: Op = Op::TypeAccelerationStructureNV; + pub const SDotKHR: Op = Op::SDot; + pub const UDotKHR: Op = Op::UDot; + pub const SUDotKHR: Op = Op::SUDot; + pub const SDotAccSatKHR: Op = Op::SDotAccSat; + pub const UDotAccSatKHR: Op = Op::UDotAccSat; + pub const SUDotAccSatKHR: Op = Op::SUDotAccSat; + pub const ReportIntersectionNV: Op = Op::ReportIntersectionKHR; + pub const TypeAccelerationStructureNV: Op = Op::TypeAccelerationStructureKHR; + pub const DemoteToHelperInvocationEXT: Op = Op::DemoteToHelperInvocation; pub const DecorateStringGOOGLE: Op = Op::DecorateString; pub const MemberDecorateStringGOOGLE: Op = Op::MemberDecorateString; } -impl num_traits::FromPrimitive for Op { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => Op::Nop, - 1u32 => Op::Undef, - 2u32 => Op::SourceContinued, - 3u32 => Op::Source, - 4u32 => Op::SourceExtension, - 5u32 => Op::Name, - 6u32 => Op::MemberName, - 7u32 => Op::String, - 8u32 => Op::Line, - 10u32 => Op::Extension, - 11u32 => Op::ExtInstImport, - 12u32 => Op::ExtInst, - 14u32 => Op::MemoryModel, - 15u32 => Op::EntryPoint, - 16u32 => Op::ExecutionMode, - 17u32 => Op::Capability, - 19u32 => Op::TypeVoid, - 20u32 => Op::TypeBool, - 21u32 => Op::TypeInt, - 22u32 => Op::TypeFloat, - 23u32 => Op::TypeVector, - 24u32 => Op::TypeMatrix, - 25u32 => Op::TypeImage, - 26u32 => Op::TypeSampler, - 27u32 => Op::TypeSampledImage, - 28u32 => Op::TypeArray, - 29u32 => Op::TypeRuntimeArray, - 30u32 => Op::TypeStruct, - 31u32 => Op::TypeOpaque, - 32u32 => Op::TypePointer, - 33u32 => Op::TypeFunction, - 34u32 => Op::TypeEvent, - 35u32 => Op::TypeDeviceEvent, - 36u32 => Op::TypeReserveId, - 37u32 => Op::TypeQueue, - 38u32 => Op::TypePipe, - 39u32 => Op::TypeForwardPointer, - 41u32 => Op::ConstantTrue, - 42u32 => Op::ConstantFalse, - 43u32 => Op::Constant, - 44u32 => Op::ConstantComposite, - 45u32 => Op::ConstantSampler, - 46u32 => Op::ConstantNull, - 48u32 => Op::SpecConstantTrue, - 49u32 => Op::SpecConstantFalse, - 50u32 => Op::SpecConstant, - 51u32 => Op::SpecConstantComposite, - 52u32 => Op::SpecConstantOp, - 54u32 => Op::Function, - 55u32 => Op::FunctionParameter, - 56u32 => Op::FunctionEnd, - 57u32 => Op::FunctionCall, - 59u32 => Op::Variable, - 60u32 => Op::ImageTexelPointer, - 61u32 => Op::Load, - 62u32 => Op::Store, - 63u32 => Op::CopyMemory, - 64u32 => Op::CopyMemorySized, - 65u32 => Op::AccessChain, - 66u32 => Op::InBoundsAccessChain, - 67u32 => Op::PtrAccessChain, - 68u32 => Op::ArrayLength, - 69u32 => Op::GenericPtrMemSemantics, - 70u32 => Op::InBoundsPtrAccessChain, - 71u32 => Op::Decorate, - 72u32 => Op::MemberDecorate, - 73u32 => Op::DecorationGroup, - 74u32 => Op::GroupDecorate, - 75u32 => Op::GroupMemberDecorate, - 77u32 => Op::VectorExtractDynamic, - 78u32 => Op::VectorInsertDynamic, - 79u32 => Op::VectorShuffle, - 80u32 => Op::CompositeConstruct, - 81u32 => Op::CompositeExtract, - 82u32 => Op::CompositeInsert, - 83u32 => Op::CopyObject, - 84u32 => Op::Transpose, - 86u32 => Op::SampledImage, - 87u32 => Op::ImageSampleImplicitLod, - 88u32 => Op::ImageSampleExplicitLod, - 89u32 => Op::ImageSampleDrefImplicitLod, - 90u32 => Op::ImageSampleDrefExplicitLod, - 91u32 => Op::ImageSampleProjImplicitLod, - 92u32 => Op::ImageSampleProjExplicitLod, - 93u32 => Op::ImageSampleProjDrefImplicitLod, - 94u32 => Op::ImageSampleProjDrefExplicitLod, - 95u32 => Op::ImageFetch, - 96u32 => Op::ImageGather, - 97u32 => Op::ImageDrefGather, - 98u32 => Op::ImageRead, - 99u32 => Op::ImageWrite, - 100u32 => Op::Image, - 101u32 => Op::ImageQueryFormat, - 102u32 => Op::ImageQueryOrder, - 103u32 => Op::ImageQuerySizeLod, - 104u32 => Op::ImageQuerySize, - 105u32 => Op::ImageQueryLod, - 106u32 => Op::ImageQueryLevels, - 107u32 => Op::ImageQuerySamples, - 109u32 => Op::ConvertFToU, - 110u32 => Op::ConvertFToS, - 111u32 => Op::ConvertSToF, - 112u32 => Op::ConvertUToF, - 113u32 => Op::UConvert, - 114u32 => Op::SConvert, - 115u32 => Op::FConvert, - 116u32 => Op::QuantizeToF16, - 117u32 => Op::ConvertPtrToU, - 118u32 => Op::SatConvertSToU, - 119u32 => Op::SatConvertUToS, - 120u32 => Op::ConvertUToPtr, - 121u32 => Op::PtrCastToGeneric, - 122u32 => Op::GenericCastToPtr, - 123u32 => Op::GenericCastToPtrExplicit, - 124u32 => Op::Bitcast, - 126u32 => Op::SNegate, - 127u32 => Op::FNegate, - 128u32 => Op::IAdd, - 129u32 => Op::FAdd, - 130u32 => Op::ISub, - 131u32 => Op::FSub, - 132u32 => Op::IMul, - 133u32 => Op::FMul, - 134u32 => Op::UDiv, - 135u32 => Op::SDiv, - 136u32 => Op::FDiv, - 137u32 => Op::UMod, - 138u32 => Op::SRem, - 139u32 => Op::SMod, - 140u32 => Op::FRem, - 141u32 => Op::FMod, - 142u32 => Op::VectorTimesScalar, - 143u32 => Op::MatrixTimesScalar, - 144u32 => Op::VectorTimesMatrix, - 145u32 => Op::MatrixTimesVector, - 146u32 => Op::MatrixTimesMatrix, - 147u32 => Op::OuterProduct, - 148u32 => Op::Dot, - 149u32 => Op::IAddCarry, - 150u32 => Op::ISubBorrow, - 151u32 => Op::UMulExtended, - 152u32 => Op::SMulExtended, - 154u32 => Op::Any, - 155u32 => Op::All, - 156u32 => Op::IsNan, - 157u32 => Op::IsInf, - 158u32 => Op::IsFinite, - 159u32 => Op::IsNormal, - 160u32 => Op::SignBitSet, - 161u32 => Op::LessOrGreater, - 162u32 => Op::Ordered, - 163u32 => Op::Unordered, - 164u32 => Op::LogicalEqual, - 165u32 => Op::LogicalNotEqual, - 166u32 => Op::LogicalOr, - 167u32 => Op::LogicalAnd, - 168u32 => Op::LogicalNot, - 169u32 => Op::Select, - 170u32 => Op::IEqual, - 171u32 => Op::INotEqual, - 172u32 => Op::UGreaterThan, - 173u32 => Op::SGreaterThan, - 174u32 => Op::UGreaterThanEqual, - 175u32 => Op::SGreaterThanEqual, - 176u32 => Op::ULessThan, - 177u32 => Op::SLessThan, - 178u32 => Op::ULessThanEqual, - 179u32 => Op::SLessThanEqual, - 180u32 => Op::FOrdEqual, - 181u32 => Op::FUnordEqual, - 182u32 => Op::FOrdNotEqual, - 183u32 => Op::FUnordNotEqual, - 184u32 => Op::FOrdLessThan, - 185u32 => Op::FUnordLessThan, - 186u32 => Op::FOrdGreaterThan, - 187u32 => Op::FUnordGreaterThan, - 188u32 => Op::FOrdLessThanEqual, - 189u32 => Op::FUnordLessThanEqual, - 190u32 => Op::FOrdGreaterThanEqual, - 191u32 => Op::FUnordGreaterThanEqual, - 194u32 => Op::ShiftRightLogical, - 195u32 => Op::ShiftRightArithmetic, - 196u32 => Op::ShiftLeftLogical, - 197u32 => Op::BitwiseOr, - 198u32 => Op::BitwiseXor, - 199u32 => Op::BitwiseAnd, - 200u32 => Op::Not, - 201u32 => Op::BitFieldInsert, - 202u32 => Op::BitFieldSExtract, - 203u32 => Op::BitFieldUExtract, - 204u32 => Op::BitReverse, - 205u32 => Op::BitCount, - 207u32 => Op::DPdx, - 208u32 => Op::DPdy, - 209u32 => Op::Fwidth, - 210u32 => Op::DPdxFine, - 211u32 => Op::DPdyFine, - 212u32 => Op::FwidthFine, - 213u32 => Op::DPdxCoarse, - 214u32 => Op::DPdyCoarse, - 215u32 => Op::FwidthCoarse, - 218u32 => Op::EmitVertex, - 219u32 => Op::EndPrimitive, - 220u32 => Op::EmitStreamVertex, - 221u32 => Op::EndStreamPrimitive, - 224u32 => Op::ControlBarrier, - 225u32 => Op::MemoryBarrier, - 227u32 => Op::AtomicLoad, - 228u32 => Op::AtomicStore, - 229u32 => Op::AtomicExchange, - 230u32 => Op::AtomicCompareExchange, - 231u32 => Op::AtomicCompareExchangeWeak, - 232u32 => Op::AtomicIIncrement, - 233u32 => Op::AtomicIDecrement, - 234u32 => Op::AtomicIAdd, - 235u32 => Op::AtomicISub, - 236u32 => Op::AtomicSMin, - 237u32 => Op::AtomicUMin, - 238u32 => Op::AtomicSMax, - 239u32 => Op::AtomicUMax, - 240u32 => Op::AtomicAnd, - 241u32 => Op::AtomicOr, - 242u32 => Op::AtomicXor, - 245u32 => Op::Phi, - 246u32 => Op::LoopMerge, - 247u32 => Op::SelectionMerge, - 248u32 => Op::Label, - 249u32 => Op::Branch, - 250u32 => Op::BranchConditional, - 251u32 => Op::Switch, - 252u32 => Op::Kill, - 253u32 => Op::Return, - 254u32 => Op::ReturnValue, - 255u32 => Op::Unreachable, - 256u32 => Op::LifetimeStart, - 257u32 => Op::LifetimeStop, - 259u32 => Op::GroupAsyncCopy, - 260u32 => Op::GroupWaitEvents, - 261u32 => Op::GroupAll, - 262u32 => Op::GroupAny, - 263u32 => Op::GroupBroadcast, - 264u32 => Op::GroupIAdd, - 265u32 => Op::GroupFAdd, - 266u32 => Op::GroupFMin, - 267u32 => Op::GroupUMin, - 268u32 => Op::GroupSMin, - 269u32 => Op::GroupFMax, - 270u32 => Op::GroupUMax, - 271u32 => Op::GroupSMax, - 274u32 => Op::ReadPipe, - 275u32 => Op::WritePipe, - 276u32 => Op::ReservedReadPipe, - 277u32 => Op::ReservedWritePipe, - 278u32 => Op::ReserveReadPipePackets, - 279u32 => Op::ReserveWritePipePackets, - 280u32 => Op::CommitReadPipe, - 281u32 => Op::CommitWritePipe, - 282u32 => Op::IsValidReserveId, - 283u32 => Op::GetNumPipePackets, - 284u32 => Op::GetMaxPipePackets, - 285u32 => Op::GroupReserveReadPipePackets, - 286u32 => Op::GroupReserveWritePipePackets, - 287u32 => Op::GroupCommitReadPipe, - 288u32 => Op::GroupCommitWritePipe, - 291u32 => Op::EnqueueMarker, - 292u32 => Op::EnqueueKernel, - 293u32 => Op::GetKernelNDrangeSubGroupCount, - 294u32 => Op::GetKernelNDrangeMaxSubGroupSize, - 295u32 => Op::GetKernelWorkGroupSize, - 296u32 => Op::GetKernelPreferredWorkGroupSizeMultiple, - 297u32 => Op::RetainEvent, - 298u32 => Op::ReleaseEvent, - 299u32 => Op::CreateUserEvent, - 300u32 => Op::IsValidEvent, - 301u32 => Op::SetUserEventStatus, - 302u32 => Op::CaptureEventProfilingInfo, - 303u32 => Op::GetDefaultQueue, - 304u32 => Op::BuildNDRange, - 305u32 => Op::ImageSparseSampleImplicitLod, - 306u32 => Op::ImageSparseSampleExplicitLod, - 307u32 => Op::ImageSparseSampleDrefImplicitLod, - 308u32 => Op::ImageSparseSampleDrefExplicitLod, - 309u32 => Op::ImageSparseSampleProjImplicitLod, - 310u32 => Op::ImageSparseSampleProjExplicitLod, - 311u32 => Op::ImageSparseSampleProjDrefImplicitLod, - 312u32 => Op::ImageSparseSampleProjDrefExplicitLod, - 313u32 => Op::ImageSparseFetch, - 314u32 => Op::ImageSparseGather, - 315u32 => Op::ImageSparseDrefGather, - 316u32 => Op::ImageSparseTexelsResident, - 317u32 => Op::NoLine, - 318u32 => Op::AtomicFlagTestAndSet, - 319u32 => Op::AtomicFlagClear, - 320u32 => Op::ImageSparseRead, - 321u32 => Op::SizeOf, - 322u32 => Op::TypePipeStorage, - 323u32 => Op::ConstantPipeStorage, - 324u32 => Op::CreatePipeFromPipeStorage, - 325u32 => Op::GetKernelLocalSizeForSubgroupCount, - 326u32 => Op::GetKernelMaxNumSubgroups, - 327u32 => Op::TypeNamedBarrier, - 328u32 => Op::NamedBarrierInitialize, - 329u32 => Op::MemoryNamedBarrier, - 330u32 => Op::ModuleProcessed, - 331u32 => Op::ExecutionModeId, - 332u32 => Op::DecorateId, - 333u32 => Op::GroupNonUniformElect, - 334u32 => Op::GroupNonUniformAll, - 335u32 => Op::GroupNonUniformAny, - 336u32 => Op::GroupNonUniformAllEqual, - 337u32 => Op::GroupNonUniformBroadcast, - 338u32 => Op::GroupNonUniformBroadcastFirst, - 339u32 => Op::GroupNonUniformBallot, - 340u32 => Op::GroupNonUniformInverseBallot, - 341u32 => Op::GroupNonUniformBallotBitExtract, - 342u32 => Op::GroupNonUniformBallotBitCount, - 343u32 => Op::GroupNonUniformBallotFindLSB, - 344u32 => Op::GroupNonUniformBallotFindMSB, - 345u32 => Op::GroupNonUniformShuffle, - 346u32 => Op::GroupNonUniformShuffleXor, - 347u32 => Op::GroupNonUniformShuffleUp, - 348u32 => Op::GroupNonUniformShuffleDown, - 349u32 => Op::GroupNonUniformIAdd, - 350u32 => Op::GroupNonUniformFAdd, - 351u32 => Op::GroupNonUniformIMul, - 352u32 => Op::GroupNonUniformFMul, - 353u32 => Op::GroupNonUniformSMin, - 354u32 => Op::GroupNonUniformUMin, - 355u32 => Op::GroupNonUniformFMin, - 356u32 => Op::GroupNonUniformSMax, - 357u32 => Op::GroupNonUniformUMax, - 358u32 => Op::GroupNonUniformFMax, - 359u32 => Op::GroupNonUniformBitwiseAnd, - 360u32 => Op::GroupNonUniformBitwiseOr, - 361u32 => Op::GroupNonUniformBitwiseXor, - 362u32 => Op::GroupNonUniformLogicalAnd, - 363u32 => Op::GroupNonUniformLogicalOr, - 364u32 => Op::GroupNonUniformLogicalXor, - 365u32 => Op::GroupNonUniformQuadBroadcast, - 366u32 => Op::GroupNonUniformQuadSwap, - 400u32 => Op::CopyLogical, - 401u32 => Op::PtrEqual, - 402u32 => Op::PtrNotEqual, - 403u32 => Op::PtrDiff, - 4416u32 => Op::TerminateInvocation, - 4421u32 => Op::SubgroupBallotKHR, - 4422u32 => Op::SubgroupFirstInvocationKHR, - 4428u32 => Op::SubgroupAllKHR, - 4429u32 => Op::SubgroupAnyKHR, - 4430u32 => Op::SubgroupAllEqualKHR, - 4432u32 => Op::SubgroupReadInvocationKHR, - 4445u32 => Op::TraceRayKHR, - 4446u32 => Op::ExecuteCallableKHR, - 4447u32 => Op::ConvertUToAccelerationStructureKHR, - 4448u32 => Op::IgnoreIntersectionKHR, - 4449u32 => Op::TerminateRayKHR, - 4472u32 => Op::TypeRayQueryKHR, - 4473u32 => Op::RayQueryInitializeKHR, - 4474u32 => Op::RayQueryTerminateKHR, - 4475u32 => Op::RayQueryGenerateIntersectionKHR, - 4476u32 => Op::RayQueryConfirmIntersectionKHR, - 4477u32 => Op::RayQueryProceedKHR, - 4479u32 => Op::RayQueryGetIntersectionTypeKHR, - 5000u32 => Op::GroupIAddNonUniformAMD, - 5001u32 => Op::GroupFAddNonUniformAMD, - 5002u32 => Op::GroupFMinNonUniformAMD, - 5003u32 => Op::GroupUMinNonUniformAMD, - 5004u32 => Op::GroupSMinNonUniformAMD, - 5005u32 => Op::GroupFMaxNonUniformAMD, - 5006u32 => Op::GroupUMaxNonUniformAMD, - 5007u32 => Op::GroupSMaxNonUniformAMD, - 5011u32 => Op::FragmentMaskFetchAMD, - 5012u32 => Op::FragmentFetchAMD, - 5056u32 => Op::ReadClockKHR, - 5283u32 => Op::ImageSampleFootprintNV, - 5296u32 => Op::GroupNonUniformPartitionNV, - 5299u32 => Op::WritePackedPrimitiveIndices4x8NV, - 5334u32 => Op::ReportIntersectionNV, - 5335u32 => Op::IgnoreIntersectionNV, - 5336u32 => Op::TerminateRayNV, - 5337u32 => Op::TraceNV, - 5341u32 => Op::TypeAccelerationStructureNV, - 5344u32 => Op::ExecuteCallableNV, - 5358u32 => Op::TypeCooperativeMatrixNV, - 5359u32 => Op::CooperativeMatrixLoadNV, - 5360u32 => Op::CooperativeMatrixStoreNV, - 5361u32 => Op::CooperativeMatrixMulAddNV, - 5362u32 => Op::CooperativeMatrixLengthNV, - 5364u32 => Op::BeginInvocationInterlockEXT, - 5365u32 => Op::EndInvocationInterlockEXT, - 5380u32 => Op::DemoteToHelperInvocationEXT, - 5381u32 => Op::IsHelperInvocationEXT, - 5571u32 => Op::SubgroupShuffleINTEL, - 5572u32 => Op::SubgroupShuffleDownINTEL, - 5573u32 => Op::SubgroupShuffleUpINTEL, - 5574u32 => Op::SubgroupShuffleXorINTEL, - 5575u32 => Op::SubgroupBlockReadINTEL, - 5576u32 => Op::SubgroupBlockWriteINTEL, - 5577u32 => Op::SubgroupImageBlockReadINTEL, - 5578u32 => Op::SubgroupImageBlockWriteINTEL, - 5580u32 => Op::SubgroupImageMediaBlockReadINTEL, - 5581u32 => Op::SubgroupImageMediaBlockWriteINTEL, - 5585u32 => Op::UCountLeadingZerosINTEL, - 5586u32 => Op::UCountTrailingZerosINTEL, - 5587u32 => Op::AbsISubINTEL, - 5588u32 => Op::AbsUSubINTEL, - 5589u32 => Op::IAddSatINTEL, - 5590u32 => Op::UAddSatINTEL, - 5591u32 => Op::IAverageINTEL, - 5592u32 => Op::UAverageINTEL, - 5593u32 => Op::IAverageRoundedINTEL, - 5594u32 => Op::UAverageRoundedINTEL, - 5595u32 => Op::ISubSatINTEL, - 5596u32 => Op::USubSatINTEL, - 5597u32 => Op::IMul32x16INTEL, - 5598u32 => Op::UMul32x16INTEL, - 5600u32 => Op::FunctionPointerINTEL, - 5601u32 => Op::FunctionPointerCallINTEL, - 5632u32 => Op::DecorateString, - 5633u32 => Op::MemberDecorateString, - 5699u32 => Op::VmeImageINTEL, - 5700u32 => Op::TypeVmeImageINTEL, - 5701u32 => Op::TypeAvcImePayloadINTEL, - 5702u32 => Op::TypeAvcRefPayloadINTEL, - 5703u32 => Op::TypeAvcSicPayloadINTEL, - 5704u32 => Op::TypeAvcMcePayloadINTEL, - 5705u32 => Op::TypeAvcMceResultINTEL, - 5706u32 => Op::TypeAvcImeResultINTEL, - 5707u32 => Op::TypeAvcImeResultSingleReferenceStreamoutINTEL, - 5708u32 => Op::TypeAvcImeResultDualReferenceStreamoutINTEL, - 5709u32 => Op::TypeAvcImeSingleReferenceStreaminINTEL, - 5710u32 => Op::TypeAvcImeDualReferenceStreaminINTEL, - 5711u32 => Op::TypeAvcRefResultINTEL, - 5712u32 => Op::TypeAvcSicResultINTEL, - 5713u32 => Op::SubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL, - 5714u32 => Op::SubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL, - 5715u32 => Op::SubgroupAvcMceGetDefaultInterShapePenaltyINTEL, - 5716u32 => Op::SubgroupAvcMceSetInterShapePenaltyINTEL, - 5717u32 => Op::SubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL, - 5718u32 => Op::SubgroupAvcMceSetInterDirectionPenaltyINTEL, - 5719u32 => Op::SubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL, - 5720u32 => Op::SubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL, - 5721u32 => Op::SubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL, - 5722u32 => Op::SubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL, - 5723u32 => Op::SubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL, - 5724u32 => Op::SubgroupAvcMceSetMotionVectorCostFunctionINTEL, - 5725u32 => Op::SubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL, - 5726u32 => Op::SubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL, - 5727u32 => Op::SubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL, - 5728u32 => Op::SubgroupAvcMceSetAcOnlyHaarINTEL, - 5729u32 => Op::SubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL, - 5730u32 => Op::SubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL, - 5731u32 => Op::SubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL, - 5732u32 => Op::SubgroupAvcMceConvertToImePayloadINTEL, - 5733u32 => Op::SubgroupAvcMceConvertToImeResultINTEL, - 5734u32 => Op::SubgroupAvcMceConvertToRefPayloadINTEL, - 5735u32 => Op::SubgroupAvcMceConvertToRefResultINTEL, - 5736u32 => Op::SubgroupAvcMceConvertToSicPayloadINTEL, - 5737u32 => Op::SubgroupAvcMceConvertToSicResultINTEL, - 5738u32 => Op::SubgroupAvcMceGetMotionVectorsINTEL, - 5739u32 => Op::SubgroupAvcMceGetInterDistortionsINTEL, - 5740u32 => Op::SubgroupAvcMceGetBestInterDistortionsINTEL, - 5741u32 => Op::SubgroupAvcMceGetInterMajorShapeINTEL, - 5742u32 => Op::SubgroupAvcMceGetInterMinorShapeINTEL, - 5743u32 => Op::SubgroupAvcMceGetInterDirectionsINTEL, - 5744u32 => Op::SubgroupAvcMceGetInterMotionVectorCountINTEL, - 5745u32 => Op::SubgroupAvcMceGetInterReferenceIdsINTEL, - 5746u32 => Op::SubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL, - 5747u32 => Op::SubgroupAvcImeInitializeINTEL, - 5748u32 => Op::SubgroupAvcImeSetSingleReferenceINTEL, - 5749u32 => Op::SubgroupAvcImeSetDualReferenceINTEL, - 5750u32 => Op::SubgroupAvcImeRefWindowSizeINTEL, - 5751u32 => Op::SubgroupAvcImeAdjustRefOffsetINTEL, - 5752u32 => Op::SubgroupAvcImeConvertToMcePayloadINTEL, - 5753u32 => Op::SubgroupAvcImeSetMaxMotionVectorCountINTEL, - 5754u32 => Op::SubgroupAvcImeSetUnidirectionalMixDisableINTEL, - 5755u32 => Op::SubgroupAvcImeSetEarlySearchTerminationThresholdINTEL, - 5756u32 => Op::SubgroupAvcImeSetWeightedSadINTEL, - 5757u32 => Op::SubgroupAvcImeEvaluateWithSingleReferenceINTEL, - 5758u32 => Op::SubgroupAvcImeEvaluateWithDualReferenceINTEL, - 5759u32 => Op::SubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL, - 5760u32 => Op::SubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL, - 5761u32 => Op::SubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL, - 5762u32 => Op::SubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL, - 5763u32 => Op::SubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL, - 5764u32 => Op::SubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL, - 5765u32 => Op::SubgroupAvcImeConvertToMceResultINTEL, - 5766u32 => Op::SubgroupAvcImeGetSingleReferenceStreaminINTEL, - 5767u32 => Op::SubgroupAvcImeGetDualReferenceStreaminINTEL, - 5768u32 => Op::SubgroupAvcImeStripSingleReferenceStreamoutINTEL, - 5769u32 => Op::SubgroupAvcImeStripDualReferenceStreamoutINTEL, - 5770u32 => Op::SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL, - 5771u32 => Op::SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL, - 5772u32 => Op::SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL, - 5773u32 => Op::SubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL, - 5774u32 => Op::SubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL, - 5775u32 => Op::SubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL, - 5776u32 => Op::SubgroupAvcImeGetBorderReachedINTEL, - 5777u32 => Op::SubgroupAvcImeGetTruncatedSearchIndicationINTEL, - 5778u32 => Op::SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL, - 5779u32 => Op::SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL, - 5780u32 => Op::SubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL, - 5781u32 => Op::SubgroupAvcFmeInitializeINTEL, - 5782u32 => Op::SubgroupAvcBmeInitializeINTEL, - 5783u32 => Op::SubgroupAvcRefConvertToMcePayloadINTEL, - 5784u32 => Op::SubgroupAvcRefSetBidirectionalMixDisableINTEL, - 5785u32 => Op::SubgroupAvcRefSetBilinearFilterEnableINTEL, - 5786u32 => Op::SubgroupAvcRefEvaluateWithSingleReferenceINTEL, - 5787u32 => Op::SubgroupAvcRefEvaluateWithDualReferenceINTEL, - 5788u32 => Op::SubgroupAvcRefEvaluateWithMultiReferenceINTEL, - 5789u32 => Op::SubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL, - 5790u32 => Op::SubgroupAvcRefConvertToMceResultINTEL, - 5791u32 => Op::SubgroupAvcSicInitializeINTEL, - 5792u32 => Op::SubgroupAvcSicConfigureSkcINTEL, - 5793u32 => Op::SubgroupAvcSicConfigureIpeLumaINTEL, - 5794u32 => Op::SubgroupAvcSicConfigureIpeLumaChromaINTEL, - 5795u32 => Op::SubgroupAvcSicGetMotionVectorMaskINTEL, - 5796u32 => Op::SubgroupAvcSicConvertToMcePayloadINTEL, - 5797u32 => Op::SubgroupAvcSicSetIntraLumaShapePenaltyINTEL, - 5798u32 => Op::SubgroupAvcSicSetIntraLumaModeCostFunctionINTEL, - 5799u32 => Op::SubgroupAvcSicSetIntraChromaModeCostFunctionINTEL, - 5800u32 => Op::SubgroupAvcSicSetBilinearFilterEnableINTEL, - 5801u32 => Op::SubgroupAvcSicSetSkcForwardTransformEnableINTEL, - 5802u32 => Op::SubgroupAvcSicSetBlockBasedRawSkipSadINTEL, - 5803u32 => Op::SubgroupAvcSicEvaluateIpeINTEL, - 5804u32 => Op::SubgroupAvcSicEvaluateWithSingleReferenceINTEL, - 5805u32 => Op::SubgroupAvcSicEvaluateWithDualReferenceINTEL, - 5806u32 => Op::SubgroupAvcSicEvaluateWithMultiReferenceINTEL, - 5807u32 => Op::SubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL, - 5808u32 => Op::SubgroupAvcSicConvertToMceResultINTEL, - 5809u32 => Op::SubgroupAvcSicGetIpeLumaShapeINTEL, - 5810u32 => Op::SubgroupAvcSicGetBestIpeLumaDistortionINTEL, - 5811u32 => Op::SubgroupAvcSicGetBestIpeChromaDistortionINTEL, - 5812u32 => Op::SubgroupAvcSicGetPackedIpeLumaModesINTEL, - 5813u32 => Op::SubgroupAvcSicGetIpeChromaModeINTEL, - 5814u32 => Op::SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, - 5815u32 => Op::SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, - 5816u32 => Op::SubgroupAvcSicGetInterRawSadsINTEL, - 5887u32 => Op::LoopControlINTEL, - 5946u32 => Op::ReadPipeBlockingINTEL, - 5947u32 => Op::WritePipeBlockingINTEL, - 5949u32 => Op::FPGARegINTEL, - 6016u32 => Op::RayQueryGetRayTMinKHR, - 6017u32 => Op::RayQueryGetRayFlagsKHR, - 6018u32 => Op::RayQueryGetIntersectionTKHR, - 6019u32 => Op::RayQueryGetIntersectionInstanceCustomIndexKHR, - 6020u32 => Op::RayQueryGetIntersectionInstanceIdKHR, - 6021u32 => Op::RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, - 6022u32 => Op::RayQueryGetIntersectionGeometryIndexKHR, - 6023u32 => Op::RayQueryGetIntersectionPrimitiveIndexKHR, - 6024u32 => Op::RayQueryGetIntersectionBarycentricsKHR, - 6025u32 => Op::RayQueryGetIntersectionFrontFaceKHR, - 6026u32 => Op::RayQueryGetIntersectionCandidateAABBOpaqueKHR, - 6027u32 => Op::RayQueryGetIntersectionObjectRayDirectionKHR, - 6028u32 => Op::RayQueryGetIntersectionObjectRayOriginKHR, - 6029u32 => Op::RayQueryGetWorldRayDirectionKHR, - 6030u32 => Op::RayQueryGetWorldRayOriginKHR, - 6031u32 => Op::RayQueryGetIntersectionObjectToWorldKHR, - 6032u32 => Op::RayQueryGetIntersectionWorldToObjectKHR, - 6035u32 => Op::AtomicFAddEXT, - _ => return None, - }) - } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } -} #[doc = "[GLSL.std.450](https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html) extended instruction opcode"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -3897,97 +3891,13 @@ pub enum GLOp { NMax = 80u32, NClamp = 81u32, } -impl num_traits::FromPrimitive for GLOp { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 1u32 => GLOp::Round, - 2u32 => GLOp::RoundEven, - 3u32 => GLOp::Trunc, - 4u32 => GLOp::FAbs, - 5u32 => GLOp::SAbs, - 6u32 => GLOp::FSign, - 7u32 => GLOp::SSign, - 8u32 => GLOp::Floor, - 9u32 => GLOp::Ceil, - 10u32 => GLOp::Fract, - 11u32 => GLOp::Radians, - 12u32 => GLOp::Degrees, - 13u32 => GLOp::Sin, - 14u32 => GLOp::Cos, - 15u32 => GLOp::Tan, - 16u32 => GLOp::Asin, - 17u32 => GLOp::Acos, - 18u32 => GLOp::Atan, - 19u32 => GLOp::Sinh, - 20u32 => GLOp::Cosh, - 21u32 => GLOp::Tanh, - 22u32 => GLOp::Asinh, - 23u32 => GLOp::Acosh, - 24u32 => GLOp::Atanh, - 25u32 => GLOp::Atan2, - 26u32 => GLOp::Pow, - 27u32 => GLOp::Exp, - 28u32 => GLOp::Log, - 29u32 => GLOp::Exp2, - 30u32 => GLOp::Log2, - 31u32 => GLOp::Sqrt, - 32u32 => GLOp::InverseSqrt, - 33u32 => GLOp::Determinant, - 34u32 => GLOp::MatrixInverse, - 35u32 => GLOp::Modf, - 36u32 => GLOp::ModfStruct, - 37u32 => GLOp::FMin, - 38u32 => GLOp::UMin, - 39u32 => GLOp::SMin, - 40u32 => GLOp::FMax, - 41u32 => GLOp::UMax, - 42u32 => GLOp::SMax, - 43u32 => GLOp::FClamp, - 44u32 => GLOp::UClamp, - 45u32 => GLOp::SClamp, - 46u32 => GLOp::FMix, - 47u32 => GLOp::IMix, - 48u32 => GLOp::Step, - 49u32 => GLOp::SmoothStep, - 50u32 => GLOp::Fma, - 51u32 => GLOp::Frexp, - 52u32 => GLOp::FrexpStruct, - 53u32 => GLOp::Ldexp, - 54u32 => GLOp::PackSnorm4x8, - 55u32 => GLOp::PackUnorm4x8, - 56u32 => GLOp::PackSnorm2x16, - 57u32 => GLOp::PackUnorm2x16, - 58u32 => GLOp::PackHalf2x16, - 59u32 => GLOp::PackDouble2x32, - 60u32 => GLOp::UnpackSnorm2x16, - 61u32 => GLOp::UnpackUnorm2x16, - 62u32 => GLOp::UnpackHalf2x16, - 63u32 => GLOp::UnpackSnorm4x8, - 64u32 => GLOp::UnpackUnorm4x8, - 65u32 => GLOp::UnpackDouble2x32, - 66u32 => GLOp::Length, - 67u32 => GLOp::Distance, - 68u32 => GLOp::Cross, - 69u32 => GLOp::Normalize, - 70u32 => GLOp::FaceForward, - 71u32 => GLOp::Reflect, - 72u32 => GLOp::Refract, - 73u32 => GLOp::FindILsb, - 74u32 => GLOp::FindSMsb, - 75u32 => GLOp::FindUMsb, - 76u32 => GLOp::InterpolateAtCentroid, - 77u32 => GLOp::InterpolateAtSample, - 78u32 => GLOp::InterpolateAtOffset, - 79u32 => GLOp::NMin, - 80u32 => GLOp::NMax, - 81u32 => GLOp::NClamp, +impl GLOp { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 1u32..=81u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } #[doc = "[OpenCL.std](https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html) extended instruction opcode"] #[repr(u32)] @@ -4091,6 +4001,22 @@ pub enum CLOp { native_sin = 92u32, native_sqrt = 93u32, native_tan = 94u32, + fclamp = 95u32, + degrees = 96u32, + fmax_common = 97u32, + fmin_common = 98u32, + mix = 99u32, + radians = 100u32, + step = 101u32, + smoothstep = 102u32, + sign = 103u32, + cross = 104u32, + distance = 105u32, + length = 106u32, + normalize = 107u32, + fast_distance = 108u32, + fast_length = 109u32, + fast_normalize = 110u32, s_abs = 141u32, s_abs_diff = 142u32, s_add_sat = 143u32, @@ -4121,28 +4047,6 @@ pub enum CLOp { u_mad24 = 168u32, s_mul24 = 169u32, u_mul24 = 170u32, - u_abs = 201u32, - u_abs_diff = 202u32, - u_mul_hi = 203u32, - u_mad_hi = 204u32, - fclamp = 95u32, - degrees = 96u32, - fmax_common = 97u32, - fmin_common = 98u32, - mix = 99u32, - radians = 100u32, - step = 101u32, - smoothstep = 102u32, - sign = 103u32, - cross = 104u32, - distance = 105u32, - length = 106u32, - normalize = 107u32, - fast_distance = 108u32, - fast_length = 109u32, - fast_normalize = 110u32, - bitselect = 186u32, - select = 187u32, vloadn = 171u32, vstoren = 172u32, vload_half = 173u32, @@ -4158,177 +4062,20 @@ pub enum CLOp { shuffle2 = 183u32, printf = 184u32, prefetch = 185u32, + bitselect = 186u32, + select = 187u32, + u_abs = 201u32, + u_abs_diff = 202u32, + u_mul_hi = 203u32, + u_mad_hi = 204u32, } -impl num_traits::FromPrimitive for CLOp { - #[allow(trivial_numeric_casts)] - fn from_i64(n: i64) -> Option { - Some(match n as u32 { - 0u32 => CLOp::acos, - 1u32 => CLOp::acosh, - 2u32 => CLOp::acospi, - 3u32 => CLOp::asin, - 4u32 => CLOp::asinh, - 5u32 => CLOp::asinpi, - 6u32 => CLOp::atan, - 7u32 => CLOp::atan2, - 8u32 => CLOp::atanh, - 9u32 => CLOp::atanpi, - 10u32 => CLOp::atan2pi, - 11u32 => CLOp::cbrt, - 12u32 => CLOp::ceil, - 13u32 => CLOp::copysign, - 14u32 => CLOp::cos, - 15u32 => CLOp::cosh, - 16u32 => CLOp::cospi, - 17u32 => CLOp::erfc, - 18u32 => CLOp::erf, - 19u32 => CLOp::exp, - 20u32 => CLOp::exp2, - 21u32 => CLOp::exp10, - 22u32 => CLOp::expm1, - 23u32 => CLOp::fabs, - 24u32 => CLOp::fdim, - 25u32 => CLOp::floor, - 26u32 => CLOp::fma, - 27u32 => CLOp::fmax, - 28u32 => CLOp::fmin, - 29u32 => CLOp::fmod, - 30u32 => CLOp::fract, - 31u32 => CLOp::frexp, - 32u32 => CLOp::hypot, - 33u32 => CLOp::ilogb, - 34u32 => CLOp::ldexp, - 35u32 => CLOp::lgamma, - 36u32 => CLOp::lgamma_r, - 37u32 => CLOp::log, - 38u32 => CLOp::log2, - 39u32 => CLOp::log10, - 40u32 => CLOp::log1p, - 41u32 => CLOp::logb, - 42u32 => CLOp::mad, - 43u32 => CLOp::maxmag, - 44u32 => CLOp::minmag, - 45u32 => CLOp::modf, - 46u32 => CLOp::nan, - 47u32 => CLOp::nextafter, - 48u32 => CLOp::pow, - 49u32 => CLOp::pown, - 50u32 => CLOp::powr, - 51u32 => CLOp::remainder, - 52u32 => CLOp::remquo, - 53u32 => CLOp::rint, - 54u32 => CLOp::rootn, - 55u32 => CLOp::round, - 56u32 => CLOp::rsqrt, - 57u32 => CLOp::sin, - 58u32 => CLOp::sincos, - 59u32 => CLOp::sinh, - 60u32 => CLOp::sinpi, - 61u32 => CLOp::sqrt, - 62u32 => CLOp::tan, - 63u32 => CLOp::tanh, - 64u32 => CLOp::tanpi, - 65u32 => CLOp::tgamma, - 66u32 => CLOp::trunc, - 67u32 => CLOp::half_cos, - 68u32 => CLOp::half_divide, - 69u32 => CLOp::half_exp, - 70u32 => CLOp::half_exp2, - 71u32 => CLOp::half_exp10, - 72u32 => CLOp::half_log, - 73u32 => CLOp::half_log2, - 74u32 => CLOp::half_log10, - 75u32 => CLOp::half_powr, - 76u32 => CLOp::half_recip, - 77u32 => CLOp::half_rsqrt, - 78u32 => CLOp::half_sin, - 79u32 => CLOp::half_sqrt, - 80u32 => CLOp::half_tan, - 81u32 => CLOp::native_cos, - 82u32 => CLOp::native_divide, - 83u32 => CLOp::native_exp, - 84u32 => CLOp::native_exp2, - 85u32 => CLOp::native_exp10, - 86u32 => CLOp::native_log, - 87u32 => CLOp::native_log2, - 88u32 => CLOp::native_log10, - 89u32 => CLOp::native_powr, - 90u32 => CLOp::native_recip, - 91u32 => CLOp::native_rsqrt, - 92u32 => CLOp::native_sin, - 93u32 => CLOp::native_sqrt, - 94u32 => CLOp::native_tan, - 141u32 => CLOp::s_abs, - 142u32 => CLOp::s_abs_diff, - 143u32 => CLOp::s_add_sat, - 144u32 => CLOp::u_add_sat, - 145u32 => CLOp::s_hadd, - 146u32 => CLOp::u_hadd, - 147u32 => CLOp::s_rhadd, - 148u32 => CLOp::u_rhadd, - 149u32 => CLOp::s_clamp, - 150u32 => CLOp::u_clamp, - 151u32 => CLOp::clz, - 152u32 => CLOp::ctz, - 153u32 => CLOp::s_mad_hi, - 154u32 => CLOp::u_mad_sat, - 155u32 => CLOp::s_mad_sat, - 156u32 => CLOp::s_max, - 157u32 => CLOp::u_max, - 158u32 => CLOp::s_min, - 159u32 => CLOp::u_min, - 160u32 => CLOp::s_mul_hi, - 161u32 => CLOp::rotate, - 162u32 => CLOp::s_sub_sat, - 163u32 => CLOp::u_sub_sat, - 164u32 => CLOp::u_upsample, - 165u32 => CLOp::s_upsample, - 166u32 => CLOp::popcount, - 167u32 => CLOp::s_mad24, - 168u32 => CLOp::u_mad24, - 169u32 => CLOp::s_mul24, - 170u32 => CLOp::u_mul24, - 201u32 => CLOp::u_abs, - 202u32 => CLOp::u_abs_diff, - 203u32 => CLOp::u_mul_hi, - 204u32 => CLOp::u_mad_hi, - 95u32 => CLOp::fclamp, - 96u32 => CLOp::degrees, - 97u32 => CLOp::fmax_common, - 98u32 => CLOp::fmin_common, - 99u32 => CLOp::mix, - 100u32 => CLOp::radians, - 101u32 => CLOp::step, - 102u32 => CLOp::smoothstep, - 103u32 => CLOp::sign, - 104u32 => CLOp::cross, - 105u32 => CLOp::distance, - 106u32 => CLOp::length, - 107u32 => CLOp::normalize, - 108u32 => CLOp::fast_distance, - 109u32 => CLOp::fast_length, - 110u32 => CLOp::fast_normalize, - 186u32 => CLOp::bitselect, - 187u32 => CLOp::select, - 171u32 => CLOp::vloadn, - 172u32 => CLOp::vstoren, - 173u32 => CLOp::vload_half, - 174u32 => CLOp::vload_halfn, - 175u32 => CLOp::vstore_half, - 176u32 => CLOp::vstore_half_r, - 177u32 => CLOp::vstore_halfn, - 178u32 => CLOp::vstore_halfn_r, - 179u32 => CLOp::vloada_halfn, - 180u32 => CLOp::vstorea_halfn, - 181u32 => CLOp::vstorea_halfn_r, - 182u32 => CLOp::shuffle, - 183u32 => CLOp::shuffle2, - 184u32 => CLOp::printf, - 185u32 => CLOp::prefetch, +impl CLOp { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=110u32 => unsafe { core::mem::transmute::(n) }, + 141u32..=187u32 => unsafe { core::mem::transmute::(n) }, + 201u32..=204u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } - fn from_u64(n: u64) -> Option { - Self::from_i64(n as i64) - } } diff --git a/third_party/rust/spirv/release.toml b/third_party/rust/spirv/release.toml index e1f4c5e4d7c74..bd5789db7574f 100644 --- a/third_party/rust/spirv/release.toml +++ b/third_party/rust/spirv/release.toml @@ -1,13 +1,11 @@ pre-release-commit-message = "Release {{crate_name}} {{version}}" -no-dev-version = true tag-message = "Release {{crate_name}} {{version}}" tag-name = "{{crate_name}}-{{version}}" sign-commit = true sign-tag = true +publish = false pre-release-replacements = [ {file="README.md", search="spirv = .*", replace="{{crate_name}} = \"{{version}}\""}, {file="../rspirv/Cargo.toml", search="spirv = \\{ version = \".*\", path = \"../spirv\" \\}", replace="{{crate_name}} = { version = \"{{version}}\", path = \"../spirv\" }" }, ] - - diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json index 491e1ccb1456e..81260426fde73 100644 --- a/third_party/rust/wgpu-core/.cargo-checksum.json +++ b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f7d6539341f7ff8362c314e0c1b9bf95eea7dad87af191e28bc30e3c53de28fd","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/any_surface.rs":"c5e961783be28548681c3c38579ea0b5724c5336848216a423e83a0db2208ece","src/binding_model.rs":"ad6667fd22e3a56fb09d35f077a1d94203c0d1ef36832492971a8143ad109ca2","src/command/bind.rs":"fcfbefdbdde10a1add947308ef3e80ed2acd8b6459bc7e0c25b0bbb38b1144ff","src/command/bundle.rs":"db63658fb05d548d593599e3fa0fb9c42f56419e35d97b56011c913c906c7c13","src/command/clear.rs":"f7a1c3374949885652fde94658a14e09dac84fc41d58c352e585c764d9a14f3c","src/command/compute.rs":"c393569da1377e136180560dbc19b1314b6527ae0e0cb2834a9222052f9bffce","src/command/draw.rs":"79db78560c6046f309f103f224750260ff926550846336bebd186252b4732fbc","src/command/memory_init.rs":"9c982099046ee174e1574d3f841e712831a84dd0948ebe2ffcb51e01c5104fa7","src/command/mod.rs":"dd22c5eab57f6f03373c41bfda2a55666ee61dfb2482a1126f959a48d0ad81c8","src/command/query.rs":"8c21df7d24e49664f70b364bd9daf575bebe5c17a456f346f0a98d4e6c810636","src/command/render.rs":"795fd6e78e91ee6f4f54856cdddbb680745d0accda802533f88e205de135436a","src/command/transfer.rs":"6012000a420c2e177c00a6df91b15ac58e947f5422d67bb8db5843a2a3fff134","src/conv.rs":"7e3ffe33b47a6fd3617aabf9f11cc68f1ccbee2c7343b8dbbcd0e8f3447e1ad8","src/device/any_device.rs":"2cb2be0fd078d65039692d309d8688cf4a02fb768579cf22c93cfa514d20ad7f","src/device/global.rs":"ed1580f15bdec3927b736101b78dc34fec40d92ed4ead15a0e1b5f70e72d5675","src/device/life.rs":"9c9d2c21852bc1b9e133bfdea33b89abbbe9d849ad5c00d09863fe5594792e40","src/device/mod.rs":"45ad9b826f296cbef9470c3cfc705f832198587b45847ddd0ea4ddd5eb55f7eb","src/device/queue.rs":"7ec005a04371d0cb191bc067074ac83f95dc751e5f1145e1cb7935b76b2b3716","src/device/resource.rs":"396bfda6c181826288484426f4fa170376256e1d29df916e1f265d2397e5987d","src/device/trace.rs":"9a8ec674567a8866a6bd1ed2ad06e474bd2504ed91f228d3040cb6db18fe5f2b","src/error.rs":"32680e922acfb1f1d6842177179768d365c575a8baa402da9d5a43a2357b0dbf","src/global.rs":"c0a590e0136bf19a63ddc87dd3f0bbfbe24bcb810d0ccfc6c5f26631750d63ea","src/hal_api.rs":"3ee0f5e66b313fd1b8c79b3d73f0f1dbde88676b651d79518fa2dc5aff0ab856","src/hub.rs":"4cec8de74a661bb628040ff457d38faf8c92d0824c4d5a4955834d56ebd25926","src/id.rs":"2c73422b2b5f0ce4a5bc3fce79bb3d3a370cda7aa6680c2239829ffc5a85d869","src/identity.rs":"0701f6f41e754dde2bebc567a87c25b353dfab40b79a322990dbfa477739ab8c","src/init_tracker/buffer.rs":"61eb9cfaa312135b7a937ff6a3117f531b5b7323fae6553a41d6de9bc106d7e0","src/init_tracker/mod.rs":"0867f79f83555390d0982d1dc6dcf0d4340e10cb89aa633d3c3ecc45deb3c78c","src/init_tracker/texture.rs":"030fd594bf9948fad391390d85c5e1fec7eaf67b6e812c60f2dd59bc4fda8fd5","src/instance.rs":"e1d4af51bb445850d9e2d7d12b239413bb555f07f95d3a1851cc73443c5c18f0","src/lib.rs":"ab61469bc2d9bdcc47b73435a0d438ba413c5619ab653180a56e8e2aefe93c74","src/pipeline.rs":"bd6e242f0f5408da0a675066092129281aadd5ab0051c036821b34c17992c1da","src/present.rs":"7751da30b27eed7521be7af166c6a07468eda47bf96206082cc33df6f77ec0d8","src/registry.rs":"c259ca61dd5f2b632ff2ee871f82727921fa48dee15253872799af1dda77484b","src/resource.rs":"e3c22585dd85dc79a4c5b50a7302392421bfc16dbac6de14592440deeeb7ee8a","src/snatch.rs":"2de558dda543329d70be35ed72dffdeba816814f6f0059d720a568abd47e40a7","src/storage.rs":"02be927de5c85f5f59a1c847bbdc8e9e02fb976c39fb7e3078a8f9fbff929934","src/track/buffer.rs":"c5ae73d1d84bcfb5a17c31f43de661cd0bf931e15e9fd92ad18fd31a88b05330","src/track/metadata.rs":"f8994ad91db7f3bb1b7f8b8b0f6884753d733ce28238b36f31da2230706f848e","src/track/mod.rs":"25015210f4f960f1daf4891a13d5b6ac48aad87cbc158a0bcdb1f718219f6e20","src/track/range.rs":"2a15794e79b0470d5ba6b3267173a42f34312878e1cb288f198d2854a7888e53","src/track/stateless.rs":"43ec668f56c962f255b900a773a537dde1c21dd0b2e3804271786fb90e9cfffa","src/track/texture.rs":"d4e92ef3400cf48b2e76d8b7c1e4c6a1cef0d3d060c6abdb46b9a3b386bc9dc9","src/validation.rs":"6933c349d155f647778134696c53cbd641419a959505f2f0a3db31fcceefc8b4"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"f3ec42fd497e3fe2070ff1285713980e3a1b2c13e9dfb3eccb237baf68fa9954","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/any_surface.rs":"c5e961783be28548681c3c38579ea0b5724c5336848216a423e83a0db2208ece","src/binding_model.rs":"da0febe86a77cf3b6f958865af0cf07e1d0788a09e883030986a520360cc226a","src/command/bind.rs":"a37f042484b65d9fdea4cdab3667381623ee9a8943a6d32683d410b92736d306","src/command/bundle.rs":"db63658fb05d548d593599e3fa0fb9c42f56419e35d97b56011c913c906c7c13","src/command/clear.rs":"69b30b92c61ff4396243d3dc42fb46a187771d40af26f9ec1c631dc602f76daa","src/command/compute.rs":"c393569da1377e136180560dbc19b1314b6527ae0e0cb2834a9222052f9bffce","src/command/draw.rs":"79db78560c6046f309f103f224750260ff926550846336bebd186252b4732fbc","src/command/memory_init.rs":"9c982099046ee174e1574d3f841e712831a84dd0948ebe2ffcb51e01c5104fa7","src/command/mod.rs":"74d7dffe3fc3d504feb85dad0c73a06ea7bfbe4311f86e96f9390c2c974dcb03","src/command/query.rs":"8c21df7d24e49664f70b364bd9daf575bebe5c17a456f346f0a98d4e6c810636","src/command/render.rs":"5f271a6f2705e31b2ca90e88ec858ae81a714c5b4a51491890ebed45c1ce1287","src/command/transfer.rs":"0d2e2c397bc8830d8e84d84d0708413954ed7c4594e22c66d2b65255ccab68d7","src/conv.rs":"7e3ffe33b47a6fd3617aabf9f11cc68f1ccbee2c7343b8dbbcd0e8f3447e1ad8","src/device/any_device.rs":"2cb2be0fd078d65039692d309d8688cf4a02fb768579cf22c93cfa514d20ad7f","src/device/bgl.rs":"292a0f07121aec78e86e0125d08785072bd4b7e763c99975b581b342ac4fcaa3","src/device/global.rs":"4bbcabe510572e3c405475117ae005a7563a5d47d4ac0b2225b7a5443e8939a7","src/device/life.rs":"3829f0cdba9b5476acd2e108fc0373b8ac2d2a6feed01c5653df9e87cb16f39c","src/device/mod.rs":"4d15b1d1ab3b90ca8d953fad062263f129d0338d493abcc5ffe65caf2d038674","src/device/queue.rs":"18769043c85a07909741a67dc3a7e303db490a623cc1a0448563818668300e3c","src/device/resource.rs":"88a0c3f1036ccd69efe2d62b494286bacab8b56e9fe969b61a58a8c07693b358","src/device/trace.rs":"9a8ec674567a8866a6bd1ed2ad06e474bd2504ed91f228d3040cb6db18fe5f2b","src/error.rs":"32680e922acfb1f1d6842177179768d365c575a8baa402da9d5a43a2357b0dbf","src/global.rs":"c0a590e0136bf19a63ddc87dd3f0bbfbe24bcb810d0ccfc6c5f26631750d63ea","src/hal_api.rs":"3ee0f5e66b313fd1b8c79b3d73f0f1dbde88676b651d79518fa2dc5aff0ab856","src/hash_utils.rs":"e8d484027c7ce81978e4679a5e20af9416ab7d2fa595f1ca95992b29d625b0ca","src/hub.rs":"4cec8de74a661bb628040ff457d38faf8c92d0824c4d5a4955834d56ebd25926","src/id.rs":"2c73422b2b5f0ce4a5bc3fce79bb3d3a370cda7aa6680c2239829ffc5a85d869","src/identity.rs":"0701f6f41e754dde2bebc567a87c25b353dfab40b79a322990dbfa477739ab8c","src/init_tracker/buffer.rs":"61eb9cfaa312135b7a937ff6a3117f531b5b7323fae6553a41d6de9bc106d7e0","src/init_tracker/mod.rs":"0867f79f83555390d0982d1dc6dcf0d4340e10cb89aa633d3c3ecc45deb3c78c","src/init_tracker/texture.rs":"030fd594bf9948fad391390d85c5e1fec7eaf67b6e812c60f2dd59bc4fda8fd5","src/instance.rs":"e1d4af51bb445850d9e2d7d12b239413bb555f07f95d3a1851cc73443c5c18f0","src/lib.rs":"082cf63acb7099ca2597d6bdd756c11782e4e39064da74b06000c99d5d7fdb85","src/pipeline.rs":"e3a8d4bc0a60d2ad647b8062798be2af387099b3af42214f180e6cebae3d807c","src/pool.rs":"8c88d86763bc465bf628157c62db9641f6789ece684cc4a20a2fdf50d37e0e16","src/present.rs":"c419d81f2d8814c6af4460ed4d03b4485b57743c3d2a52a50ab7c3d3c6f21968","src/registry.rs":"ffa4029aaf8ed980bd2b61d056a7ec32099f5c2e1d85f3b9f1861baa34ac488c","src/resource.rs":"84e96b5944bd776af5019fd64afef739bc5facb99e089a71f070922fd61af60a","src/snatch.rs":"dd514e1954137eec4a0753a3670e8180796ac9c9ff770a1ca1813863debce823","src/storage.rs":"9ef4ee85e321fee73a50f21d0932f1a2ae08515b0e1d6be207f330e4ea59d1b6","src/track/buffer.rs":"c5ae73d1d84bcfb5a17c31f43de661cd0bf931e15e9fd92ad18fd31a88b05330","src/track/metadata.rs":"f8994ad91db7f3bb1b7f8b8b0f6884753d733ce28238b36f31da2230706f848e","src/track/mod.rs":"02bac3cf2e53af45f79646817e85da8e4072d576438036a44b41ce1744e02d64","src/track/range.rs":"2a15794e79b0470d5ba6b3267173a42f34312878e1cb288f198d2854a7888e53","src/track/stateless.rs":"43ec668f56c962f255b900a773a537dde1c21dd0b2e3804271786fb90e9cfffa","src/track/texture.rs":"769d87975b2fa0f6ca5794b7eaa203b2d6a00dea452783e6105ca7daf141490f","src/validation.rs":"613c58c3601f36d6aa5986cea01f30497c6bd4ceb990824904d101b2327941a9"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-core/Cargo.toml b/third_party/rust/wgpu-core/Cargo.toml index 300e0f57f20ab..cb835da5cdc6f 100644 --- a/third_party/rust/wgpu-core/Cargo.toml +++ b/third_party/rust/wgpu-core/Cargo.toml @@ -41,7 +41,9 @@ arrayvec = "0.7" bit-vec = "0.6" bitflags = "2" codespan-reporting = "0.11" +indexmap = "2" log = "0.4" +once_cell = "1" parking_lot = ">=0.11,<0.13" rustc-hash = "1.1" smallvec = "1" diff --git a/third_party/rust/wgpu-core/src/binding_model.rs b/third_party/rust/wgpu-core/src/binding_model.rs index c5db9b02c47ad..ec97568f0c55e 100644 --- a/third_party/rust/wgpu-core/src/binding_model.rs +++ b/third_party/rust/wgpu-core/src/binding_model.rs @@ -1,5 +1,7 @@ use crate::{ - device::{Device, DeviceError, MissingDownlevelFlags, MissingFeatures, SHADER_STAGE_COUNT}, + device::{ + bgl, Device, DeviceError, MissingDownlevelFlags, MissingFeatures, SHADER_STAGE_COUNT, + }, error::{ErrorFormatter, PrettyError}, hal_api::HalApi, id::{ @@ -12,7 +14,7 @@ use crate::{ snatch::SnatchGuard, track::{BindGroupStates, UsageConflict}, validation::{MissingBufferUsageError, MissingTextureUsageError}, - FastHashMap, Label, + Label, }; use arrayvec::ArrayVec; @@ -440,32 +442,32 @@ pub struct BindGroupLayoutDescriptor<'a> { pub entries: Cow<'a, [wgt::BindGroupLayoutEntry]>, } -pub(crate) type BindEntryMap = FastHashMap; - pub type BindGroupLayouts = crate::storage::Storage, BindGroupLayoutId>; /// Bind group layout. -/// -/// The lifetime of BGLs is a bit special. They are only referenced on CPU -/// without considering GPU operations. And on CPU they get manual -/// inc-refs and dec-refs. In particular, the following objects depend on them: -/// - produced bind groups -/// - produced pipeline layouts -/// - pipelines with implicit layouts #[derive(Debug)] pub struct BindGroupLayout { pub(crate) raw: Option, pub(crate) device: Arc>, - pub(crate) entries: BindEntryMap, + pub(crate) entries: bgl::EntryMap, + /// It is very important that we know if the bind group comes from the BGL pool. + /// + /// If it does, then we need to remove it from the pool when we drop it. + /// + /// We cannot unconditionally remove from the pool, as BGLs that don't come from the pool + /// (derived BGLs) must not be removed. + pub(crate) origin: bgl::Origin, #[allow(unused)] - pub(crate) dynamic_count: usize, - pub(crate) count_validator: BindingTypeMaxCountValidator, + pub(crate) binding_count_validator: BindingTypeMaxCountValidator, pub(crate) info: ResourceInfo, pub(crate) label: String, } impl Drop for BindGroupLayout { fn drop(&mut self) { + if matches!(self.origin, bgl::Origin::Pool) { + self.device.bgl_pool.remove(&self.entries); + } if let Some(raw) = self.raw.take() { resource_log!("Destroy raw BindGroupLayout {:?}", self.info.label()); unsafe { @@ -618,6 +620,14 @@ impl PipelineLayout { pub(crate) fn raw(&self) -> &A::PipelineLayout { self.raw.as_ref().unwrap() } + + pub(crate) fn get_binding_maps(&self) -> ArrayVec<&bgl::EntryMap, { hal::MAX_BIND_GROUPS }> { + self.bind_group_layouts + .iter() + .map(|bgl| &bgl.entries) + .collect() + } + /// Validate push constants match up with expected ranges. pub(crate) fn validate_push_constant_ranges( &self, @@ -837,11 +847,14 @@ impl Drop for BindGroup { impl BindGroup { pub(crate) fn raw(&self, guard: &SnatchGuard) -> Option<&A::BindGroup> { + // Clippy insist on writing it this way. The idea is to return None + // if any of the raw buffer is not valid anymore. for buffer in &self.used_buffer_ranges { - // Clippy insist on writing it this way. The idea is to return None - // if any of the raw buffer is not valid anymore. let _ = buffer.buffer.raw(guard)?; } + for texture in &self.used_texture_ranges { + let _ = texture.texture.raw(guard)?; + } self.raw.as_ref() } pub(crate) fn validate_dynamic_bindings( diff --git a/third_party/rust/wgpu-core/src/command/bind.rs b/third_party/rust/wgpu-core/src/command/bind.rs index 6bf849a42a969..7b2ac545524b6 100644 --- a/third_party/rust/wgpu-core/src/command/bind.rs +++ b/third_party/rust/wgpu-core/src/command/bind.rs @@ -16,7 +16,7 @@ type BindGroupMask = u8; mod compat { use arrayvec::ArrayVec; - use crate::{binding_model::BindGroupLayout, hal_api::HalApi, resource::Resource}; + use crate::{binding_model::BindGroupLayout, device::bgl, hal_api::HalApi, resource::Resource}; use std::{ops::Range, sync::Arc}; #[derive(Debug, Clone)] @@ -60,17 +60,35 @@ mod compat { let mut diff = Vec::new(); if let Some(expected_bgl) = self.expected.as_ref() { + let expected_bgl_type = match expected_bgl.origin { + bgl::Origin::Derived => "implicit", + bgl::Origin::Pool => "explicit", + }; + let expected_label = expected_bgl.label(); diff.push(format!( - "Should be compatible with bind group layout with label = `{}`", - expected_bgl.label() + "Should be compatible an with an {expected_bgl_type} bind group layout {}", + if expected_label.is_empty() { + "without label".to_string() + } else { + format!("with label = `{}`", expected_label) + } )); if let Some(assigned_bgl) = self.assigned.as_ref() { + let assigned_bgl_type = match assigned_bgl.origin { + bgl::Origin::Derived => "implicit", + bgl::Origin::Pool => "explicit", + }; + let assigned_label = assigned_bgl.label(); diff.push(format!( - "Assigned bind group layout with label = `{}`", - assigned_bgl.label() + "Assigned {assigned_bgl_type} bind group layout {}", + if assigned_label.is_empty() { + "without label".to_string() + } else { + format!("with label = `{}`", assigned_label) + } )); - for (id, e_entry) in &expected_bgl.entries { - if let Some(a_entry) = assigned_bgl.entries.get(id) { + for (id, e_entry) in expected_bgl.entries.iter() { + if let Some(a_entry) = assigned_bgl.entries.get(*id) { if a_entry.binding != e_entry.binding { diff.push(format!( "Entry {id} binding expected {}, got {}", @@ -96,32 +114,28 @@ mod compat { )); } } else { - diff.push(format!("Entry {id} not found in assigned bindgroup layout")) + diff.push(format!( + "Entry {id} not found in assigned bind group layout" + )) } } assigned_bgl.entries.iter().for_each(|(id, _e_entry)| { - if !expected_bgl.entries.contains_key(id) { - diff.push(format!("Entry {id} not found in expected bindgroup layout")) + if !expected_bgl.entries.contains_key(*id) { + diff.push(format!( + "Entry {id} not found in expected bind group layout" + )) } }); + + if expected_bgl.origin != assigned_bgl.origin { + diff.push(format!("Expected {expected_bgl_type} bind group layout, got {assigned_bgl_type}")) + } } else { - diff.push( - "Assigned bindgroup layout is implicit, expected explicit".to_owned(), - ); + diff.push("Assigned bind group layout not found (internal error)".to_owned()); } - } else if let Some(assigned_bgl) = self.assigned.as_ref() { - diff.push(format!( - "Assigned bind group layout = `{}`", - assigned_bgl.label() - )); - diff.push( - "Assigned bindgroup layout is not implicit, expected implicit".to_owned(), - ); - } - - if diff.is_empty() { - diff.push("But no differences found? (internal error)".to_owned()) + } else { + diff.push("Expected bind group layout not found (internal error)".to_owned()); } diff diff --git a/third_party/rust/wgpu-core/src/command/clear.rs b/third_party/rust/wgpu-core/src/command/clear.rs index b58738999e3f8..3a6ef14e379d5 100644 --- a/third_party/rust/wgpu-core/src/command/clear.rs +++ b/third_party/rust/wgpu-core/src/command/clear.rs @@ -252,11 +252,9 @@ pub(crate) fn clear_texture( alignments: &hal::Alignments, zero_buffer: &A::Buffer, ) -> Result<(), ClearError> { - let dst_inner = dst_texture.inner(); - let dst_raw = dst_inner - .as_ref() - .unwrap() - .as_raw() + let snatch_guard = dst_texture.device.snatchable_lock.read(); + let dst_raw = dst_texture + .raw(&snatch_guard) .ok_or_else(|| ClearError::InvalidTexture(dst_texture.as_info().id()))?; // Issue the right barrier. @@ -296,7 +294,7 @@ pub(crate) fn clear_texture( let dst_barrier = texture_tracker .set_single(dst_texture, selector, clear_usage) .unwrap() - .map(|pending| pending.into_hal(dst_inner.as_ref().unwrap())); + .map(|pending| pending.into_hal(dst_raw)); unsafe { encoder.transition_textures(dst_barrier.into_iter()); } diff --git a/third_party/rust/wgpu-core/src/command/mod.rs b/third_party/rust/wgpu-core/src/command/mod.rs index f7880e6ee8fd3..dabd8999083f5 100644 --- a/third_party/rust/wgpu-core/src/command/mod.rs +++ b/third_party/rust/wgpu-core/src/command/mod.rs @@ -226,11 +226,11 @@ impl CommandBuffer { profiling::scope!("drain_barriers"); let buffer_barriers = base.buffers.drain_transitions(snatch_guard); - let (transitions, textures) = base.textures.drain_transitions(); + let (transitions, textures) = base.textures.drain_transitions(snatch_guard); let texture_barriers = transitions .into_iter() .enumerate() - .map(|(i, p)| p.into_hal(textures[i].as_ref().unwrap())); + .map(|(i, p)| p.into_hal(textures[i].unwrap().raw().unwrap())); unsafe { raw.transition_buffers(buffer_barriers); diff --git a/third_party/rust/wgpu-core/src/command/render.rs b/third_party/rust/wgpu-core/src/command/render.rs index 2ffd88ea7a1b6..d962a8135f5a6 100644 --- a/third_party/rust/wgpu-core/src/command/render.rs +++ b/third_party/rust/wgpu-core/src/command/render.rs @@ -2370,12 +2370,12 @@ impl Global { (trackers, pending_discard_init_fixups) }; - let query_set_guard = hub.query_sets.read(); - let cmd_buf = hub.command_buffers.get(encoder_id).unwrap(); let mut cmd_buf_data = cmd_buf.data.lock(); let cmd_buf_data = cmd_buf_data.as_mut().unwrap(); + let query_set_guard = hub.query_sets.read(); + let encoder = &mut cmd_buf_data.encoder; let status = &mut cmd_buf_data.status; let tracker = &mut cmd_buf_data.trackers; diff --git a/third_party/rust/wgpu-core/src/command/transfer.rs b/third_party/rust/wgpu-core/src/command/transfer.rs index 359bfbfae3fac..9f8f8dfc346ca 100644 --- a/third_party/rust/wgpu-core/src/command/transfer.rs +++ b/third_party/rust/wgpu-core/src/command/transfer.rs @@ -15,7 +15,6 @@ use crate::{ TextureInitTrackerAction, }, resource::{Resource, Texture, TextureErrorDimension}, - storage::Storage, track::{TextureSelector, Tracker}, }; @@ -24,7 +23,7 @@ use hal::CommandEncoder as _; use thiserror::Error; use wgt::{BufferAddress, BufferUsages, Extent3d, TextureUsages}; -use std::iter; +use std::{iter, sync::Arc}; use super::{memory_init::CommandBufferTextureMemoryActions, CommandEncoder}; @@ -447,9 +446,8 @@ fn handle_texture_init( device: &Device, copy_texture: &ImageCopyTexture, copy_size: &Extent3d, - texture_guard: &Storage, TextureId>, + texture: &Arc>, ) { - let texture = texture_guard.get(copy_texture.texture).unwrap(); let init_action = TextureInitTrackerAction { texture: texture.clone(), range: TextureInitRange { @@ -494,12 +492,8 @@ fn handle_src_texture_init( device: &Device, source: &ImageCopyTexture, copy_size: &Extent3d, - texture_guard: &Storage, TextureId>, + texture: &Arc>, ) -> Result<(), TransferError> { - let _ = texture_guard - .get(source.texture) - .map_err(|_| TransferError::InvalidTexture(source.texture))?; - handle_texture_init( MemoryInitKind::NeedsInitializedMemory, encoder, @@ -508,7 +502,7 @@ fn handle_src_texture_init( device, source, copy_size, - texture_guard, + texture, ); Ok(()) } @@ -524,12 +518,8 @@ fn handle_dst_texture_init( device: &Device, destination: &ImageCopyTexture, copy_size: &Extent3d, - texture_guard: &Storage, TextureId>, + texture: &Arc>, ) -> Result<(), TransferError> { - let texture = texture_guard - .get(destination.texture) - .map_err(|_| TransferError::InvalidTexture(destination.texture))?; - // Attention: If we don't write full texture subresources, we need to a full // clear first since we don't track subrects. This means that in rare cases // even a *destination* texture of a transfer may need an immediate texture @@ -552,7 +542,7 @@ fn handle_dst_texture_init( device, destination, copy_size, - texture_guard, + texture, ); Ok(()) } @@ -764,14 +754,13 @@ impl Global { let buffer_memory_init_actions = &mut cmd_buf_data.buffer_memory_init_actions; let texture_memory_actions = &mut cmd_buf_data.texture_memory_actions; - let texture_guard = hub.textures.read(); - if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 { log::trace!("Ignoring copy_buffer_to_texture of size 0"); return Ok(()); } - let dst_texture = texture_guard + let dst_texture = hub + .textures .get(destination.texture) .map_err(|_| TransferError::InvalidTexture(destination.texture))?; @@ -782,7 +771,7 @@ impl Global { copy_size, )?; - let (dst_range, dst_base) = extract_texture_selector(destination, copy_size, dst_texture)?; + let (dst_range, dst_base) = extract_texture_selector(destination, copy_size, &dst_texture)?; // Handle texture init *before* dealing with barrier transitions so we // have an easier time inserting "immediate-inits" that may be required @@ -794,7 +783,7 @@ impl Global { device, destination, copy_size, - &texture_guard, + &dst_texture, )?; let snatch_guard = device.snatchable_lock.read(); @@ -820,20 +809,17 @@ impl Global { let dst_pending = tracker .textures - .set_single(dst_texture, dst_range, hal::TextureUses::COPY_DST) + .set_single(&dst_texture, dst_range, hal::TextureUses::COPY_DST) .ok_or(TransferError::InvalidTexture(destination.texture))?; - let dst_inner = dst_texture.inner(); - let dst_raw = dst_inner - .as_ref() - .unwrap() - .as_raw() + let dst_raw = dst_texture + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(destination.texture))?; if !dst_texture.desc.usage.contains(TextureUsages::COPY_DST) { return Err( TransferError::MissingCopyDstUsageFlag(None, Some(destination.texture)).into(), ); } - let dst_barrier = dst_pending.map(|pending| pending.into_hal(dst_inner.as_ref().unwrap())); + let dst_barrier = dst_pending.map(|pending| pending.into_hal(dst_raw)); if !dst_base.aspect.is_one() { return Err(TransferError::CopyAspectNotOne.into()); @@ -928,21 +914,20 @@ impl Global { let buffer_memory_init_actions = &mut cmd_buf_data.buffer_memory_init_actions; let texture_memory_actions = &mut cmd_buf_data.texture_memory_actions; - let texture_guard = hub.textures.read(); - if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 { log::trace!("Ignoring copy_texture_to_buffer of size 0"); return Ok(()); } - let src_texture = texture_guard + let src_texture = hub + .textures .get(source.texture) .map_err(|_| TransferError::InvalidTexture(source.texture))?; let (hal_copy_size, array_layer_count) = validate_texture_copy_range(source, &src_texture.desc, CopySide::Source, copy_size)?; - let (src_range, src_base) = extract_texture_selector(source, copy_size, src_texture)?; + let (src_range, src_base) = extract_texture_selector(source, copy_size, &src_texture)?; // Handle texture init *before* dealing with barrier transitions so we // have an easier time inserting "immediate-inits" that may be required @@ -954,20 +939,17 @@ impl Global { device, source, copy_size, - &texture_guard, + &src_texture, )?; let snatch_guard = device.snatchable_lock.read(); let src_pending = tracker .textures - .set_single(src_texture, src_range, hal::TextureUses::COPY_SRC) + .set_single(&src_texture, src_range, hal::TextureUses::COPY_SRC) .ok_or(TransferError::InvalidTexture(source.texture))?; - let src_inner = src_texture.inner(); - let src_raw = src_inner - .as_ref() - .unwrap() - .as_raw() + let src_raw = src_texture + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(source.texture))?; if !src_texture.desc.usage.contains(TextureUsages::COPY_SRC) { return Err(TransferError::MissingCopySrcUsageFlag.into()); @@ -985,7 +967,7 @@ impl Global { } .into()); } - let src_barrier = src_pending.map(|pending| pending.into_hal(src_inner.as_ref().unwrap())); + let src_barrier = src_pending.map(|pending| pending.into_hal(src_raw)); let (dst_buffer, dst_pending) = { let buffer_guard = hub.buffers.read(); @@ -1089,6 +1071,8 @@ impl Global { return Err(TransferError::InvalidDevice(cmd_buf.device.as_info().id()).into()); } + let snatch_guard = device.snatchable_lock.read(); + let mut cmd_buf_data = cmd_buf.data.lock(); let cmd_buf_data = cmd_buf_data.as_mut().unwrap(); @@ -1104,21 +1088,19 @@ impl Global { let tracker = &mut cmd_buf_data.trackers; let texture_memory_actions = &mut cmd_buf_data.texture_memory_actions; - let texture_guard = hub.textures.read(); - if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 { log::trace!("Ignoring copy_texture_to_texture of size 0"); return Ok(()); } - let src_texture = texture_guard + let src_texture = hub + .textures .get(source.texture) .map_err(|_| TransferError::InvalidTexture(source.texture))?; - let src_inner = src_texture.inner(); - let dst_texture = texture_guard + let dst_texture = hub + .textures .get(destination.texture) .map_err(|_| TransferError::InvalidTexture(source.texture))?; - let dst_inner = dst_texture.inner(); // src and dst texture format must be copy-compatible // https://gpuweb.github.io/gpuweb/#copy-compatible @@ -1141,9 +1123,9 @@ impl Global { copy_size, )?; - let (src_range, src_tex_base) = extract_texture_selector(source, copy_size, src_texture)?; + let (src_range, src_tex_base) = extract_texture_selector(source, copy_size, &src_texture)?; let (dst_range, dst_tex_base) = - extract_texture_selector(destination, copy_size, dst_texture)?; + extract_texture_selector(destination, copy_size, &dst_texture)?; let src_texture_aspects = hal::FormatAspects::from(src_texture.desc.format); let dst_texture_aspects = hal::FormatAspects::from(dst_texture.desc.format); if src_tex_base.aspect != src_texture_aspects { @@ -1163,7 +1145,7 @@ impl Global { device, source, copy_size, - &texture_guard, + &src_texture, )?; handle_dst_texture_init( encoder, @@ -1172,18 +1154,16 @@ impl Global { device, destination, copy_size, - &texture_guard, + &dst_texture, )?; let src_pending = cmd_buf_data .trackers .textures - .set_single(src_texture, src_range, hal::TextureUses::COPY_SRC) + .set_single(&src_texture, src_range, hal::TextureUses::COPY_SRC) .ok_or(TransferError::InvalidTexture(source.texture))?; - let src_raw = src_inner - .as_ref() - .unwrap() - .as_raw() + let src_raw = src_texture + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(source.texture))?; if !src_texture.desc.usage.contains(TextureUsages::COPY_SRC) { return Err(TransferError::MissingCopySrcUsageFlag.into()); @@ -1192,18 +1172,16 @@ impl Global { //TODO: try to avoid this the collection. It's needed because both // `src_pending` and `dst_pending` try to hold `trackers.textures` mutably. let mut barriers: ArrayVec<_, 2> = src_pending - .map(|pending| pending.into_hal(src_inner.as_ref().unwrap())) + .map(|pending| pending.into_hal(src_raw)) .collect(); let dst_pending = cmd_buf_data .trackers .textures - .set_single(dst_texture, dst_range, hal::TextureUses::COPY_DST) + .set_single(&dst_texture, dst_range, hal::TextureUses::COPY_DST) .ok_or(TransferError::InvalidTexture(destination.texture))?; - let dst_raw = dst_inner - .as_ref() - .unwrap() - .as_raw() + let dst_raw = dst_texture + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(destination.texture))?; if !dst_texture.desc.usage.contains(TextureUsages::COPY_DST) { return Err( @@ -1211,7 +1189,7 @@ impl Global { ); } - barriers.extend(dst_pending.map(|pending| pending.into_hal(dst_inner.as_ref().unwrap()))); + barriers.extend(dst_pending.map(|pending| pending.into_hal(dst_raw))); let hal_copy_size = hal::CopyExtent { width: src_copy_size.width.min(dst_copy_size.width), diff --git a/third_party/rust/wgpu-core/src/device/bgl.rs b/third_party/rust/wgpu-core/src/device/bgl.rs new file mode 100644 index 0000000000000..b97f87b168096 --- /dev/null +++ b/third_party/rust/wgpu-core/src/device/bgl.rs @@ -0,0 +1,129 @@ +use std::hash::{Hash, Hasher}; + +use crate::{ + binding_model::{self}, + FastIndexMap, +}; + +/// Where a given BGL came from. +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum Origin { + /// The bind group layout was created by the user and is present in the BGL resource pool. + Pool, + /// The bind group layout was derived and is not present in the BGL resource pool. + Derived, +} + +/// A HashMap-like structure that stores a BindGroupLayouts [`wgt::BindGroupLayoutEntry`]s. +/// +/// It is hashable, so bind group layouts can be deduplicated. +#[derive(Debug, Default, Clone, Eq)] +pub struct EntryMap { + /// We use a IndexMap here so that we can sort the entries by their binding index, + /// guarenteeing that the hash of equivilant layouts will be the same. + inner: FastIndexMap, + /// We keep track of whether the map is sorted or not, so that we can assert that + /// it is sorted, so that PartialEq and Hash will be stable. + /// + /// We only need sorted if it is used in a Hash or PartialEq, so we never need + /// to actively sort it. + sorted: bool, +} + +impl PartialEq for EntryMap { + fn eq(&self, other: &Self) -> bool { + self.assert_sorted(); + other.assert_sorted(); + + self.inner == other.inner + } +} + +impl Hash for EntryMap { + fn hash(&self, state: &mut H) { + self.assert_sorted(); + + // We don't need to hash the keys, since they are just extracted from the values. + // + // We know this is stable and will match the behavior of PartialEq as we ensure + // that the array is sorted. + for entry in self.inner.values() { + entry.hash(state); + } + } +} + +impl EntryMap { + fn assert_sorted(&self) { + assert!(self.sorted); + } + + /// Create a new [`BindGroupLayoutEntryMap`] from a slice of [`wgt::BindGroupLayoutEntry`]s. + /// + /// Errors if there are duplicate bindings or if any binding index is greater than + /// the device's limits. + pub fn from_entries( + device_limits: &wgt::Limits, + entries: &[wgt::BindGroupLayoutEntry], + ) -> Result { + let mut inner = FastIndexMap::with_capacity_and_hasher(entries.len(), Default::default()); + for entry in entries { + if entry.binding > device_limits.max_bindings_per_bind_group { + return Err( + binding_model::CreateBindGroupLayoutError::InvalidBindingIndex { + binding: entry.binding, + maximum: device_limits.max_bindings_per_bind_group, + }, + ); + } + if inner.insert(entry.binding, *entry).is_some() { + return Err(binding_model::CreateBindGroupLayoutError::ConflictBinding( + entry.binding, + )); + } + } + inner.sort_unstable_keys(); + + Ok(Self { + inner, + sorted: true, + }) + } + + /// Get the count of [`wgt::BindGroupLayoutEntry`]s in this map. + pub fn len(&self) -> usize { + self.inner.len() + } + + /// Get the [`wgt::BindGroupLayoutEntry`] for the given binding index. + pub fn get(&self, binding: u32) -> Option<&wgt::BindGroupLayoutEntry> { + self.inner.get(&binding) + } + + /// Iterator over all the binding indices in this map. + pub fn indices(&self) -> impl ExactSizeIterator + '_ { + self.inner.keys().copied() + } + + /// Iterator over all the [`wgt::BindGroupLayoutEntry`]s in this map. + pub fn values(&self) -> impl ExactSizeIterator + '_ { + self.inner.values() + } + + pub fn iter(&self) -> impl ExactSizeIterator + '_ { + self.inner.iter() + } + + pub fn is_empty(&self) -> bool { + self.inner.is_empty() + } + + pub fn contains_key(&self, key: u32) -> bool { + self.inner.contains_key(&key) + } + + pub fn entry(&mut self, key: u32) -> indexmap::map::Entry<'_, u32, wgt::BindGroupLayoutEntry> { + self.sorted = false; + self.inner.entry(key) + } +} diff --git a/third_party/rust/wgpu-core/src/device/global.rs b/third_party/rust/wgpu-core/src/device/global.rs index 9575979c8d2e0..fed4b50a5acab 100644 --- a/third_party/rust/wgpu-core/src/device/global.rs +++ b/third_party/rust/wgpu-core/src/device/global.rs @@ -3,8 +3,8 @@ use crate::device::trace; use crate::{ api_log, binding_model, command, conv, device::{ - life::WaitIdleError, map_buffer, queue, DeviceError, DeviceLostClosure, DeviceLostReason, - HostMap, IMPLICIT_BIND_GROUP_LAYOUT_ERROR_LABEL, + bgl, life::WaitIdleError, map_buffer, queue, DeviceError, DeviceLostClosure, + DeviceLostReason, HostMap, IMPLICIT_BIND_GROUP_LAYOUT_ERROR_LABEL, }, global::Global, hal_api::HalApi, @@ -16,7 +16,7 @@ use crate::{ resource::{self, BufferAccessResult}, resource::{BufferAccessError, BufferMapOperation, CreateBufferError, Resource}, validation::check_buffer_usage, - FastHashMap, Label, LabelHelpers as _, + Label, LabelHelpers as _, }; use arrayvec::ArrayVec; @@ -487,12 +487,11 @@ impl Global { let hub = A::hub(self); - let buffer = { - let mut buffer_guard = hub.buffers.write(); - buffer_guard - .get_and_mark_destroyed(buffer_id) - .map_err(|_| resource::DestroyError::Invalid)? - }; + let buffer = hub + .buffers + .write() + .get_and_mark_destroyed(buffer_id) + .map_err(|_| resource::DestroyError::Invalid)?; let _ = buffer.unmap(); @@ -683,8 +682,7 @@ impl Global { let fid = hub.buffers.prepare::(id_in); let error = loop { - let device_guard = hub.devices.read(); - let device = match device_guard.get(device_id) { + let device = match hub.devices.get(device_id) { Ok(device) => device, Err(_) => break DeviceError::Invalid.into(), }; @@ -732,39 +730,13 @@ impl Global { let hub = A::hub(self); - let mut texture_guard = hub.textures.write(); - let texture = texture_guard + let texture = hub + .textures + .write() .get_and_mark_destroyed(texture_id) .map_err(|_| resource::DestroyError::Invalid)?; - let device = &texture.device; - - #[cfg(feature = "trace")] - if let Some(ref mut trace) = *device.trace.lock() { - trace.add(trace::Action::FreeTexture(texture_id)); - } - - let last_submit_index = texture.info.submission_index(); - - if let resource::TextureInner::Native { ref raw } = *texture.inner().as_ref().unwrap() { - if !raw.is_none() { - let temp = queue::TempResource::Texture(texture.clone()); - let mut guard = device.pending_writes.lock(); - let pending_writes = guard.as_mut().unwrap(); - if pending_writes.dst_textures.contains_key(&texture_id) { - pending_writes.temp_resources.push(temp); - } else { - drop(guard); - device - .lock_life() - .schedule_resource_destruction(temp, last_submit_index); - } - } else { - return Err(resource::DestroyError::AlreadyDestroyed); - } - } - - Ok(()) + texture.destroy() } pub fn texture_drop(&self, texture_id: id::TextureId, wait: bool) { @@ -962,7 +934,7 @@ impl Global { let hub = A::hub(self); let fid = hub.bind_group_layouts.prepare::(id_in); - let error = 'outer: loop { + let error = loop { let device = match hub.devices.get(device_id) { Ok(device) => device, Err(_) => break DeviceError::Invalid.into(), @@ -976,38 +948,50 @@ impl Global { trace.add(trace::Action::CreateBindGroupLayout(fid.id(), desc.clone())); } - let mut entry_map = FastHashMap::default(); - for entry in desc.entries.iter() { - if entry.binding > device.limits.max_bindings_per_bind_group { - break 'outer binding_model::CreateBindGroupLayoutError::InvalidBindingIndex { - binding: entry.binding, - maximum: device.limits.max_bindings_per_bind_group, - }; - } - if entry_map.insert(entry.binding, *entry).is_some() { - break 'outer binding_model::CreateBindGroupLayoutError::ConflictBinding( - entry.binding, - ); - } - } + let entry_map = match bgl::EntryMap::from_entries(&device.limits, &desc.entries) { + Ok(map) => map, + Err(e) => break e, + }; - if let Some((id, layout)) = { - let bgl_guard = hub.bind_group_layouts.read(); - device.deduplicate_bind_group_layout(&entry_map, &*bgl_guard) - } { - api_log!("Reusing BindGroupLayout {layout:?} -> {:?}", id); - let id = fid.assign_existing(&layout); - return (id, None); - } + // Currently we make a distinction between fid.assign and fid.assign_existing. This distinction is incorrect, + // but see https://github.com/gfx-rs/wgpu/issues/4912. + // + // `assign` also registers the ID with the resource info, so it can be automatically reclaimed. This needs to + // happen with a mutable reference, which means it can only happen on creation. + // + // Because we need to call `assign` inside the closure (to get mut access), we need to "move" the future id into the closure. + // Rust cannot figure out at compile time that we only ever consume the ID once, so we need to move the check + // to runtime using an Option. + let mut fid = Some(fid); + + // The closure might get called, and it might give us an ID. Side channel it out of the closure. + let mut id = None; + + let bgl_result = device.bgl_pool.get_or_init(entry_map, |entry_map| { + let bgl = + device.create_bind_group_layout(&desc.label, entry_map, bgl::Origin::Pool)?; - let layout = match device.create_bind_group_layout(&desc.label, entry_map) { + let (id_inner, arc) = fid.take().unwrap().assign(bgl); + id = Some(id_inner); + + Ok(arc) + }); + + let layout = match bgl_result { Ok(layout) => layout, Err(e) => break e, }; - let (id, _layout) = fid.assign(layout); + // If the ID was not assigned, and we survived the above check, + // it means that the bind group layout already existed and we need to call `assign_existing`. + // + // Calling this function _will_ leak the ID. See https://github.com/gfx-rs/wgpu/issues/4912. + if id.is_none() { + id = Some(fid.take().unwrap().assign_existing(&layout)) + } + api_log!("Device::create_bind_group_layout -> {id:?}"); - return (id, None); + return (id.unwrap(), None); }; let fid = hub.bind_group_layouts.prepare::(id_in); @@ -1063,12 +1047,9 @@ impl Global { trace.add(trace::Action::CreatePipelineLayout(fid.id(), desc.clone())); } - let layout = { - let bgl_guard = hub.bind_group_layouts.read(); - match device.create_pipeline_layout(desc, &*bgl_guard) { - Ok(layout) => layout, - Err(e) => break e, - } + let layout = match device.create_pipeline_layout(desc, &hub.bind_group_layouts) { + Ok(layout) => layout, + Err(e) => break e, }; let (id, _) = fid.assign(layout); @@ -1124,8 +1105,7 @@ impl Global { trace.add(trace::Action::CreateBindGroup(fid.id(), desc.clone())); } - let bind_group_layout_guard = hub.bind_group_layouts.read(); - let bind_group_layout = match bind_group_layout_guard.get(desc.layout) { + let bind_group_layout = match hub.bind_group_layouts.get(desc.layout) { Ok(layout) => layout, Err(..) => break binding_model::CreateBindGroupError::InvalidLayout, }; @@ -1134,7 +1114,7 @@ impl Global { break DeviceError::WrongDevice.into(); } - let bind_group = match device.create_bind_group(bind_group_layout, desc, hub) { + let bind_group = match device.create_bind_group(&bind_group_layout, desc, hub) { Ok(bind_group) => bind_group, Err(e) => break e, }; @@ -1767,9 +1747,7 @@ impl Global { let hub = A::hub(self); let error = loop { - let pipeline_guard = hub.compute_pipelines.read(); - - let pipeline = match pipeline_guard.get(pipeline_id) { + let pipeline = match hub.compute_pipelines.get(pipeline_id) { Ok(pipeline) => pipeline, Err(_) => break binding_model::GetBindGroupLayoutError::InvalidPipeline, }; diff --git a/third_party/rust/wgpu-core/src/device/life.rs b/third_party/rust/wgpu-core/src/device/life.rs index 08e75ce00a57c..1a533cfb38230 100644 --- a/third_party/rust/wgpu-core/src/device/life.rs +++ b/third_party/rust/wgpu-core/src/device/life.rs @@ -15,8 +15,8 @@ use crate::{ }, pipeline::{ComputePipeline, RenderPipeline}, resource::{ - self, Buffer, DestroyedBuffer, QuerySet, Resource, Sampler, StagingBuffer, Texture, - TextureView, + self, Buffer, DestroyedBuffer, DestroyedTexture, QuerySet, Resource, Sampler, + StagingBuffer, Texture, TextureView, }, track::{ResourceTracker, Tracker}, FastHashMap, SubmissionIndex, @@ -43,6 +43,7 @@ pub(crate) struct ResourceMaps { pub render_bundles: FastHashMap>>, pub query_sets: FastHashMap>>, pub destroyed_buffers: FastHashMap>>, + pub destroyed_textures: FastHashMap>>, } impl ResourceMaps { @@ -61,6 +62,7 @@ impl ResourceMaps { render_bundles: FastHashMap::default(), query_sets: FastHashMap::default(), destroyed_buffers: FastHashMap::default(), + destroyed_textures: FastHashMap::default(), } } @@ -79,6 +81,7 @@ impl ResourceMaps { render_bundles, query_sets, destroyed_buffers, + destroyed_textures, } = self; buffers.clear(); staging_buffers.clear(); @@ -93,6 +96,7 @@ impl ResourceMaps { render_bundles.clear(); query_sets.clear(); destroyed_buffers.clear(); + destroyed_textures.clear(); } pub(crate) fn extend(&mut self, mut other: Self) { @@ -110,6 +114,7 @@ impl ResourceMaps { render_bundles, query_sets, destroyed_buffers, + destroyed_textures, } = self; buffers.extend(other.buffers.drain()); staging_buffers.extend(other.staging_buffers.drain()); @@ -124,6 +129,7 @@ impl ResourceMaps { render_bundles.extend(other.render_bundles.drain()); query_sets.extend(other.query_sets.drain()); destroyed_buffers.extend(other.destroyed_buffers.drain()); + destroyed_textures.extend(other.destroyed_textures.drain()); } } @@ -298,6 +304,11 @@ impl LifetimeTracker { TempResource::Texture(raw) => { last_resources.textures.insert(raw.as_info().id(), raw); } + TempResource::DestroyedTexture(destroyed) => { + last_resources + .destroyed_textures + .insert(destroyed.id, destroyed); + } } } @@ -404,6 +415,9 @@ impl LifetimeTracker { TempResource::Texture(raw) => { resources.textures.insert(raw.as_info().id(), raw); } + TempResource::DestroyedTexture(destroyed) => { + resources.destroyed_textures.insert(destroyed.id, destroyed); + } } } @@ -680,6 +694,27 @@ impl LifetimeTracker { } } + fn triage_suspected_destroyed_textures( + &mut self, + #[cfg(feature = "trace")] trace: &mut Option<&mut trace::Trace>, + ) { + for (id, texture) in self.suspected_resources.destroyed_textures.drain() { + let submit_index = texture.submission_index; + if let Some(resources) = self.active.iter_mut().find(|a| a.index == submit_index) { + resources + .last_resources + .destroyed_textures + .insert(id, texture); + } else { + self.free_resources.destroyed_textures.insert(id, texture); + } + #[cfg(feature = "trace")] + if let Some(ref mut t) = *trace { + t.add(trace::Action::DestroyTexture(id)); + } + } + } + fn triage_suspected_compute_pipelines( &mut self, trackers: &Mutex>, @@ -913,6 +948,10 @@ impl LifetimeTracker { #[cfg(feature = "trace")] &mut trace, ); + self.triage_suspected_destroyed_textures( + #[cfg(feature = "trace")] + &mut trace, + ); } /// Determine which buffers are ready to map, and which must wait for the diff --git a/third_party/rust/wgpu-core/src/device/mod.rs b/third_party/rust/wgpu-core/src/device/mod.rs index 0bfa90458a5c4..bb0afedafc5f5 100644 --- a/third_party/rust/wgpu-core/src/device/mod.rs +++ b/third_party/rust/wgpu-core/src/device/mod.rs @@ -19,6 +19,7 @@ use wgt::{BufferAddress, DeviceLostReason, TextureFormat}; use std::{iter, num::NonZeroU32, ptr}; pub mod any_device; +pub(crate) mod bgl; pub mod global; mod life; pub mod queue; diff --git a/third_party/rust/wgpu-core/src/device/queue.rs b/third_party/rust/wgpu-core/src/device/queue.rs index 5dff3a19abdba..249935bffeae8 100644 --- a/third_party/rust/wgpu-core/src/device/queue.rs +++ b/third_party/rust/wgpu-core/src/device/queue.rs @@ -16,8 +16,8 @@ use crate::{ identity::{GlobalIdentityHandlerFactory, Input}, init_tracker::{has_copy_partial_init_tracker_coverage, TextureInitRange}, resource::{ - Buffer, BufferAccessError, BufferMapState, DestroyedBuffer, Resource, ResourceInfo, - ResourceType, StagingBuffer, Texture, TextureInner, + Buffer, BufferAccessError, BufferMapState, DestroyedBuffer, DestroyedTexture, Resource, + ResourceInfo, ResourceType, StagingBuffer, Texture, TextureInner, }, resource_log, track, FastHashMap, SubmissionIndex, }; @@ -164,6 +164,7 @@ pub enum TempResource { Buffer(Arc>), StagingBuffer(Arc>), DestroyedBuffer(Arc>), + DestroyedTexture(Arc>), Texture(Arc>), } @@ -740,7 +741,7 @@ impl Global { // doesn't really matter because we need this only if we copy // more than one layer, and then we validate for this being not // None - size.height, + height_blocks, ); let block_size = dst @@ -802,6 +803,8 @@ impl Global { } } + let snatch_guard = device.snatchable_lock.read(); + // Re-get `dst` immutably here, so that the mutable borrow of the // `texture_guard.get` above ends in time for the `clear_texture` // call above. Since we've held `texture_guard` the whole time, we know @@ -810,11 +813,8 @@ impl Global { dst.info .use_at(device.active_submission_index.load(Ordering::Relaxed) + 1); - let dst_inner = dst.inner(); - let dst_raw = dst_inner - .as_ref() - .unwrap() - .as_raw() + let dst_raw = dst + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(destination.texture))?; let bytes_per_row = data_layout @@ -897,9 +897,7 @@ impl Global { .set_single(&dst, selector, hal::TextureUses::COPY_DST) .ok_or(TransferError::InvalidTexture(destination.texture))?; unsafe { - encoder.transition_textures( - transition.map(|pending| pending.into_hal(dst_inner.as_ref().unwrap())), - ); + encoder.transition_textures(transition.map(|pending| pending.into_hal(dst_raw))); encoder.transition_buffers(iter::once(barrier)); encoder.copy_buffer_to_texture(inner_buffer.as_ref().unwrap(), dst_raw, regions); } @@ -1076,11 +1074,9 @@ impl Global { dst.info .use_at(device.active_submission_index.load(Ordering::Relaxed) + 1); - let dst_inner = dst.inner(); - let dst_raw = dst_inner - .as_ref() - .unwrap() - .as_raw() + let snatch_guard = device.snatchable_lock.read(); + let dst_raw = dst + .raw(&snatch_guard) .ok_or(TransferError::InvalidTexture(destination.texture))?; let regions = hal::TextureCopy { @@ -1100,9 +1096,7 @@ impl Global { .textures .set_single(&dst, selector, hal::TextureUses::COPY_DST) .ok_or(TransferError::InvalidTexture(destination.texture))?; - encoder.transition_textures( - transitions.map(|pending| pending.into_hal(dst_inner.as_ref().unwrap())), - ); + encoder.transition_textures(transitions.map(|pending| pending.into_hal(dst_raw))); encoder.copy_external_image_to_texture( source, dst_raw, @@ -1238,12 +1232,12 @@ impl Global { } for texture in cmd_buf_trackers.textures.used_resources() { let id = texture.info.id(); - let should_extend = match *texture.inner().as_ref().unwrap() { - TextureInner::Native { raw: None } => { + let should_extend = match texture.inner.get(&snatch_guard) { + None => { return Err(QueueSubmitError::DestroyedTexture(id)); } - TextureInner::Native { raw: Some(_) } => false, - TextureInner::Surface { ref has_work, .. } => { + Some(TextureInner::Native { .. }) => false, + Some(TextureInner::Surface { ref has_work, .. }) => { has_work.store(true, Ordering::Relaxed); true } @@ -1399,11 +1393,12 @@ impl Global { trackers .textures .set_from_usage_scope(&used_surface_textures); - let (transitions, textures) = trackers.textures.drain_transitions(); + let (transitions, textures) = + trackers.textures.drain_transitions(&snatch_guard); let texture_barriers = transitions .into_iter() .enumerate() - .map(|(i, p)| p.into_hal(textures[i].as_ref().unwrap())); + .map(|(i, p)| p.into_hal(textures[i].unwrap().raw().unwrap())); let present = unsafe { baked.encoder.transition_textures(texture_barriers); baked.encoder.end_encoding().unwrap() @@ -1427,16 +1422,14 @@ impl Global { let pending_writes = pending_writes.as_mut().unwrap(); { - let texture_guard = hub.textures.read(); - - used_surface_textures.set_size(texture_guard.len()); + used_surface_textures.set_size(hub.textures.read().len()); for (&id, texture) in pending_writes.dst_textures.iter() { - match *texture.inner().as_ref().unwrap() { - TextureInner::Native { raw: None } => { + match texture.inner.get(&snatch_guard) { + None => { return Err(QueueSubmitError::DestroyedTexture(id)); } - TextureInner::Native { raw: Some(_) } => {} - TextureInner::Surface { ref has_work, .. } => { + Some(TextureInner::Native { .. }) => {} + Some(TextureInner::Surface { ref has_work, .. }) => { has_work.store(true, Ordering::Relaxed); unsafe { used_surface_textures @@ -1453,11 +1446,12 @@ impl Global { trackers .textures .set_from_usage_scope(&used_surface_textures); - let (transitions, textures) = trackers.textures.drain_transitions(); + let (transitions, textures) = + trackers.textures.drain_transitions(&snatch_guard); let texture_barriers = transitions .into_iter() .enumerate() - .map(|(i, p)| p.into_hal(textures[i].as_ref().unwrap())); + .map(|(i, p)| p.into_hal(textures[i].unwrap().raw().unwrap())); unsafe { pending_writes .command_encoder diff --git a/third_party/rust/wgpu-core/src/device/resource.rs b/third_party/rust/wgpu-core/src/device/resource.rs index b89ad9abf0d9f..b212dc575d9a3 100644 --- a/third_party/rust/wgpu-core/src/device/resource.rs +++ b/third_party/rust/wgpu-core/src/device/resource.rs @@ -6,7 +6,7 @@ use crate::{ device::life::{LifetimeTracker, WaitIdleError}, device::queue::PendingWrites, device::{ - AttachmentData, CommandAllocator, DeviceLostInvocation, MissingDownlevelFlags, + bgl, AttachmentData, CommandAllocator, DeviceLostInvocation, MissingDownlevelFlags, MissingFeatures, RenderPassContext, CLEANUP_WAIT_MS, }, hal_api::HalApi, @@ -19,6 +19,7 @@ use crate::{ }, instance::Adapter, pipeline, + pool::ResourcePool, registry::Registry, resource::ResourceInfo, resource::{ @@ -120,6 +121,8 @@ pub struct Device { /// Temporary storage for resource management functions. Cleared at the end /// of every call (unless an error occurs). pub(crate) temp_suspected: Mutex>>, + /// Pool of bind group layouts, allowing deduplication. + pub(crate) bgl_pool: ResourcePool>, pub(crate) alignments: hal::Alignments, pub(crate) limits: wgt::Limits, pub(crate) features: wgt::Features, @@ -261,6 +264,7 @@ impl Device { trackers: Mutex::new(Tracker::new()), life_tracker: Mutex::new(life::LifetimeTracker::new()), temp_suspected: Mutex::new(Some(life::ResourceMaps::new())), + bgl_pool: ResourcePool::new(), #[cfg(feature = "trace")] trace: Mutex::new(trace_path.and_then(|path| match trace::Trace::new(path) { Ok(mut trace) => { @@ -583,9 +587,7 @@ impl Device { debug_assert_eq!(self.as_info().id().backend(), A::VARIANT); Texture { - inner: RwLock::new(Some(resource::TextureInner::Native { - raw: Some(hal_texture), - })), + inner: Snatchable::new(resource::TextureInner::Native { raw: hal_texture }), device: self.clone(), desc: desc.map_label(|_| ()), hal_usage, @@ -903,15 +905,14 @@ impl Device { texture: &Arc>, desc: &resource::TextureViewDescriptor, ) -> Result, resource::CreateTextureViewError> { - let inner = texture.inner(); - let texture_raw = inner - .as_ref() - .unwrap() - .as_raw() + let snatch_guard = texture.device.snatchable_lock.read(); + + let texture_raw = texture + .raw(&snatch_guard) .ok_or(resource::CreateTextureViewError::InvalidTexture)?; + // resolve TextureViewDescriptor defaults // https://gpuweb.github.io/gpuweb/#abstract-opdef-resolving-gputextureviewdescriptor-defaults - let resolved_format = desc.format.unwrap_or_else(|| { texture .desc @@ -1513,29 +1514,6 @@ impl Device { }) } - pub(crate) fn deduplicate_bind_group_layout<'a>( - self: &Arc, - entry_map: &'a binding_model::BindEntryMap, - guard: &'a Storage, id::BindGroupLayoutId>, - ) -> Option<(id::BindGroupLayoutId, Arc>)> { - guard - .iter(self.as_info().id().backend()) - .find(|&(_, bgl)| { - bgl.device.info.id() == self.as_info().id() && bgl.entries == *entry_map - }) - .map(|(id, resource)| (id, resource.clone())) - } - - pub(crate) fn get_introspection_bind_group_layouts<'a>( - pipeline_layout: &'a binding_model::PipelineLayout, - ) -> ArrayVec<&'a binding_model::BindEntryMap, { hal::MAX_BIND_GROUPS }> { - pipeline_layout - .bind_group_layouts - .iter() - .map(|layout| &layout.entries) - .collect() - } - /// Generate information about late-validated buffer bindings for pipelines. //TODO: should this be combined with `get_introspection_bind_group_layouts` in some way? pub(crate) fn make_late_sized_buffer_groups( @@ -1576,7 +1554,8 @@ impl Device { pub(crate) fn create_bind_group_layout( self: &Arc, label: &crate::Label, - entry_map: binding_model::BindEntryMap, + entry_map: bgl::EntryMap, + origin: bgl::Origin, ) -> Result, binding_model::CreateBindGroupLayoutError> { #[derive(PartialEq)] enum WritableStorage { @@ -1739,9 +1718,8 @@ impl Device { let bgl_flags = conv::bind_group_layout_flags(self.features); - let mut hal_bindings = entry_map.values().cloned().collect::>(); + let hal_bindings = entry_map.values().copied().collect::>(); let label = label.to_hal(self.instance_flags); - hal_bindings.sort_by_key(|b| b.binding); let hal_desc = hal::BindGroupLayoutDescriptor { label, flags: bgl_flags, @@ -1768,13 +1746,10 @@ impl Device { Ok(BindGroupLayout { raw: Some(raw), device: self.clone(), - info: ResourceInfo::new(label.unwrap_or("")), - dynamic_count: entry_map - .values() - .filter(|b| b.ty.has_dynamic_offset()) - .count(), - count_validator, entries: entry_map, + origin, + binding_count_validator: count_validator, + info: ResourceInfo::new(label.unwrap_or("")), label: label.unwrap_or_default().to_string(), }) } @@ -1996,7 +1971,7 @@ impl Device { // Find the corresponding declaration in the layout let decl = layout .entries - .get(&binding) + .get(binding) .ok_or(Error::MissingBindingDeclaration(binding))?; let (res_index, count) = match entry.resource { Br::Buffer(ref bb) => { @@ -2206,8 +2181,8 @@ impl Device { // collect in the order of BGL iteration late_buffer_binding_sizes: layout .entries - .keys() - .flat_map(|binding| late_buffer_binding_sizes.get(binding).cloned()) + .indices() + .flat_map(|binding| late_buffer_binding_sizes.get(&binding).cloned()) .collect(), }) } @@ -2379,7 +2354,7 @@ impl Device { pub(crate) fn create_pipeline_layout( self: &Arc, desc: &binding_model::PipelineLayoutDescriptor, - bgl_guard: &Storage, id::BindGroupLayoutId>, + bgl_registry: &Registry>, ) -> Result, binding_model::CreatePipelineLayoutError> { use crate::binding_model::CreatePipelineLayoutError as Error; @@ -2432,31 +2407,38 @@ impl Device { let mut count_validator = binding_model::BindingTypeMaxCountValidator::default(); - // validate total resource counts + // Collect references to the BGLs + let mut bind_group_layouts = ArrayVec::new(); for &id in desc.bind_group_layouts.iter() { - let Ok(bind_group_layout) = bgl_guard.get(id) else { + let Ok(bgl) = bgl_registry.get(id) else { return Err(Error::InvalidBindGroupLayout(id)); }; - if bind_group_layout.device.as_info().id() != self.as_info().id() { + bind_group_layouts.push(bgl); + } + + // Validate total resource counts and check for a matching device + for bgl in &bind_group_layouts { + if bgl.device.as_info().id() != self.as_info().id() { return Err(DeviceError::WrongDevice.into()); } - count_validator.merge(&bind_group_layout.count_validator); + count_validator.merge(&bgl.binding_count_validator); } + count_validator .validate(&self.limits) .map_err(Error::TooManyBindings)?; - let bgl_vec = desc - .bind_group_layouts + let raw_bind_group_layouts = bind_group_layouts .iter() - .map(|&id| bgl_guard.get(id).unwrap().raw()) - .collect::>(); + .map(|bgl| bgl.raw()) + .collect::>(); + let hal_desc = hal::PipelineLayoutDescriptor { label: desc.label.to_hal(self.instance_flags), flags: hal::PipelineLayoutFlags::FIRST_VERTEX_INSTANCE, - bind_group_layouts: &bgl_vec, + bind_group_layouts: &raw_bind_group_layouts, push_constant_ranges: desc.push_constant_ranges.as_ref(), }; @@ -2468,15 +2450,13 @@ impl Device { .map_err(DeviceError::from)? }; + drop(raw_bind_group_layouts); + Ok(binding_model::PipelineLayout { raw: Some(raw), device: self.clone(), info: ResourceInfo::new(desc.label.borrow_or_default()), - bind_group_layouts: desc - .bind_group_layouts - .iter() - .map(|&id| bgl_guard.get(id).unwrap().clone()) - .collect(), + bind_group_layouts, push_constant_ranges: desc.push_constant_ranges.iter().cloned().collect(), }) } @@ -2486,10 +2466,10 @@ impl Device { pub(crate) fn derive_pipeline_layout( self: &Arc, implicit_context: Option, - mut derived_group_layouts: ArrayVec, + mut derived_group_layouts: ArrayVec, bgl_registry: &Registry>, pipeline_layout_registry: &Registry>, - ) -> Result { + ) -> Result>, pipeline::ImplicitLayoutError> { while derived_group_layouts .last() .map_or(false, |map| map.is_empty()) @@ -2508,16 +2488,8 @@ impl Device { } for (bgl_id, map) in ids.group_ids.iter_mut().zip(derived_group_layouts) { - let bgl = match self.deduplicate_bind_group_layout(&map, &bgl_registry.read()) { - Some((dedup_id, _)) => { - *bgl_id = dedup_id; - None - } - None => Some(self.create_bind_group_layout(&None, map)?), - }; - if let Some(bgl) = bgl { - bgl_registry.force_replace(*bgl_id, bgl); - } + let bgl = self.create_bind_group_layout(&None, map, bgl::Origin::Derived)?; + bgl_registry.force_replace(*bgl_id, bgl); } let layout_desc = binding_model::PipelineLayoutDescriptor { @@ -2525,9 +2497,9 @@ impl Device { bind_group_layouts: Cow::Borrowed(&ids.group_ids[..group_count]), push_constant_ranges: Cow::Borrowed(&[]), //TODO? }; - let layout = self.create_pipeline_layout(&layout_desc, &bgl_registry.read())?; + let layout = self.create_pipeline_layout(&layout_desc, bgl_registry)?; pipeline_layout_registry.force_replace(ids.root_id, layout); - Ok(ids.root_id) + Ok(pipeline_layout_registry.get(ids.root_id).unwrap()) } pub(crate) fn create_compute_pipeline( @@ -2549,12 +2521,6 @@ impl Device { self.require_downlevel_flags(wgt::DownlevelFlags::COMPUTE_SHADERS)?; - let mut derived_group_layouts = - ArrayVec::::new(); - let mut shader_binding_sizes = FastHashMap::default(); - - let io = validation::StageIo::default(); - let shader_module = hub .shader_modules .get(desc.stage.module) @@ -2564,59 +2530,66 @@ impl Device { return Err(DeviceError::WrongDevice.into()); } - { - let flag = wgt::ShaderStages::COMPUTE; - let pipeline_layout_guard = hub.pipeline_layouts.read(); - let provided_layouts = match desc.layout { - Some(pipeline_layout_id) => Some(Device::get_introspection_bind_group_layouts( - pipeline_layout_guard - .get(pipeline_layout_id) - .map_err(|_| pipeline::CreateComputePipelineError::InvalidLayout)?, - )), - None => { - for _ in 0..self.limits.max_bind_groups { - derived_group_layouts.push(binding_model::BindEntryMap::default()); - } - None + // Get the pipeline layout from the desc if it is provided. + let pipeline_layout = match desc.layout { + Some(pipeline_layout_id) => { + let pipeline_layout = hub + .pipeline_layouts + .get(pipeline_layout_id) + .map_err(|_| pipeline::CreateComputePipelineError::InvalidLayout)?; + + if pipeline_layout.device.as_info().id() != self.as_info().id() { + return Err(DeviceError::WrongDevice.into()); } - }; + + Some(pipeline_layout) + } + None => None, + }; + + let mut binding_layout_source = match pipeline_layout { + Some(ref pipeline_layout) => { + validation::BindingLayoutSource::Provided(pipeline_layout.get_binding_maps()) + } + None => validation::BindingLayoutSource::new_derived(&self.limits), + }; + let mut shader_binding_sizes = FastHashMap::default(); + let io = validation::StageIo::default(); + + { + let stage = wgt::ShaderStages::COMPUTE; + if let Some(ref interface) = shader_module.interface { let _ = interface.check_stage( - provided_layouts.as_ref().map(|p| p.as_slice()), - &mut derived_group_layouts, + &mut binding_layout_source, &mut shader_binding_sizes, &desc.stage.entry_point, - flag, + stage, io, None, )?; } } - let pipeline_layout_id = match desc.layout { - Some(id) => id, - None => self.derive_pipeline_layout( + let pipeline_layout = match binding_layout_source { + validation::BindingLayoutSource::Provided(_) => { + drop(binding_layout_source); + pipeline_layout.unwrap() + } + validation::BindingLayoutSource::Derived(entries) => self.derive_pipeline_layout( implicit_context, - derived_group_layouts, + entries, &hub.bind_group_layouts, &hub.pipeline_layouts, )?, }; - let pipeline_layout_guard = hub.pipeline_layouts.read(); - let layout = pipeline_layout_guard - .get(pipeline_layout_id) - .map_err(|_| pipeline::CreateComputePipelineError::InvalidLayout)?; - - if layout.device.as_info().id() != self.as_info().id() { - return Err(DeviceError::WrongDevice.into()); - } let late_sized_buffer_groups = - Device::make_late_sized_buffer_groups(&shader_binding_sizes, layout); + Device::make_late_sized_buffer_groups(&shader_binding_sizes, &pipeline_layout); let pipeline_desc = hal::ComputePipelineDescriptor { label: desc.label.to_hal(self.instance_flags), - layout: layout.raw(), + layout: pipeline_layout.raw(), stage: hal::ProgrammableStage { entry_point: desc.stage.entry_point.as_ref(), module: shader_module.raw(), @@ -2643,7 +2616,7 @@ impl Device { let pipeline = pipeline::ComputePipeline { raw: Some(raw), - layout: layout.clone(), + layout: pipeline_layout, device: self.clone(), _shader_module: shader_module, late_sized_buffer_groups, @@ -2661,8 +2634,6 @@ impl Device { ) -> Result, pipeline::CreateRenderPipelineError> { use wgt::TextureFormatFeatureFlags as Tfff; - let mut shader_modules = Vec::new(); - // This has to be done first, or otherwise the IDs may be pointing to entries // that are not even in the storage. if let Some(ref ids) = implicit_context { @@ -2675,8 +2646,6 @@ impl Device { } } - let mut derived_group_layouts = - ArrayVec::::new(); let mut shader_binding_sizes = FastHashMap::default(); let num_attachments = desc.fragment.as_ref().map(|f| f.targets.len()).unwrap_or(0); @@ -2944,11 +2913,29 @@ impl Device { } } - if desc.layout.is_none() { - for _ in 0..self.limits.max_bind_groups { - derived_group_layouts.push(binding_model::BindEntryMap::default()); + // Get the pipeline layout from the desc if it is provided. + let pipeline_layout = match desc.layout { + Some(pipeline_layout_id) => { + let pipeline_layout = hub + .pipeline_layouts + .get(pipeline_layout_id) + .map_err(|_| pipeline::CreateRenderPipelineError::InvalidLayout)?; + + if pipeline_layout.device.as_info().id() != self.as_info().id() { + return Err(DeviceError::WrongDevice.into()); + } + + Some(pipeline_layout) } - } + None => None, + }; + + let mut binding_layout_source = match pipeline_layout { + Some(ref pipeline_layout) => { + validation::BindingLayoutSource::Provided(pipeline_layout.get_binding_maps()) + } + None => validation::BindingLayoutSource::new_derived(&self.limits), + }; let samples = { let sc = desc.multisample.count; @@ -2958,122 +2945,86 @@ impl Device { sc }; - let shader_module_guard = hub.shader_modules.read(); - + let vertex_shader_module; let vertex_stage = { - let stage = &desc.vertex.stage; - let flag = wgt::ShaderStages::VERTEX; + let stage_desc = &desc.vertex.stage; + let stage = wgt::ShaderStages::VERTEX; - let shader_module = shader_module_guard.get(stage.module).map_err(|_| { + vertex_shader_module = hub.shader_modules.get(stage_desc.module).map_err(|_| { pipeline::CreateRenderPipelineError::Stage { - stage: flag, + stage, error: validation::StageError::InvalidModule, } })?; - if shader_module.device.as_info().id() != self.as_info().id() { + if vertex_shader_module.device.as_info().id() != self.as_info().id() { return Err(DeviceError::WrongDevice.into()); } - shader_modules.push(shader_module.clone()); - - let pipeline_layout_guard = hub.pipeline_layouts.read(); - - let provided_layouts = match desc.layout { - Some(pipeline_layout_id) => { - let pipeline_layout = pipeline_layout_guard - .get(pipeline_layout_id) - .map_err(|_| pipeline::CreateRenderPipelineError::InvalidLayout)?; - if pipeline_layout.device.as_info().id() != self.as_info().id() { - return Err(DeviceError::WrongDevice.into()); - } - - Some(Device::get_introspection_bind_group_layouts( - pipeline_layout, - )) - } - None => None, - }; - - if let Some(ref interface) = shader_module.interface { + if let Some(ref interface) = vertex_shader_module.interface { io = interface .check_stage( - provided_layouts.as_ref().map(|p| p.as_slice()), - &mut derived_group_layouts, + &mut binding_layout_source, &mut shader_binding_sizes, - &stage.entry_point, - flag, + &stage_desc.entry_point, + stage, io, desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) - .map_err(|error| pipeline::CreateRenderPipelineError::Stage { - stage: flag, - error, - })?; - validated_stages |= flag; + .map_err(|error| pipeline::CreateRenderPipelineError::Stage { stage, error })?; + validated_stages |= stage; } hal::ProgrammableStage { - module: shader_module.raw(), - entry_point: stage.entry_point.as_ref(), + module: vertex_shader_module.raw(), + entry_point: stage_desc.entry_point.as_ref(), } }; + let mut fragment_shader_module = None; let fragment_stage = match desc.fragment { - Some(ref fragment) => { - let flag = wgt::ShaderStages::FRAGMENT; + Some(ref fragment_state) => { + let stage = wgt::ShaderStages::FRAGMENT; - let shader_module = - shader_module_guard - .get(fragment.stage.module) + let shader_module = fragment_shader_module.insert( + hub.shader_modules + .get(fragment_state.stage.module) .map_err(|_| pipeline::CreateRenderPipelineError::Stage { - stage: flag, + stage, error: validation::StageError::InvalidModule, - })?; - shader_modules.push(shader_module.clone()); - - let pipeline_layout_guard = hub.pipeline_layouts.read(); - let provided_layouts = match desc.layout { - Some(pipeline_layout_id) => Some(Device::get_introspection_bind_group_layouts( - pipeline_layout_guard - .get(pipeline_layout_id) - .as_ref() - .map_err(|_| pipeline::CreateRenderPipelineError::InvalidLayout)?, - )), - None => None, - }; + })?, + ); if validated_stages == wgt::ShaderStages::VERTEX { if let Some(ref interface) = shader_module.interface { io = interface .check_stage( - provided_layouts.as_ref().map(|p| p.as_slice()), - &mut derived_group_layouts, + &mut binding_layout_source, &mut shader_binding_sizes, - &fragment.stage.entry_point, - flag, + &fragment_state.stage.entry_point, + stage, io, desc.depth_stencil.as_ref().map(|d| d.depth_compare), ) .map_err(|error| pipeline::CreateRenderPipelineError::Stage { - stage: flag, + stage, error, })?; - validated_stages |= flag; + validated_stages |= stage; } } if let Some(ref interface) = shader_module.interface { shader_expects_dual_source_blending = interface - .fragment_uses_dual_source_blending(&fragment.stage.entry_point) + .fragment_uses_dual_source_blending(&fragment_state.stage.entry_point) .map_err(|error| pipeline::CreateRenderPipelineError::Stage { - stage: flag, + stage, error, })?; } Some(hal::ProgrammableStage { module: shader_module.raw(), - entry_point: fragment.stage.entry_point.as_ref(), + entry_point: fragment_state.stage.entry_point.as_ref(), }) } None => None, @@ -3126,22 +3077,18 @@ impl Device { return Err(pipeline::ImplicitLayoutError::ReflectionError(last_stage).into()); } - let pipeline_layout_id = match desc.layout { - Some(id) => id, - None => self.derive_pipeline_layout( + let pipeline_layout = match binding_layout_source { + validation::BindingLayoutSource::Provided(_) => { + drop(binding_layout_source); + pipeline_layout.unwrap() + } + validation::BindingLayoutSource::Derived(entries) => self.derive_pipeline_layout( implicit_context, - derived_group_layouts, + entries, &hub.bind_group_layouts, &hub.pipeline_layouts, )?, }; - let layout = { - let pipeline_layout_guard = hub.pipeline_layouts.read(); - pipeline_layout_guard - .get(pipeline_layout_id) - .map_err(|_| pipeline::CreateRenderPipelineError::InvalidLayout)? - .clone() - }; // Multiview is only supported if the feature is enabled if desc.multiview.is_some() { @@ -3165,11 +3112,11 @@ impl Device { } let late_sized_buffer_groups = - Device::make_late_sized_buffer_groups(&shader_binding_sizes, &layout); + Device::make_late_sized_buffer_groups(&shader_binding_sizes, &pipeline_layout); let pipeline_desc = hal::RenderPipelineDescriptor { label: desc.label.to_hal(self.instance_flags), - layout: layout.raw(), + layout: pipeline_layout.raw(), vertex_buffers: &vertex_buffers, vertex_stage, primitive: desc.primitive, @@ -3233,9 +3180,16 @@ impl Device { } } + let shader_modules = { + let mut shader_modules = ArrayVec::new(); + shader_modules.push(vertex_shader_module); + shader_modules.extend(fragment_shader_module); + shader_modules + }; + let pipeline = pipeline::RenderPipeline { raw: Some(raw), - layout: layout.clone(), + layout: pipeline_layout, device: self.clone(), pass_context, _shader_modules: shader_modules, @@ -3278,7 +3232,10 @@ impl Device { .contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES); // If we're running downlevel, we need to manually ask the backend what // we can use as we can't trust WebGPU. - let downlevel = !self.downlevel.is_webgpu_compliant(); + let downlevel = !self + .downlevel + .flags + .contains(wgt::DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT); if using_device_features || downlevel { Ok(self.get_texture_format_features(adapter, format)) diff --git a/third_party/rust/wgpu-core/src/hash_utils.rs b/third_party/rust/wgpu-core/src/hash_utils.rs new file mode 100644 index 0000000000000..f44aad2f1a3fd --- /dev/null +++ b/third_party/rust/wgpu-core/src/hash_utils.rs @@ -0,0 +1,86 @@ +//! Module for hashing utilities. +//! +//! Named hash_utils to prevent clashing with the std::hash module. + +/// HashMap using a fast, non-cryptographic hash algorithm. +pub type FastHashMap = + std::collections::HashMap>; +/// HashSet using a fast, non-cryptographic hash algorithm. +pub type FastHashSet = + std::collections::HashSet>; + +/// IndexMap using a fast, non-cryptographic hash algorithm. +pub type FastIndexMap = + indexmap::IndexMap>; + +/// HashMap that uses pre-hashed keys and an identity hasher. +/// +/// This is useful when you only need the key to lookup the value, and don't need to store the key, +/// particularly when the key is large. +pub type PreHashedMap = + std::collections::HashMap, V, std::hash::BuildHasherDefault>; + +/// A pre-hashed key using FxHash which allows the hashing operation to be disconnected +/// from the storage in the map. +pub struct PreHashedKey(u64, std::marker::PhantomData K>); + +impl std::fmt::Debug for PreHashedKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("PreHashedKey").field(&self.0).finish() + } +} + +impl Copy for PreHashedKey {} + +impl Clone for PreHashedKey { + fn clone(&self) -> Self { + *self + } +} + +impl PartialEq for PreHashedKey { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} + +impl Eq for PreHashedKey {} + +impl std::hash::Hash for PreHashedKey { + fn hash(&self, state: &mut H) { + self.0.hash(state); + } +} + +impl PreHashedKey { + pub fn from_key(key: &K) -> Self { + use std::hash::Hasher; + + let mut hasher = rustc_hash::FxHasher::default(); + key.hash(&mut hasher); + Self(hasher.finish(), std::marker::PhantomData) + } +} + +/// A hasher which does nothing. Useful for when you want to use a map with pre-hashed keys. +/// +/// When hashing with this hasher, you must provide exactly 8 bytes. Multiple calls to `write` +/// will overwrite the previous value. +#[derive(Default)] +pub struct IdentityHasher { + hash: u64, +} + +impl std::hash::Hasher for IdentityHasher { + fn write(&mut self, bytes: &[u8]) { + self.hash = u64::from_ne_bytes( + bytes + .try_into() + .expect("identity hasher must be given exactly 8 bytes"), + ); + } + + fn finish(&self) -> u64 { + self.hash + } +} diff --git a/third_party/rust/wgpu-core/src/lib.rs b/third_party/rust/wgpu-core/src/lib.rs index b44248fdae71f..a35fcacec22e0 100644 --- a/third_party/rust/wgpu-core/src/lib.rs +++ b/third_party/rust/wgpu-core/src/lib.rs @@ -84,12 +84,14 @@ pub mod device; pub mod error; pub mod global; pub mod hal_api; +mod hash_utils; pub mod hub; pub mod id; pub mod identity; mod init_tracker; pub mod instance; pub mod pipeline; +mod pool; pub mod present; pub mod registry; pub mod resource; @@ -106,6 +108,8 @@ pub use hal::{api, MAX_BIND_GROUPS, MAX_COLOR_ATTACHMENTS, MAX_VERTEX_BUFFERS}; use std::{borrow::Cow, os::raw::c_char}; +pub(crate) use hash_utils::*; + /// The index of a queue submission. /// /// These are the values stored in `Device::fence`. @@ -335,13 +339,6 @@ macro_rules! resource_log { } pub(crate) use resource_log; -/// Fast hash map used internally. -type FastHashMap = - std::collections::HashMap>; -/// Fast hash set used internally. -type FastHashSet = - std::collections::HashSet>; - #[inline] pub(crate) fn get_lowest_common_denom(a: u32, b: u32) -> u32 { let gcd = if a >= b { diff --git a/third_party/rust/wgpu-core/src/pipeline.rs b/third_party/rust/wgpu-core/src/pipeline.rs index 27a58fd9660ce..1d487a1bfc5f3 100644 --- a/third_party/rust/wgpu-core/src/pipeline.rs +++ b/third_party/rust/wgpu-core/src/pipeline.rs @@ -479,7 +479,8 @@ pub struct RenderPipeline { pub(crate) raw: Option, pub(crate) device: Arc>, pub(crate) layout: Arc>, - pub(crate) _shader_modules: Vec>>, + pub(crate) _shader_modules: + ArrayVec>, { hal::MAX_CONCURRENT_SHADER_STAGES }>, pub(crate) pass_context: RenderPassContext, pub(crate) flags: PipelineFlags, pub(crate) strip_index_format: Option, diff --git a/third_party/rust/wgpu-core/src/pool.rs b/third_party/rust/wgpu-core/src/pool.rs new file mode 100644 index 0000000000000..ddf45fbcb3586 --- /dev/null +++ b/third_party/rust/wgpu-core/src/pool.rs @@ -0,0 +1,312 @@ +use std::{ + collections::{hash_map::Entry, HashMap}, + hash::Hash, + sync::{Arc, Weak}, +}; + +use once_cell::sync::OnceCell; +use parking_lot::Mutex; + +use crate::{PreHashedKey, PreHashedMap}; + +type SlotInner = Weak; +type ResourcePoolSlot = Arc>>; + +pub struct ResourcePool { + // We use a pre-hashed map as we never actually need to read the keys. + // + // This additionally allows us to not need to hash more than once on get_or_init. + inner: Mutex>>, +} + +impl ResourcePool { + pub fn new() -> Self { + Self { + inner: Mutex::new(HashMap::default()), + } + } + + /// Get a resource from the pool with the given entry map, or create a new one if it doesn't exist using the given constructor. + /// + /// Behaves such that only one resource will be created for each unique entry map at any one time. + pub fn get_or_init(&self, key: K, constructor: F) -> Result, E> + where + F: FnOnce(K) -> Result, E>, + { + // Hash the key outside of the lock. + let hashed_key = PreHashedKey::from_key(&key); + + // We can't prove at compile time that these will only ever be consumed once, + // so we need to do the check at runtime. + let mut key = Some(key); + let mut constructor = Some(constructor); + + 'race: loop { + let mut map_guard = self.inner.lock(); + + let entry = match map_guard.entry(hashed_key) { + // An entry exists for this resource. + // + // We know that either: + // - The resource is still alive, and Weak::upgrade will succeed. + // - The resource is in the process of being dropped, and Weak::upgrade will fail. + // + // The entry will never be empty while the BGL is still alive. + Entry::Occupied(entry) => Arc::clone(entry.get()), + // No entry exists for this resource. + // + // We know that the resource is not alive, so we can create a new entry. + Entry::Vacant(entry) => Arc::clone(entry.insert(Arc::new(OnceCell::new()))), + }; + + drop(map_guard); + + // Some other thread may beat us to initializing the entry, but OnceCell guarentees that only one thread + // will actually initialize the entry. + // + // We pass the strong reference outside of the closure to keep it alive while we're the only one keeping a reference to it. + let mut strong = None; + let weak = entry.get_or_try_init(|| { + let strong_inner = constructor.take().unwrap()(key.take().unwrap())?; + let weak = Arc::downgrade(&strong_inner); + strong = Some(strong_inner); + Ok(weak) + })?; + + // If strong is Some, that means we just initialized the entry, so we can just return it. + if let Some(strong) = strong { + return Ok(strong); + } + + // The entry was already initialized by someone else, so we need to try to upgrade it. + if let Some(strong) = weak.upgrade() { + // We succeed, the resource is still alive, just return that. + return Ok(strong); + } + + // The resource is in the process of being dropped, because upgrade failed. The entry still exists in the map, but it points to nothing. + // + // We're in a race with the drop implementation of the resource, so lets just go around again. When we go around again: + // - If the entry exists, we might need to go around a few more times. + // - If the entry doesn't exist, we'll create a new one. + continue 'race; + } + } + + /// Remove the given entry map from the pool. + /// + /// Must *only* be called in the Drop impl of [`BindGroupLayout`]. + pub fn remove(&self, key: &K) { + let hashed_key = PreHashedKey::from_key(key); + + let mut map_guard = self.inner.lock(); + + // Weak::upgrade will be failing long before this code is called. All threads trying to access the resource will be spinning, + // waiting for the entry to be removed. It is safe to remove the entry from the map. + map_guard.remove(&hashed_key); + } +} + +#[cfg(test)] +mod tests { + use std::sync::{ + atomic::{AtomicU32, Ordering}, + Barrier, + }; + + use super::*; + + #[test] + fn deduplication() { + let pool = ResourcePool::::new(); + + let mut counter = 0_u32; + + let arc1 = pool + .get_or_init::<_, ()>(0, |key| { + counter += 1; + Ok(Arc::new(key)) + }) + .unwrap(); + + assert_eq!(*arc1, 0); + assert_eq!(counter, 1); + + let arc2 = pool + .get_or_init::<_, ()>(0, |key| { + counter += 1; + Ok(Arc::new(key)) + }) + .unwrap(); + + assert!(Arc::ptr_eq(&arc1, &arc2)); + assert_eq!(*arc2, 0); + assert_eq!(counter, 1); + + drop(arc1); + drop(arc2); + pool.remove(&0); + + let arc3 = pool + .get_or_init::<_, ()>(0, |key| { + counter += 1; + Ok(Arc::new(key)) + }) + .unwrap(); + + assert_eq!(*arc3, 0); + assert_eq!(counter, 2); + } + + // Test name has "2_threads" in the name so nextest reserves two threads for it. + #[test] + fn concurrent_creation_2_threads() { + struct Resources { + pool: ResourcePool, + counter: AtomicU32, + barrier: Barrier, + } + + let resources = Arc::new(Resources { + pool: ResourcePool::::new(), + counter: AtomicU32::new(0), + barrier: Barrier::new(2), + }); + + // Like all races, this is not inherently guaranteed to work, but in practice it should work fine. + // + // To validate the expected order of events, we've put print statements in the code, indicating when each thread is at a certain point. + // The output will look something like this if the test is working as expected: + // + // ``` + // 0: prewait + // 1: prewait + // 1: postwait + // 0: postwait + // 1: init + // 1: postget + // 0: postget + // ``` + fn thread_inner(idx: u8, resources: &Resources) -> Arc { + eprintln!("{idx}: prewait"); + + // Once this returns, both threads should hit get_or_init at about the same time, + // allowing us to actually test concurrent creation. + // + // Like all races, this is not inherently guaranteed to work, but in practice it should work fine. + resources.barrier.wait(); + + eprintln!("{idx}: postwait"); + + let ret = resources + .pool + .get_or_init::<_, ()>(0, |key| { + eprintln!("{idx}: init"); + + // Simulate long running constructor, ensuring that both threads will be in get_or_init. + std::thread::sleep(std::time::Duration::from_millis(250)); + + resources.counter.fetch_add(1, Ordering::SeqCst); + + Ok(Arc::new(key)) + }) + .unwrap(); + + eprintln!("{idx}: postget"); + + ret + } + + let thread1 = std::thread::spawn({ + let resource_clone = Arc::clone(&resources); + move || thread_inner(1, &resource_clone) + }); + + let arc0 = thread_inner(0, &resources); + + assert_eq!(resources.counter.load(Ordering::Acquire), 1); + + let arc1 = thread1.join().unwrap(); + + assert!(Arc::ptr_eq(&arc0, &arc1)); + } + + // Test name has "2_threads" in the name so nextest reserves two threads for it. + #[test] + fn create_while_drop_2_threads() { + struct Resources { + pool: ResourcePool, + barrier: Barrier, + } + + let resources = Arc::new(Resources { + pool: ResourcePool::::new(), + barrier: Barrier::new(2), + }); + + // Like all races, this is not inherently guaranteed to work, but in practice it should work fine. + // + // To validate the expected order of events, we've put print statements in the code, indicating when each thread is at a certain point. + // The output will look something like this if the test is working as expected: + // + // ``` + // 0: prewait + // 1: prewait + // 1: postwait + // 0: postwait + // 1: postsleep + // 1: removal + // 0: postget + // ``` + // + // The last two _may_ be flipped. + + let existing_entry = resources + .pool + .get_or_init::<_, ()>(0, |key| Ok(Arc::new(key))) + .unwrap(); + + // Drop the entry, but do _not_ remove it from the pool. + // This simulates the situation where the resource arc has been dropped, but the Drop implementation + // has not yet run, which calls remove. + drop(existing_entry); + + fn thread0_inner(resources: &Resources) { + eprintln!("0: prewait"); + resources.barrier.wait(); + + eprintln!("0: postwait"); + // We try to create a new entry, but the entry already exists. + // + // As Arc::upgrade is failing, we will just keep spinning until remove is called. + resources + .pool + .get_or_init::<_, ()>(0, |key| Ok(Arc::new(key))) + .unwrap(); + eprintln!("0: postget"); + } + + fn thread1_inner(resources: &Resources) { + eprintln!("1: prewait"); + resources.barrier.wait(); + + eprintln!("1: postwait"); + // We wait a little bit, making sure that thread0_inner has started spinning. + std::thread::sleep(std::time::Duration::from_millis(250)); + eprintln!("1: postsleep"); + + // We remove the entry from the pool, allowing thread0_inner to re-create. + resources.pool.remove(&0); + eprintln!("1: removal"); + } + + let thread1 = std::thread::spawn({ + let resource_clone = Arc::clone(&resources); + move || thread1_inner(&resource_clone) + }); + + thread0_inner(&resources); + + thread1.join().unwrap(); + } +} diff --git a/third_party/rust/wgpu-core/src/present.rs b/third_party/rust/wgpu-core/src/present.rs index 4c2a042b15d75..00dc049679a76 100644 --- a/third_party/rust/wgpu-core/src/present.rs +++ b/third_party/rust/wgpu-core/src/present.rs @@ -27,6 +27,7 @@ use crate::{ identity::{GlobalIdentityHandlerFactory, Input}, init_tracker::TextureInitTracker, resource::{self, ResourceInfo}, + snatch::Snatchable, track, }; @@ -77,7 +78,7 @@ pub enum ConfigureSurfaceError { PreviousOutputExists, #[error("Both `Surface` width and height must be non-zero. Wait to recreate the `Surface` until the window has non-zero area.")] ZeroArea, - #[error("`Surface` width and height must be within the maximum supported texture size. Requested was ({width}, height), maximum extent is {max_texture_dimension_2d}.")] + #[error("`Surface` width and height must be within the maximum supported texture size. Requested was ({width}, {height}), maximum extent is {max_texture_dimension_2d}.")] TooLarge { width: u32, height: u32, @@ -215,11 +216,11 @@ impl Global { let mut presentation = surface.presentation.lock(); let present = presentation.as_mut().unwrap(); let texture = resource::Texture { - inner: RwLock::new(Some(resource::TextureInner::Surface { + inner: Snatchable::new(resource::TextureInner::Surface { raw: Some(ast.texture), parent_id: surface_id, has_work: AtomicBool::new(false), - })), + }), device: device.clone(), desc: texture_desc, hal_usage, @@ -325,8 +326,9 @@ impl Global { let texture = hub.textures.unregister(texture_id); if let Some(texture) = texture { + let mut exclusive_snatch_guard = device.snatchable_lock.write(); let suf = A::get_surface(&surface); - let mut inner = texture.inner_mut(); + let mut inner = texture.inner_mut(&mut exclusive_snatch_guard); let inner = inner.as_mut().unwrap(); match *inner { @@ -420,13 +422,14 @@ impl Global { let texture = hub.textures.unregister(texture_id); if let Some(texture) = texture { let suf = A::get_surface(&surface); - match *texture.inner_mut().as_mut().take().as_mut().unwrap() { - &mut resource::TextureInner::Surface { - ref mut raw, - ref parent_id, + let exclusive_snatch_guard = device.snatchable_lock.write(); + match texture.inner.snatch(exclusive_snatch_guard).unwrap() { + resource::TextureInner::Surface { + mut raw, + parent_id, has_work: _, } => { - if surface_id == *parent_id { + if surface_id == parent_id { unsafe { suf.unwrap().raw.discard_texture(raw.take().unwrap()) }; } else { log::warn!("Surface texture is outdated"); diff --git a/third_party/rust/wgpu-core/src/registry.rs b/third_party/rust/wgpu-core/src/registry.rs index 0fe3b7dd135d9..79d68921acdb2 100644 --- a/third_party/rust/wgpu-core/src/registry.rs +++ b/third_party/rust/wgpu-core/src/registry.rs @@ -80,12 +80,21 @@ impl> FutureId<'_, I, T> { Arc::new(value) } + /// Assign a new resource to this ID. + /// + /// Registers it with the registry, and fills out the resource info. pub fn assign(self, value: T) -> (I, Arc) { let mut data = self.data.write(); data.insert(self.id, self.init(value)); (self.id, data.get(self.id).unwrap().clone()) } + /// Assign an existing resource to a new ID. + /// + /// Registers it with the registry. + /// + /// This _will_ leak the ID, and it will not be recycled again. + /// See https://github.com/gfx-rs/wgpu/issues/4912. pub fn assign_existing(self, value: &Arc) -> I { let mut data = self.data.write(); debug_assert!(!data.contains(self.id)); @@ -125,7 +134,7 @@ impl> Registry { self.read().try_get(id).map(|o| o.cloned()) } pub(crate) fn get(&self, id: I) -> Result, InvalidId> { - self.read().get(id).map(|v| v.clone()) + self.read().get_owned(id) } pub(crate) fn read<'a>(&'a self) -> RwLockReadGuard<'a, Storage> { self.storage.read() diff --git a/third_party/rust/wgpu-core/src/resource.rs b/third_party/rust/wgpu-core/src/resource.rs index 8f0607e7f926c..395b82517bb67 100644 --- a/third_party/rust/wgpu-core/src/resource.rs +++ b/third_party/rust/wgpu-core/src/resource.rs @@ -14,14 +14,14 @@ use crate::{ identity::{GlobalIdentityHandlerFactory, IdentityManager}, init_tracker::{BufferInitTracker, TextureInitTracker}, resource, resource_log, - snatch::{SnatchGuard, Snatchable}, + snatch::{ExclusiveSnatchGuard, SnatchGuard, Snatchable}, track::TextureSelector, validation::MissingBufferUsageError, Label, SubmissionIndex, }; use hal::CommandEncoder; -use parking_lot::{Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard}; +use parking_lot::{Mutex, RwLock}; use smallvec::SmallVec; use thiserror::Error; use wgt::WasmNotSendSync; @@ -709,7 +709,7 @@ pub type TextureDescriptor<'a> = wgt::TextureDescriptor, Vec { Native { - raw: Option, + raw: A::Texture, }, Surface { raw: Option, @@ -719,12 +719,10 @@ pub(crate) enum TextureInner { } impl TextureInner { - pub fn as_raw(&self) -> Option<&A::Texture> { - match *self { - Self::Native { raw: Some(ref tex) } => Some(tex), - Self::Surface { - raw: Some(ref tex), .. - } => Some(tex.borrow()), + pub fn raw(&self) -> Option<&A::Texture> { + match self { + Self::Native { raw } => Some(raw), + Self::Surface { raw: Some(tex), .. } => Some(tex.borrow()), _ => None, } } @@ -748,7 +746,7 @@ pub enum TextureClearMode { #[derive(Debug)] pub struct Texture { - pub(crate) inner: RwLock>>, + pub(crate) inner: Snatchable>, pub(crate) device: Arc>, pub(crate) desc: wgt::TextureDescriptor<(), Vec>, pub(crate) hal_usage: hal::TextureUses, @@ -789,11 +787,8 @@ impl Drop for Texture { } _ => {} }; - if self.inner.read().is_none() { - return; - } - let inner = self.inner.write().take().unwrap(); - if let TextureInner::Native { raw: Some(raw) } = inner { + + if let Some(TextureInner::Native { raw }) = self.inner.take() { unsafe { self.device.raw().destroy_texture(raw); } @@ -802,11 +797,15 @@ impl Drop for Texture { } impl Texture { - pub(crate) fn inner<'a>(&'a self) -> RwLockReadGuard<'a, Option>> { - self.inner.read() + pub(crate) fn raw<'a>(&'a self, snatch_guard: &'a SnatchGuard) -> Option<&'a A::Texture> { + self.inner.get(snatch_guard)?.raw() } - pub(crate) fn inner_mut<'a>(&'a self) -> RwLockWriteGuard<'a, Option>> { - self.inner.write() + + pub(crate) fn inner_mut<'a>( + &'a self, + guard: &mut ExclusiveSnatchGuard, + ) -> Option<&'a mut TextureInner> { + self.inner.get_mut(guard) } pub(crate) fn get_clear_view<'a>( clear_mode: &'a TextureClearMode, @@ -836,6 +835,50 @@ impl Texture { } } } + + pub(crate) fn destroy(self: &Arc) -> Result<(), DestroyError> { + let device = &self.device; + let texture_id = self.info.id(); + + #[cfg(feature = "trace")] + if let Some(ref mut trace) = *device.trace.lock() { + trace.add(trace::Action::FreeTexture(texture_id)); + } + + let temp = { + let snatch_guard = device.snatchable_lock.write(); + let raw = match self.inner.snatch(snatch_guard) { + Some(TextureInner::Native { raw }) => raw, + Some(TextureInner::Surface { .. }) => { + return Ok(()); + } + None => { + return Err(resource::DestroyError::AlreadyDestroyed); + } + }; + + queue::TempResource::DestroyedTexture(Arc::new(DestroyedTexture { + raw: Some(raw), + device: Arc::clone(&self.device), + submission_index: self.info.submission_index(), + id: self.info.id.unwrap(), + label: self.info.label.clone(), + })) + }; + + let mut pending_writes = device.pending_writes.lock(); + let pending_writes = pending_writes.as_mut().unwrap(); + if pending_writes.dst_textures.contains_key(&texture_id) { + pending_writes.temp_resources.push(temp); + } else { + let last_submit_index = self.info.submission_index(); + device + .lock_life() + .schedule_resource_destruction(temp, last_submit_index); + } + + Ok(()) + } } impl Global { @@ -850,9 +893,10 @@ impl Global { profiling::scope!("Texture::as_hal"); let hub = A::hub(self); - let texture = { hub.textures.try_get(id).ok().flatten() }; - let inner = texture.as_ref().unwrap().inner(); - let hal_texture = inner.as_ref().unwrap().as_raw(); + let texture_opt = { hub.textures.try_get(id).ok().flatten() }; + let texture = texture_opt.as_ref().unwrap(); + let snatch_guard = texture.device.snatchable_lock.read(); + let hal_texture = texture.raw(&snatch_guard); hal_texture_callback(hal_texture); } @@ -927,6 +971,38 @@ impl Global { } } +/// A texture that has been marked as destroyed and is staged for actual deletion soon. +#[derive(Debug)] +pub struct DestroyedTexture { + raw: Option, + device: Arc>, + label: String, + pub(crate) id: TextureId, + pub(crate) submission_index: u64, +} + +impl DestroyedTexture { + pub fn label(&self) -> &dyn Debug { + if !self.label.is_empty() { + return &self.label; + } + + &self.id + } +} + +impl Drop for DestroyedTexture { + fn drop(&mut self) { + if let Some(raw) = self.raw.take() { + resource_log!("Deallocate raw Texture (destroyed) {:?}", self.label()); + unsafe { + use hal::Device; + self.device.raw().destroy_texture(raw); + } + } + } +} + #[derive(Clone, Copy, Debug)] pub enum TextureErrorDimension { X, diff --git a/third_party/rust/wgpu-core/src/snatch.rs b/third_party/rust/wgpu-core/src/snatch.rs index db3114076c1c8..54983120c824f 100644 --- a/third_party/rust/wgpu-core/src/snatch.rs +++ b/third_party/rust/wgpu-core/src/snatch.rs @@ -30,6 +30,11 @@ impl Snatchable { unsafe { (*self.value.get()).as_ref() } } + /// Get write access to the value. Requires a the snatchable lock's write guard. + pub fn get_mut(&self, _guard: &mut ExclusiveSnatchGuard) -> Option<&mut T> { + unsafe { (*self.value.get()).as_mut() } + } + /// Take the value. Requires a the snatchable lock's write guard. pub fn snatch(&self, _guard: ExclusiveSnatchGuard) -> Option { unsafe { (*self.value.get()).take() } diff --git a/third_party/rust/wgpu-core/src/storage.rs b/third_party/rust/wgpu-core/src/storage.rs index 891b7954e64af..cf81e65eb85fb 100644 --- a/third_party/rust/wgpu-core/src/storage.rs +++ b/third_party/rust/wgpu-core/src/storage.rs @@ -131,6 +131,12 @@ where result } + /// Get an owned reference to an item behind a potentially invalid ID. + /// Panics if there is an epoch mismatch, or the entry is empty. + pub(crate) fn get_owned(&self, id: I) -> Result, InvalidId> { + Ok(Arc::clone(self.get(id)?)) + } + pub(crate) fn label_for_invalid_id(&self, id: I) -> &str { let (index, _, _) = id.unzip(); match self.map.get(index as usize) { diff --git a/third_party/rust/wgpu-core/src/track/mod.rs b/third_party/rust/wgpu-core/src/track/mod.rs index 0f0b22b004aa9..c13e815cb6e56 100644 --- a/third_party/rust/wgpu-core/src/track/mod.rs +++ b/third_party/rust/wgpu-core/src/track/mod.rs @@ -151,12 +151,7 @@ impl PendingTransition { impl PendingTransition { /// Produce the hal barrier corresponding to the transition. - pub fn into_hal<'a, A: HalApi>( - self, - tex: &'a resource::TextureInner, - ) -> hal::TextureBarrier<'a, A> { - let texture = tex.as_raw().expect("Texture is destroyed"); - + pub fn into_hal<'a, A: HalApi>(self, texture: &'a A::Texture) -> hal::TextureBarrier<'a, A> { // These showing up in a barrier is always a bug strict_assert_ne!(self.usage.start, hal::TextureUses::UNKNOWN); strict_assert_ne!(self.usage.end, hal::TextureUses::UNKNOWN); diff --git a/third_party/rust/wgpu-core/src/track/texture.rs b/third_party/rust/wgpu-core/src/track/texture.rs index 46e3fada0cf5d..94574596a983f 100644 --- a/third_party/rust/wgpu-core/src/track/texture.rs +++ b/third_party/rust/wgpu-core/src/track/texture.rs @@ -24,6 +24,7 @@ use crate::{ hal_api::HalApi, id::{TextureId, TypedId}, resource::{Resource, Texture, TextureInner}, + snatch::SnatchGuard, track::{ invalid_resource_state, skip_barrier, ResourceMetadata, ResourceMetadataProvider, ResourceUses, UsageConflict, @@ -34,7 +35,7 @@ use hal::TextureUses; use arrayvec::ArrayVec; use naga::FastHashMap; -use parking_lot::{Mutex, RwLockReadGuard}; +use parking_lot::Mutex; use wgt::{strict_assert, strict_assert_eq}; use std::{borrow::Cow, iter, marker::PhantomData, ops::Range, sync::Arc, vec::Drain}; @@ -497,17 +498,15 @@ impl TextureTracker { /// Drain all currently pending transitions. pub fn drain_transitions<'a>( &'a mut self, - ) -> ( - PendingTransitionList, - Vec>>>, - ) { + snatch_guard: &'a SnatchGuard<'a>, + ) -> (PendingTransitionList, Vec>>) { let mut textures = Vec::new(); let transitions = self .temp .drain(..) .map(|pending| { let tex = unsafe { self.metadata.get_resource_unchecked(pending.id as _) }; - textures.push(tex.inner()); + textures.push(tex.inner.get(snatch_guard)); pending }) .collect(); diff --git a/third_party/rust/wgpu-core/src/validation.rs b/third_party/rust/wgpu-core/src/validation.rs index 1c05f47ec59cf..a0947ae83ff58 100644 --- a/third_party/rust/wgpu-core/src/validation.rs +++ b/third_party/rust/wgpu-core/src/validation.rs @@ -1,4 +1,5 @@ -use crate::{binding_model::BindEntryMap, FastHashMap, FastHashSet}; +use crate::{device::bgl, FastHashMap, FastHashSet}; +use arrayvec::ArrayVec; use std::{collections::hash_map::Entry, fmt}; use thiserror::Error; use wgt::{BindGroupLayoutEntry, BindingType}; @@ -774,6 +775,27 @@ pub fn check_texture_format( } } +pub enum BindingLayoutSource<'a> { + /// The binding layout is derived from the pipeline layout. + /// + /// This will be filled in by the shader binding validation, as it iterates the shader's interfaces. + Derived(ArrayVec), + /// The binding layout is provided by the user in BGLs. + /// + /// This will be validated against the shader's interfaces. + Provided(ArrayVec<&'a bgl::EntryMap, { hal::MAX_BIND_GROUPS }>), +} + +impl<'a> BindingLayoutSource<'a> { + pub fn new_derived(limits: &wgt::Limits) -> Self { + let mut array = ArrayVec::new(); + for _ in 0..limits.max_bind_groups { + array.push(Default::default()); + } + BindingLayoutSource::Derived(array) + } +} + pub type StageIo = FastHashMap; impl Interface { @@ -933,8 +955,7 @@ impl Interface { pub fn check_stage( &self, - given_layouts: Option<&[&BindEntryMap]>, - derived_layouts: &mut [BindEntryMap], + layouts: &mut BindingLayoutSource<'_>, shader_binding_sizes: &mut FastHashMap, entry_point_name: &str, stage_bit: wgt::ShaderStages, @@ -958,45 +979,53 @@ impl Interface { // check resources visibility for &handle in entry_point.resources.iter() { let res = &self.resources[handle]; - let result = match given_layouts { - Some(layouts) => { - // update the required binding size for this buffer - if let ResourceType::Buffer { size } = res.ty { - match shader_binding_sizes.entry(res.bind.clone()) { - Entry::Occupied(e) => { - *e.into_mut() = size.max(*e.get()); - } - Entry::Vacant(e) => { - e.insert(size); + let result = 'err: { + match layouts { + BindingLayoutSource::Provided(layouts) => { + // update the required binding size for this buffer + if let ResourceType::Buffer { size } = res.ty { + match shader_binding_sizes.entry(res.bind.clone()) { + Entry::Occupied(e) => { + *e.into_mut() = size.max(*e.get()); + } + Entry::Vacant(e) => { + e.insert(size); + } } } + + let Some(map) = layouts.get(res.bind.group as usize) else { + break 'err Err(BindingError::Missing); + }; + + let Some(entry) = map.get(res.bind.binding) else { + break 'err Err(BindingError::Missing); + }; + + if !entry.visibility.contains(stage_bit) { + break 'err Err(BindingError::Invisible); + } + + res.check_binding_use(entry) } - layouts - .get(res.bind.group as usize) - .and_then(|map| map.get(&res.bind.binding)) - .ok_or(BindingError::Missing) - .and_then(|entry| { - if entry.visibility.contains(stage_bit) { - Ok(entry) - } else { - Err(BindingError::Invisible) - } - }) - .and_then(|entry| res.check_binding_use(entry)) - } - None => derived_layouts - .get_mut(res.bind.group as usize) - .ok_or(BindingError::Missing) - .and_then(|set| { - let ty = res.derive_binding_type()?; - match set.entry(res.bind.binding) { - Entry::Occupied(e) if e.get().ty != ty => { - return Err(BindingError::InconsistentlyDerivedType) + BindingLayoutSource::Derived(layouts) => { + let Some(map) = layouts.get_mut(res.bind.group as usize) else { + break 'err Err(BindingError::Missing); + }; + + let ty = match res.derive_binding_type() { + Ok(ty) => ty, + Err(error) => break 'err Err(error), + }; + + match map.entry(res.bind.binding) { + indexmap::map::Entry::Occupied(e) if e.get().ty != ty => { + break 'err Err(BindingError::InconsistentlyDerivedType) } - Entry::Occupied(e) => { + indexmap::map::Entry::Occupied(e) => { e.into_mut().visibility |= stage_bit; } - Entry::Vacant(e) => { + indexmap::map::Entry::Vacant(e) => { e.insert(BindGroupLayoutEntry { binding: res.bind.binding, ty, @@ -1006,20 +1035,28 @@ impl Interface { } } Ok(()) - }), + } + } }; if let Err(error) = result { return Err(StageError::Binding(res.bind.clone(), error)); } } - // check the compatibility between textures and samplers - if let Some(layouts) = given_layouts { + // Check the compatibility between textures and samplers + // + // We only need to do this if the binding layout is provided by the user, as derived + // layouts will inherently be correctly tagged. + if let BindingLayoutSource::Provided(layouts) = layouts { for &(texture_handle, sampler_handle) in entry_point.sampling_pairs.iter() { let texture_bind = &self.resources[texture_handle].bind; let sampler_bind = &self.resources[sampler_handle].bind; - let texture_layout = &layouts[texture_bind.group as usize][&texture_bind.binding]; - let sampler_layout = &layouts[sampler_bind.group as usize][&sampler_bind.binding]; + let texture_layout = layouts[texture_bind.group as usize] + .get(texture_bind.binding) + .unwrap(); + let sampler_layout = layouts[sampler_bind.group as usize] + .get(sampler_bind.binding) + .unwrap(); assert!(texture_layout.visibility.contains(stage_bit)); assert!(sampler_layout.visibility.contains(stage_bit)); diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index d85f5d8612065..286bdb188053e 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"01f51d7d1496aef321704cc982c12b4c36a19cf352464606f9177fb6d112dcfd","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"099ee611a911dc19330a61bffcde13663929a51b25ac528ee33ea796d695491e","examples/halmark/main.rs":"5a358026dca068990ea6ea5bb1e5c6c606f5308e869c2c5fd0fef13d80ea061a","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"33f536693b08a9f00b0358416be8f368894bf92a2e673b16622fa9c244854c91","examples/ray-traced-triangle/main.rs":"b7f75d04eec75c1ae95fab18ede582b66058eb1f95491617cb0622ad96b9f166","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"760cd4eaa79b530368a30140b96bf73ac4fbdb4025eb95f0bed581638c8bb1cb","src/auxil/dxgi/exception.rs":"fc68c6211c82a912b454c3004185f46a1416bce38ddc5b0555e0def6539cfb27","src/auxil/dxgi/factory.rs":"65c758d6583c2fdac0b3d48d1a0a2a414ff913efc4f3913a38bd660819c3a2e2","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"20c8eb03d738062dff198feca6327addb9882ed0462be842c789eadf7dca0573","src/auxil/dxgi/time.rs":"b6f966b250e9424d5d7e4065f2108cba87197c1e30baae6d87083055d1bc5a4b","src/auxil/mod.rs":"17505dc0a8247546bc1b97341c872f368a1f522e4ff51bb8844255e36b2b5186","src/auxil/renderdoc.rs":"c2f849f70f576b0c9b0d32dd155b6a6353f74dff59cbeeaa994a12789d047c0f","src/dx12/adapter.rs":"33c4b790c22115d68db11883a8fb8da194fba0937636a56cc779b7bf48a5ce44","src/dx12/command.rs":"a9dfd160c966870928b3ab98b01df9f8fd05b0517adcb57b4cb28cdc66e0bce1","src/dx12/conv.rs":"94d35f117ae003b07049f3a0bc6c45a0ffda9fb8053233d39c173cfb1b644403","src/dx12/descriptor.rs":"d9e295c48dc7d1759fd121c927c2218c1bde90e9f1b35f2ad01b610b184b614e","src/dx12/device.rs":"30af012adfa1bdf9fcc605b66008393f143108adfa003c0ba6f648421a180094","src/dx12/instance.rs":"719125a6adb69f16df1a0069c8a1ccb5792169a00abdf2e38cc26b633b15768a","src/dx12/mod.rs":"715b99af005e0b2a4cccf63f715dd0b6b314e15b81f5cf2e080942459eaf4998","src/dx12/shader_compilation.rs":"0589ed592cbd939f821d2801c82ee973c28844292682d37db84048ba21e6c72b","src/dx12/suballocation.rs":"eec45b2d23e979f7d7f33d982a89ae2f92e528b22f1bb7d2e5dd52582a25a601","src/dx12/types.rs":"9573736baaa0ef607367c3b72144556d24faf677a26bb8df49a4372a1348e06b","src/dx12/view.rs":"b3c80708e62508ec63df7c06001384c543b7ab76bb7334f9f565e3289afe3673","src/empty.rs":"af290b508bc63590b40b94a8e3b163e32f1262f2e20995cab340cfd76386becd","src/gles/adapter.rs":"8ca43533be6e3112dfd952040d7d6ca6eed093c541aa5b92b3d74cb692e8058b","src/gles/command.rs":"a544456f3d3ed13bd695a604473af1758ee29b2386872f5663e5395088890177","src/gles/conv.rs":"4c7ce6424cefc2b62b74f1f0f67c2d480f04412a16d27ca83b0471744d7fce96","src/gles/device.rs":"ae7415a7ade56d499b28073492289907edbce13327392cc014812c35ed9effdc","src/gles/egl.rs":"89212bdacbb9dc43eebcc7b74fb612a69d35ffc1dfe2b626820c44c61256c4c9","src/gles/emscripten.rs":"19bb73a9d140645f3f32cd48b002151711a9b8456e213eab5f3a2be79239e147","src/gles/mod.rs":"d02cefb55c78dd496f2eeceb55547b3032b50f31188d20994d90e4a049b2e6a0","src/gles/queue.rs":"53f7184c94f210dd4fb2a264c9a545eac3ccf4ef44e670ff7523a8e9a6c9dd1d","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":"8f96cce5d680202970c61482803adb3ba92142925c99d5254192e9bc3d0d52ed","src/gles/wgl.rs":"24354905784c437411670c8848670d69002cb5af2942b8a00f7f5445ce68366f","src/lib.rs":"ecdf9b417fd71145734530c1dd8b843f69a8ff8a00d2a364794ea5062cc30a92","src/metal/adapter.rs":"d9cec8808210059503ebb4776f2431c83a6e5d8ab1f79a48d321dc2f589a0ca3","src/metal/command.rs":"661b38a75d4f4cd1b0d6957f1f09db0743ec3a13bbafba9baa931894ee193f48","src/metal/conv.rs":"0bce6a8d0ccef16783475803d70d35e03ab7938c19374e22c9d253abe1f8b111","src/metal/device.rs":"c5deeecf475e0aa4b2027c656ea19207716f84b56cfa7c9132dca504d1abebfb","src/metal/mod.rs":"662518044d6464410facd58ff06a80a89e2c9c3cd3fdad69a956ed4546777d2a","src/metal/surface.rs":"01539fa9f22c26fdcca5ee915ca97cf76cecc7fae237347dfc9a813ae13e98cd","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"22e29141efe34674bfa0fd09fa36dd0113f1b0b2786231222a25d5758224f05a","src/vulkan/command.rs":"7c6dd62b1d4a65f8c85b2fada925f9c50b46039ec862b5e700e05e0f546a3288","src/vulkan/conv.rs":"9a2c0398af0e9d48e50348d0fa0366eca90a9d2df3d6c17bee16d37dc5d95c2f","src/vulkan/device.rs":"d2f3068dc3ba8148c849a3bcab1328350e7a99ed5055fbde1647e8c4138f0e81","src/vulkan/instance.rs":"ccac56ae83c8692e9a96ee0e7d11ecef8493420b8b1893bea314eb1e9c515863","src/vulkan/mod.rs":"e69c99bc511567587734ffb16af3cbda8a29ec387c8183c930744cb489b3f492"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"f41bd0b27b43a2a4926bd6cca4748767acf91ec690935f362bcb02cfc399f743","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"099ee611a911dc19330a61bffcde13663929a51b25ac528ee33ea796d695491e","examples/halmark/main.rs":"5a358026dca068990ea6ea5bb1e5c6c606f5308e869c2c5fd0fef13d80ea061a","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"33f536693b08a9f00b0358416be8f368894bf92a2e673b16622fa9c244854c91","examples/ray-traced-triangle/main.rs":"b7f75d04eec75c1ae95fab18ede582b66058eb1f95491617cb0622ad96b9f166","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"760cd4eaa79b530368a30140b96bf73ac4fbdb4025eb95f0bed581638c8bb1cb","src/auxil/dxgi/exception.rs":"fc68c6211c82a912b454c3004185f46a1416bce38ddc5b0555e0def6539cfb27","src/auxil/dxgi/factory.rs":"65c758d6583c2fdac0b3d48d1a0a2a414ff913efc4f3913a38bd660819c3a2e2","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"20c8eb03d738062dff198feca6327addb9882ed0462be842c789eadf7dca0573","src/auxil/dxgi/time.rs":"b6f966b250e9424d5d7e4065f2108cba87197c1e30baae6d87083055d1bc5a4b","src/auxil/mod.rs":"17505dc0a8247546bc1b97341c872f368a1f522e4ff51bb8844255e36b2b5186","src/auxil/renderdoc.rs":"c2f849f70f576b0c9b0d32dd155b6a6353f74dff59cbeeaa994a12789d047c0f","src/dx12/adapter.rs":"33c4b790c22115d68db11883a8fb8da194fba0937636a56cc779b7bf48a5ce44","src/dx12/command.rs":"3a5efff00ebf85cd62d95d743cba32e3cbc20c60b722cfe427fd4f9e8d428ca4","src/dx12/conv.rs":"94d35f117ae003b07049f3a0bc6c45a0ffda9fb8053233d39c173cfb1b644403","src/dx12/descriptor.rs":"d9e295c48dc7d1759fd121c927c2218c1bde90e9f1b35f2ad01b610b184b614e","src/dx12/device.rs":"30af012adfa1bdf9fcc605b66008393f143108adfa003c0ba6f648421a180094","src/dx12/instance.rs":"719125a6adb69f16df1a0069c8a1ccb5792169a00abdf2e38cc26b633b15768a","src/dx12/mod.rs":"715b99af005e0b2a4cccf63f715dd0b6b314e15b81f5cf2e080942459eaf4998","src/dx12/shader_compilation.rs":"419ce7fe4df2973845851fac045dab21157eec6b26a573012f22fa41fc130b5b","src/dx12/suballocation.rs":"eec45b2d23e979f7d7f33d982a89ae2f92e528b22f1bb7d2e5dd52582a25a601","src/dx12/types.rs":"9573736baaa0ef607367c3b72144556d24faf677a26bb8df49a4372a1348e06b","src/dx12/view.rs":"b3c80708e62508ec63df7c06001384c543b7ab76bb7334f9f565e3289afe3673","src/empty.rs":"af290b508bc63590b40b94a8e3b163e32f1262f2e20995cab340cfd76386becd","src/gles/adapter.rs":"a5902d44d4d99dc69974dbb0229a7529f9d9545bcb3aa6471d264ff9ae0b5683","src/gles/command.rs":"a544456f3d3ed13bd695a604473af1758ee29b2386872f5663e5395088890177","src/gles/conv.rs":"4c7ce6424cefc2b62b74f1f0f67c2d480f04412a16d27ca83b0471744d7fce96","src/gles/device.rs":"9f22cd9f8092287a9f8d9d089bff3b8b9f6309e50907ae139b30d05f4256f022","src/gles/egl.rs":"89212bdacbb9dc43eebcc7b74fb612a69d35ffc1dfe2b626820c44c61256c4c9","src/gles/emscripten.rs":"19bb73a9d140645f3f32cd48b002151711a9b8456e213eab5f3a2be79239e147","src/gles/mod.rs":"d02cefb55c78dd496f2eeceb55547b3032b50f31188d20994d90e4a049b2e6a0","src/gles/queue.rs":"53f7184c94f210dd4fb2a264c9a545eac3ccf4ef44e670ff7523a8e9a6c9dd1d","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":"8f96cce5d680202970c61482803adb3ba92142925c99d5254192e9bc3d0d52ed","src/gles/wgl.rs":"24354905784c437411670c8848670d69002cb5af2942b8a00f7f5445ce68366f","src/lib.rs":"ecdf9b417fd71145734530c1dd8b843f69a8ff8a00d2a364794ea5062cc30a92","src/metal/adapter.rs":"d9cec8808210059503ebb4776f2431c83a6e5d8ab1f79a48d321dc2f589a0ca3","src/metal/command.rs":"661b38a75d4f4cd1b0d6957f1f09db0743ec3a13bbafba9baa931894ee193f48","src/metal/conv.rs":"0bce6a8d0ccef16783475803d70d35e03ab7938c19374e22c9d253abe1f8b111","src/metal/device.rs":"c5deeecf475e0aa4b2027c656ea19207716f84b56cfa7c9132dca504d1abebfb","src/metal/mod.rs":"662518044d6464410facd58ff06a80a89e2c9c3cd3fdad69a956ed4546777d2a","src/metal/surface.rs":"01539fa9f22c26fdcca5ee915ca97cf76cecc7fae237347dfc9a813ae13e98cd","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"232ba3f8e8eaeab90dd7b51fcecd17d154d90f8b43aeee19c579bf7c3332a19e","src/vulkan/command.rs":"7c6dd62b1d4a65f8c85b2fada925f9c50b46039ec862b5e700e05e0f546a3288","src/vulkan/conv.rs":"9a2c0398af0e9d48e50348d0fa0366eca90a9d2df3d6c17bee16d37dc5d95c2f","src/vulkan/device.rs":"d2f3068dc3ba8148c849a3bcab1328350e7a99ed5055fbde1647e8c4138f0e81","src/vulkan/instance.rs":"e0c0ce1e8daf720269d9a29612961b0e18ca5f6761b6e800e5072843c90c033e","src/vulkan/mod.rs":"e69c99bc511567587734ffb16af3cbda8a29ec387c8183c930744cb489b3f492"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-hal/Cargo.toml b/third_party/rust/wgpu-hal/Cargo.toml index d88a16a59a866..d6173c1accd71 100644 --- a/third_party/rust/wgpu-hal/Cargo.toml +++ b/third_party/rust/wgpu-hal/Cargo.toml @@ -89,7 +89,7 @@ path = "../naga" features = ["wgsl-in"] [dev-dependencies.winit] -version = "0.29.6" +version = "0.29.8" features = ["android-native-activity"] [features] @@ -222,7 +222,7 @@ version = "0.5" optional = true [target."cfg(windows)".dependencies.gpu-allocator] -version = "0.24" +version = "0.25" features = [ "d3d12", "public-winapi", diff --git a/third_party/rust/wgpu-hal/src/dx12/command.rs b/third_party/rust/wgpu-hal/src/dx12/command.rs index c5d0d16b2c522..3d05813ed7b0b 100644 --- a/third_party/rust/wgpu-hal/src/dx12/command.rs +++ b/third_party/rust/wgpu-hal/src/dx12/command.rs @@ -20,7 +20,7 @@ impl crate::BufferTextureCopy { &self, format: wgt::TextureFormat, ) -> d3d12_ty::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { - let (block_width, block_height) = format.block_dimensions(); + let (block_width, _) = format.block_dimensions(); d3d12_ty::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { Offset: self.buffer_layout.offset, Footprint: d3d12_ty::D3D12_SUBRESOURCE_FOOTPRINT { @@ -30,10 +30,7 @@ impl crate::BufferTextureCopy { ) .unwrap(), Width: self.size.width, - Height: self - .buffer_layout - .rows_per_image - .map_or(self.size.height, |count| count * block_height), + Height: self.size.height, Depth: self.size.depth, RowPitch: { let actual = self.buffer_layout.bytes_per_row.unwrap_or_else(|| { diff --git a/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs b/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs index a034f54a7fc8f..df040dba1570d 100644 --- a/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs +++ b/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs @@ -99,7 +99,7 @@ mod dxc { let dxil = match hassle_rs::Dxil::new(dxil_path) { Ok(dxil) => dxil, Err(e) => { - log::warn!("Failed to load dxil.dll. Defaulting to DXC instead: {}", e); + log::warn!("Failed to load dxil.dll. Defaulting to FXC instead: {}", e); return Ok(None); } }; diff --git a/third_party/rust/wgpu-hal/src/gles/adapter.rs b/third_party/rust/wgpu-hal/src/gles/adapter.rs index e46c91ab9c146..c3e1a13b06dab 100644 --- a/third_party/rust/wgpu-hal/src/gles/adapter.rs +++ b/third_party/rust/wgpu-hal/src/gles/adapter.rs @@ -220,7 +220,6 @@ impl super::Adapter { let full_ver = Self::parse_full_version(&version).ok(); let es_ver = full_ver.map_or_else(|| Self::parse_version(&version).ok(), |_| None); - let web_gl = cfg!(target_arch = "wasm32"); if let Some(full_ver) = full_ver { let core_profile = (full_ver >= (3, 2)).then_some(unsafe { @@ -608,10 +607,7 @@ impl super::Adapter { super::PrivateCapabilities::TEXTURE_STORAGE, supported((3, 0), (4, 2)), ); - private_caps.set( - super::PrivateCapabilities::DEBUG_FNS, - supported((3, 2), (4, 3)) && !web_gl, - ); + private_caps.set(super::PrivateCapabilities::DEBUG_FNS, gl.supports_debug()); private_caps.set( super::PrivateCapabilities::INVALIDATE_FRAMEBUFFER, supported((3, 0), (4, 3)), @@ -1046,9 +1042,10 @@ impl crate::Adapter for super::Adapter { Tf::Rg16Unorm => empty, Tf::Rg16Snorm => empty, Tf::Rg16Float => filterable | half_float_renderable, - Tf::Rgba8Unorm | Tf::Rgba8UnormSrgb => filterable_renderable | storage, + Tf::Rgba8Unorm => filterable_renderable | storage, + Tf::Rgba8UnormSrgb => filterable_renderable, Tf::Bgra8Unorm | Tf::Bgra8UnormSrgb => filterable_renderable, - Tf::Rgba8Snorm => filterable, + Tf::Rgba8Snorm => filterable | storage, Tf::Rgba8Uint => renderable | storage, Tf::Rgba8Sint => renderable | storage, Tf::Rgb10a2Uint => renderable, @@ -1071,7 +1068,7 @@ impl crate::Adapter for super::Adapter { | Tf::Depth32FloatStencil8 | Tf::Depth24Plus | Tf::Depth24PlusStencil8 => depth, - Tf::NV12 => unreachable!(), + Tf::NV12 => empty, Tf::Rgb9e5Ufloat => filterable, Tf::Bc1RgbaUnorm | Tf::Bc1RgbaUnormSrgb diff --git a/third_party/rust/wgpu-hal/src/gles/device.rs b/third_party/rust/wgpu-hal/src/gles/device.rs index a48fe9dc750cf..8cc2a9575630b 100644 --- a/third_party/rust/wgpu-hal/src/gles/device.rs +++ b/third_party/rust/wgpu-hal/src/gles/device.rs @@ -344,7 +344,7 @@ impl super::Device { let program = unsafe { gl.create_program() }.unwrap(); #[cfg(not(target_arch = "wasm32"))] if let Some(label) = label { - if gl.supports_debug() { + if private_caps.contains(PrivateCapabilities::DEBUG_FNS) { let name = unsafe { mem::transmute(program) }; unsafe { gl.object_label(glow::PROGRAM, name, Some(label)) }; } @@ -593,7 +593,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::BUFFER, name, Some(label)) }; } @@ -732,7 +736,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::RENDERBUFFER, name, Some(label)) }; } @@ -896,7 +904,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::TEXTURE, name, Some(label)) }; } @@ -1035,7 +1047,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::SAMPLER, name, Some(label)) }; } diff --git a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs index 737615215d461..477d166c702b0 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs @@ -1711,7 +1711,17 @@ impl crate::Adapter for super::Adapter { .framebuffer_stencil_sample_counts .min(limits.sampled_image_stencil_sample_counts) } else { - match format.sample_type(None, None).unwrap() { + let first_aspect = format_aspect + .iter() + .next() + .expect("All texture should at least one aspect") + .map(); + + // We should never get depth or stencil out of this, due to the above. + assert_ne!(first_aspect, wgt::TextureAspect::DepthOnly); + assert_ne!(first_aspect, wgt::TextureAspect::StencilOnly); + + match format.sample_type(Some(first_aspect), None).unwrap() { wgt::TextureSampleType::Float { .. } => limits .framebuffer_color_sample_counts .min(limits.sampled_image_color_sample_counts), diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs index 7a527774300a0..e9ca3221eadba 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/instance.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -1,6 +1,7 @@ use std::{ ffi::{c_void, CStr, CString}, slice, + str::FromStr, sync::Arc, thread, }; @@ -855,11 +856,16 @@ impl crate::Instance for super::Instance { { // Check if mesa driver and version less than 21.2 if let Some(version) = exposed.info.driver_info.split_once("Mesa ").map(|s| { - s.1.rsplit_once('.') - .map(|v| v.0.parse::().unwrap_or_default()) - .unwrap_or_default() + let mut components = s.1.split('.'); + let major = components.next().and_then(|s| u8::from_str(s).ok()); + let minor = components.next().and_then(|s| u8::from_str(s).ok()); + if let (Some(major), Some(minor)) = (major, minor) { + (major, minor) + } else { + (0, 0) + } }) { - if version < 21.2 { + if version < (21, 2) { // See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688 log::warn!( "Disabling presentation on '{}' (id {:?}) due to NV Optimus and Intel Mesa < v21.2", diff --git a/third_party/rust/wgpu-types/.cargo-checksum.json b/third_party/rust/wgpu-types/.cargo-checksum.json index b7330333418d6..c87ebb04047e2 100644 --- a/third_party/rust/wgpu-types/.cargo-checksum.json +++ b/third_party/rust/wgpu-types/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"18549fb7d7de2ea2481f30292dca63889856a33bd1b3698e16cee6631ab65df4","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"3fe98027aa73970c8ab7874a3e13dbfd6faa87df2081beb5c83aeec4c60f372f","src/lib.rs":"30e85d18f040cedb37861ef734a41df9fab730d868b25db3158921aa6bfc44a3","src/math.rs":"4d03039736dd6926feb139bc68734cb59df34ede310427bbf059e5c925e0af3b"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"be3f23b1527145b0f4c5f29dfdfa5865f7bb23a517c6d42f665dcb750129ff56","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"3fe98027aa73970c8ab7874a3e13dbfd6faa87df2081beb5c83aeec4c60f372f","src/lib.rs":"30e85d18f040cedb37861ef734a41df9fab730d868b25db3158921aa6bfc44a3","src/math.rs":"4d03039736dd6926feb139bc68734cb59df34ede310427bbf059e5c925e0af3b"},"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 index c1e36af8c5994..35f4240bd644a 100644 --- a/third_party/rust/wgpu-types/Cargo.toml +++ b/third_party/rust/wgpu-types/Cargo.toml @@ -45,7 +45,7 @@ features = ["serde_derive"] optional = true [dev-dependencies] -serde_json = "1.0.108" +serde_json = "1.0.111" [dev-dependencies.serde] version = "1"