diff --git a/.cargo/config.in b/.cargo/config.in index 7895b4d0c4430..4821995db842d 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -25,14 +25,14 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/naga?rev=bac2d82a430fbfcf100ee22b7c3bc12f3d593079"] +[source."git+https://github.com/gfx-rs/naga?rev=7a19f3af909202c7eafd36633b5584bfbb353ecb"] git = "https://github.com/gfx-rs/naga" -rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" +rev = "7a19f3af909202c7eafd36633b5584bfbb353ecb" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=7c6b85756237f77bfe8d6231dfc7a1412ff662b6"] +[source."git+https://github.com/gfx-rs/wgpu?rev=57874e5c540330c8183e19ee87654cf24bb5c250"] git = "https://github.com/gfx-rs/wgpu" -rev = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" replace-with = "vendored-sources" [source."git+https://github.com/glandium/prost?rev=95964e9d33df3c2a9c3f14285e262867cab6f96b"] diff --git a/Cargo.lock b/Cargo.lock index aab7a6a6406ae..4ed3cc9aedc20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3730,13 +3730,13 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "0.13.0" -source = "git+https://github.com/gfx-rs/naga?rev=bac2d82a430fbfcf100ee22b7c3bc12f3d593079#bac2d82a430fbfcf100ee22b7c3bc12f3d593079" +source = "git+https://github.com/gfx-rs/naga?rev=7a19f3af909202c7eafd36633b5584bfbb353ecb#7a19f3af909202c7eafd36633b5584bfbb353ecb" dependencies = [ "bit-set", "bitflags 2.999.999", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap 2.999.999", "log", "num-traits", "rustc-hash", @@ -6292,7 +6292,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.17.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=7c6b85756237f77bfe8d6231dfc7a1412ff662b6#7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +source = "git+https://github.com/gfx-rs/wgpu?rev=57874e5c540330c8183e19ee87654cf24bb5c250#57874e5c540330c8183e19ee87654cf24bb5c250" dependencies = [ "arrayvec", "bit-vec", @@ -6315,7 +6315,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.17.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=7c6b85756237f77bfe8d6231dfc7a1412ff662b6#7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +source = "git+https://github.com/gfx-rs/wgpu?rev=57874e5c540330c8183e19ee87654cf24bb5c250#57874e5c540330c8183e19ee87654cf24bb5c250" dependencies = [ "android_system_properties", "arrayvec", @@ -6351,7 +6351,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.17.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=7c6b85756237f77bfe8d6231dfc7a1412ff662b6#7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +source = "git+https://github.com/gfx-rs/wgpu?rev=57874e5c540330c8183e19ee87654cf24bb5c250#57874e5c540330c8183e19ee87654cf24bb5c250" dependencies = [ "bitflags 2.999.999", "js-sys", diff --git a/build/rust/indexmap/Cargo.toml b/build/rust/indexmap/Cargo.toml index 8772a230ac67e..3f4549b644acc 100644 --- a/build/rust/indexmap/Cargo.toml +++ b/build/rust/indexmap/Cargo.toml @@ -9,3 +9,7 @@ path = "lib.rs" [dependencies.indexmap] version = "1.9.3" + +[features] +serde = ["indexmap/serde"] +std = ["indexmap/std"] diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml index bad5f3ded6136..f0a7a741bb11b 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 = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" #Note: "replay" shouldn't ideally be needed, # but it allows us to serialize everything across IPC. features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl"] @@ -27,32 +27,32 @@ features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl"] [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" 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 = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" features = ["dx11", "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 = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +rev = "57874e5c540330c8183e19ee87654cf24bb5c250" [dependencies] bincode = "1" diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml index d0df94b243212..38bf41c3d3219 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 7c6b85756237f77bfe8d6231dfc7a1412ff662b6 + release: commit 57874e5c540330c8183e19ee87654cf24bb5c250 # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: 7c6b85756237f77bfe8d6231dfc7a1412ff662b6 + revision: 57874e5c540330c8183e19ee87654cf24bb5c250 license: ['MIT', 'Apache-2.0'] diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 46f58d6b8c2ef..a0e0e53219fbe 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -2262,6 +2262,11 @@ who = "Teodor Tanasoaia " criteria = "safe-to-deploy" delta = "0.12.0@git:b99d58ea435090e561377949f428bce2c18451bb -> 0.12.0@git:76003dc0035d53a474d366dcdf49d2e4d12e921f" +[[audits.naga]] +who = "Nicolas Silva " +criteria = "safe-to-deploy" +delta = "0.13.0@git:bac2d82a430fbfcf100ee22b7c3bc12f3d593079 -> 0.13.0@git:7a19f3af909202c7eafd36633b5584bfbb353ecb" + [[audits.net2]] who = "Mike Hommey " criteria = "safe-to-run" @@ -3944,6 +3949,11 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "0.17.0@git:09b010b26af6876ce84991576a168a572172f08d -> 0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +[[audits.wgpu-core]] +who = "Nicolas Silva " +criteria = "safe-to-deploy" +delta = "0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6 -> 0.17.0@git:57874e5c540330c8183e19ee87654cf24bb5c250" + [[audits.wgpu-hal]] who = "Dzmitry Malyshau " criteria = "safe-to-deploy" @@ -4047,6 +4057,11 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "0.17.0@git:09b010b26af6876ce84991576a168a572172f08d -> 0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +[[audits.wgpu-hal]] +who = "Nicolas Silva " +criteria = "safe-to-deploy" +delta = "0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6 -> 0.17.0@git:57874e5c540330c8183e19ee87654cf24bb5c250" + [[audits.wgpu-types]] who = "Dzmitry Malyshau " criteria = "safe-to-deploy" @@ -4150,6 +4165,11 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "0.17.0@git:09b010b26af6876ce84991576a168a572172f08d -> 0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6" +[[audits.wgpu-types]] +who = "Nicolas Silva " +criteria = "safe-to-deploy" +delta = "0.17.0@git:7c6b85756237f77bfe8d6231dfc7a1412ff662b6 -> 0.17.0@git:57874e5c540330c8183e19ee87654cf24bb5c250" + [[audits.whatsys]] who = "Bobby Holley " criteria = "safe-to-deploy" diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json index 24e6807c1e1ac..46326340a6912 100644 --- a/third_party/rust/naga/.cargo-checksum.json +++ b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74",".github/workflows/ci.yml":"697899467a40e31c57c4511b237cf4f471fc2d96dc6c9abd846bb55033b6f875",".github/workflows/lazy.yml":"3777882e946c4c60c497bc91d4caf82564d49be646391bc735039ee9a7857fa7",".github/workflows/validation-linux.yml":"133affe3d4b539846d5502af73d0ba1cab8ab6246222a072326324e01fd11216",".github/workflows/validation-macos.yml":"b0431e3abc99313587c4245757416850e54fdd71c15c1c646b192b82b95e3c14",".github/workflows/validation-windows.yml":"4e27d64d8c240ba98f277e6a75f79e0d8499076d62e23579446c06e605abed69","CHANGELOG.md":"58dbdd34df49249dd2d3cd52229483e2dd70cf60f9fa55301d97d7ad073f43ba","Cargo.toml":"6ff631e37dfd9fd6b920d143df66d3d5f6a291aad3e1e3ebe7711537643b778a","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"ca3be8518f5ef097669cea882643fc532025f29972def4fda49df885565a0480","README.md":"c44e378b2a0391f8c0121d51c0792e1de44a96765bfc951c9d664cb92b0d6aa1","benches/criterion.rs":"9a033fe78e8e2fc2f89ba3f928c683bb89110b026cfe31d6ad4991889b7eb71c","codecov.yml":"729a58d729345908460c9cba0ea95bda5f5173256c407a601d870c68476de9d9","src/arena.rs":"068989016d473ccc35f0c829dfec83d3fd7eb8da05b4b107eadc8dd108376937","src/back/dot/mod.rs":"60ea80bd9a2c18b4855c92b9ec73629959ae6e58e4a25ff3bbf2d8c1185fc458","src/back/glsl/features.rs":"966974c89e89289aa2fcb9f96f701d259b2a58a017db25ca73de8f05c30097d6","src/back/glsl/keywords.rs":"3f23b1e63e99a7056c3b223524d5d37000ef7316ae9df25532a726a1157d1dcd","src/back/glsl/mod.rs":"9bd0436547444d80a6a11cec5f14a3286af949c7a45e8b14601807bf13b4d4f4","src/back/hlsl/conv.rs":"f4ab12d3d5bacfc4d2ddc3f9e4145888a8c589a4f8bba30032055d6f06de1f3d","src/back/hlsl/help.rs":"ed947b2bf50715f6bfccd03cfa9fa9e05514782604aba826cdc2cb04efaf4282","src/back/hlsl/keywords.rs":"e9d7771c48420b73ad109d23a68711a3307f12d4fb0d25da72f49b426610679a","src/back/hlsl/mod.rs":"ba17c2ee42a5943b96c4a2e2357fb795eccb2d885e0b37bfa654d16ba0c01584","src/back/hlsl/storage.rs":"3d3a17e7c28d7d9c3365413a849f010358c93f13317f5a475ec15036e0d42f6c","src/back/hlsl/writer.rs":"a575b116eccb2fea6471dccc6a18557103051ac11b337ae896463274e2b10704","src/back/mod.rs":"5fca8d20d4e50beb63434cc94668a5d36930484210bf1f277db9a00d34851b21","src/back/msl/keywords.rs":"e1c2bf804b1a3a56639bedb9c1b3b78fbf920724ef65f91fe2e9fe476ee3fbbf","src/back/msl/mod.rs":"f24279998d52b8c1ff5d4c4c8aa6411b4fdb8634eec241cf1de51ee0c9c0c23d","src/back/msl/sampler.rs":"210cf28143ac17d6c56a9adf4fc0e3b85b1b16bb8b94771f9304f2a43b7ce78e","src/back/msl/writer.rs":"f19698d8854476054ac335fe8a11d947865d931a78aeb2e4671ab47ab2699786","src/back/spv/block.rs":"909481b76c65295af2dcb7d2caca8c9a1e86ae8d586dafb35b955af8aa2536eb","src/back/spv/helpers.rs":"a4e260130f39c7345decec40dadf1e94419c8f6d236ce7a53b5300aa72952a1b","src/back/spv/image.rs":"74fd2d11205be620ef75c7030dc917dabed8e446a41738fe8d78899dcd4c928f","src/back/spv/index.rs":"a69b6788e7ea60bceea5a6d3a8da6069dd7e517e0717c27f7b2c84325c92458e","src/back/spv/instructions.rs":"53ec2944626f214324aca20623b64c84a9e28e5bf9264c8f22a365f69d40fd7e","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"e466ce193eb3d38205f317bcc8636d3c91281aee596f473a7d0888cb837ca3ee","src/back/spv/ray.rs":"fc33992ef61c4eeb19d213b218c31ef27bc73a7a23dde3fe9cf232a5bad0a878","src/back/spv/recyclable.rs":"114db0ea12774d6514f995d07295cb9a42631ab75165fc60980c10e9b5ecb832","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/writer.rs":"e4c800853e01a75fec808b92152d0154103d777ee30c519253d7a01ba1eff3dc","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"51c9ae169aa9f6d9c3ca8cc2caa5c55ab4d04dc463bec303f9f791df09f1b3ac","src/block.rs":"89c061206f608365ef3ce03c0d205d7205ef9d892035dd3dfb8d252003159f14","src/front/glsl/ast.rs":"3644350edabd0f83c476873ec22715a4b1a12a6cb7c99c98d7e41a6173be4ca5","src/front/glsl/builtins.rs":"6d65def0faa6a55ae53a522197d4f67d04112a56f00ae0a06da5b8ff4211a7f8","src/front/glsl/constants.rs":"77cf618aa733d80096b11fdb94557ae379371c2fe943fa46a533d217f402e6c7","src/front/glsl/context.rs":"0068b3728f2d0704914d35b18dfe557adda0bacee8b42de5908928714dfdc50e","src/front/glsl/error.rs":"8617dc35fb3b595b897449076a26696c4556cfd77533c9f957feca48989a553c","src/front/glsl/functions.rs":"04da71db76d81bdd135db3e4aae0a4015e224a00f881396669124d761aa79182","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"50e5687bc6dc04162fe3b0901691122bc26dc95283ace429b5f6b633073cd016","src/front/glsl/offset.rs":"f755eff29868c61452fb8c9f124a6af2070076b8166801968f86f6d105d38298","src/front/glsl/parser.rs":"b23c596b62e2fda9fb0cdbff4660c7769520b65d605aa32cc0767a68b355b816","src/front/glsl/parser/declarations.rs":"a5cf8e99115573c08bac277a190303d80f655e3ac2107828ef88d2afbf9245b0","src/front/glsl/parser/expressions.rs":"c0b7c1d1e609de8230efde5e8d4c8c3f5f48be50042afc321cfeebfe6e6fbfe3","src/front/glsl/parser/functions.rs":"9eba9bf7bac9f78004157adcd3c80b81615f0d175b3f2870ef7dd8a83c9ee000","src/front/glsl/parser/types.rs":"2360e9eaada6f10338e0b832350f2f3de3193575724b4d554f2f0e77f3128afd","src/front/glsl/parser_tests.rs":"4b1280fc60a9c07f05fa7a529be28b57a9b68778eba8092a3da4140e01908261","src/front/glsl/token.rs":"42325adbef5bfc9e6f9e40e7ed3cbfa7ef498c05799fdb7694b123e6450410e1","src/front/glsl/types.rs":"e48f839e87933eafc5ded918653b2b65af6c8200ee863cc7ca69f1e5e6d7860d","src/front/glsl/variables.rs":"5902e61c51ca2616d89e681c0bf81c2245ddd9440357b2f871b9dc9c82ca804c","src/front/interpolator.rs":"1f19f8634c639981d83aa8aa132ca5634bdc99830212eec3eac74c856bd25274","src/front/mod.rs":"61b6750b2f8eec6165dfdc36e7b207ed7d2f48dd25f6d3698f03797997895030","src/front/spv/convert.rs":"80cf575de903d69c158b067706bfcda85c3ada006516d01e6e3a0678396199e0","src/front/spv/error.rs":"3129fd1fe346441d61d0f641734df7e919919db15df706788d16402ebf480607","src/front/spv/function.rs":"e25dada43fcbe399726db9f8bc63b497e7e67485724935f5fbbda8f1b1b9a47c","src/front/spv/image.rs":"a26b97ac58ac1096836f735ef60147b3cc791cb5ce631125f57caeaf0f2505c9","src/front/spv/mod.rs":"b968a4e820ec65d570b61c313634b845672608fecc476457b6d71aae159623ce","src/front/spv/null.rs":"e1446d99d04c76a9c3bbd24dd9b20c4711ce8a918a9b403be6cccbde1175b3b4","src/front/type_gen.rs":"c9293aee27effe07a16977c28cf1109d0fdb3a3200db37039ad1793f308ba91e","src/front/wgsl/error.rs":"024ac60a5bc56779f42272526edcd8c7020115021fd36a86bcac760115ec40b4","src/front/wgsl/index.rs":"2b9a4929a46bd822d3ed6f9a150e24d437e5bdca8293eb748aebe80ce7e74153","src/front/wgsl/lower/construction.rs":"29045c8fe0b05f317fac56c7d4f895e6b0dd253d3ed05efe87d9d702f4cb8927","src/front/wgsl/lower/mod.rs":"5deaf69e38c5a55518b0b14687fa9454a11b347a72913cde12cd73a92e437a4d","src/front/wgsl/mod.rs":"f049afd861b0ab0e8acedd8360395e2b2cbb9c055bb72ccf75cf873f7c0e4227","src/front/wgsl/parse/ast.rs":"9eac24b2064d9094905b5cdf2183aa38e595175454b275c57c79e62013110c83","src/front/wgsl/parse/conv.rs":"25d7f636af48d361931f9cf8f46b70a07ff82391ebfc6ea434d097e417f314c5","src/front/wgsl/parse/lexer.rs":"15e77c8b45de0b19e75c09b4e3b991f092ccff1df4aadf5cb89f9ce131e97b20","src/front/wgsl/parse/mod.rs":"515be6fd8ae29b787a79aff6ddfb1fa0f008c11b1b9b096ae7980063bea166ce","src/front/wgsl/parse/number.rs":"64fe5d5f6b1d6a6acf15f4cad3cda8045ad5d82efda179627f848aba9c47e605","src/front/wgsl/tests.rs":"59b9b4ae86f2b0e2724783e0b0a1674399d03d3af54bc1d03165bc5986f44630","src/keywords/mod.rs":"0138f3931f8af0b0a05174549d0fd2152945b027dc3febefc1bbd676581d2e45","src/keywords/wgsl.rs":"7c3b364b60ca29cb8a68ef781de9ecd28b76b74bed18bf18a35d2ebffaa855ab","src/lib.rs":"2f5c6288e7200b00579790bb7863a72c85b0569f93f580938ea914f913b79437","src/proc/index.rs":"f4250f6944c2b631e8140979024e8deb86fa8d5352d8641ba954a388b2c0940e","src/proc/layouter.rs":"0512547d57920c83b2dfd62595aacf8f437fb5b07e40e790e2dca19c71f5eecc","src/proc/mod.rs":"e76a2e0641d61a62c652d05da323d9e9d67219de7c19253c3879e9cfa886c66c","src/proc/namer.rs":"754e7328ebc4231afcd019aac062dcd8689aead0dec57e6de1a97704ae4289bd","src/proc/terminator.rs":"13c59bf00f5b26171d971effc421091f5e00dedddd246c2daa44fe65aeda060a","src/proc/typifier.rs":"3af9056bc85116613dc0f9e643d1921e31cf74b4ed91220a38eff2523c671b1a","src/span.rs":"67cb6293827f1909b0fce5400df8d39e19a377a16256c61f0a3301aa4248a4bd","src/valid/analyzer.rs":"02500d876bda00fcc21a08c34a808def8b5cc6acb4196529d1dedd2b48b3e004","src/valid/compose.rs":"eebaa461a3a76526361eb5b16dfae42384dfdfde5afa9b1ddca266a2149c68ad","src/valid/expression.rs":"55e4e056750d0e692a61d8b2fab035a232512bcef3d1d05f466a76ab7daf8bad","src/valid/function.rs":"b1b7e52127a3f224488b5749503d51156e3eecf5bd09811db53b77d53dcdc30a","src/valid/handles.rs":"3d90df61a8791fc79f7408cf6cfd339f4db85f372e0e8696a49195e88a4a8bf7","src/valid/interface.rs":"4d3dc8dd0d8db94d2a317a4c499f3c1f10080f55c019b41ac7fa190520d7fe7b","src/valid/mod.rs":"9a8ff4d5668853090d1179e84125d6c2c2bd1d9e18607518f68ab4fb9ac0dc3e","src/valid/type.rs":"8dc7b9833a59e029f6bdb46d879d03be90fedcddc4c37d8d2a6915d990d58070"},"package":null} \ No newline at end of file +{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74",".github/workflows/ci.yml":"ee0ce3876bc6d30573146fa97fa7ec46b762d199187f1f50dfc510bfcb0e8c67",".github/workflows/lazy.yml":"3777882e946c4c60c497bc91d4caf82564d49be646391bc735039ee9a7857fa7",".github/workflows/validation-linux.yml":"133affe3d4b539846d5502af73d0ba1cab8ab6246222a072326324e01fd11216",".github/workflows/validation-macos.yml":"b0431e3abc99313587c4245757416850e54fdd71c15c1c646b192b82b95e3c14",".github/workflows/validation-windows.yml":"4e27d64d8c240ba98f277e6a75f79e0d8499076d62e23579446c06e605abed69","CHANGELOG.md":"141a4150e9abc5347299c12c2f892ab4d2028bcef08247ae29dd5074912f1058","Cargo.toml":"95eceba5cfd870667a04cf5db8aabaa9f3ab0d62f66163e9ba073dce21743fc0","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"ca3be8518f5ef097669cea882643fc532025f29972def4fda49df885565a0480","README.md":"a8209bed7462de253558ee8b197c0ce706d505243b2d23614f74464f1d62e15f","benches/criterion.rs":"9a033fe78e8e2fc2f89ba3f928c683bb89110b026cfe31d6ad4991889b7eb71c","codecov.yml":"729a58d729345908460c9cba0ea95bda5f5173256c407a601d870c68476de9d9","src/arena.rs":"068989016d473ccc35f0c829dfec83d3fd7eb8da05b4b107eadc8dd108376937","src/back/dot/mod.rs":"60ea80bd9a2c18b4855c92b9ec73629959ae6e58e4a25ff3bbf2d8c1185fc458","src/back/glsl/features.rs":"966974c89e89289aa2fcb9f96f701d259b2a58a017db25ca73de8f05c30097d6","src/back/glsl/keywords.rs":"baa2de5dfeb29b6ff4fc5c3c3b8ca26ffd8f8c149eaaf0c67df73d2bb746333c","src/back/glsl/mod.rs":"9bd0436547444d80a6a11cec5f14a3286af949c7a45e8b14601807bf13b4d4f4","src/back/hlsl/conv.rs":"f4ab12d3d5bacfc4d2ddc3f9e4145888a8c589a4f8bba30032055d6f06de1f3d","src/back/hlsl/help.rs":"ed947b2bf50715f6bfccd03cfa9fa9e05514782604aba826cdc2cb04efaf4282","src/back/hlsl/keywords.rs":"e9d7771c48420b73ad109d23a68711a3307f12d4fb0d25da72f49b426610679a","src/back/hlsl/mod.rs":"ba17c2ee42a5943b96c4a2e2357fb795eccb2d885e0b37bfa654d16ba0c01584","src/back/hlsl/storage.rs":"3d3a17e7c28d7d9c3365413a849f010358c93f13317f5a475ec15036e0d42f6c","src/back/hlsl/writer.rs":"a575b116eccb2fea6471dccc6a18557103051ac11b337ae896463274e2b10704","src/back/mod.rs":"5fca8d20d4e50beb63434cc94668a5d36930484210bf1f277db9a00d34851b21","src/back/msl/keywords.rs":"e1c2bf804b1a3a56639bedb9c1b3b78fbf920724ef65f91fe2e9fe476ee3fbbf","src/back/msl/mod.rs":"f24279998d52b8c1ff5d4c4c8aa6411b4fdb8634eec241cf1de51ee0c9c0c23d","src/back/msl/sampler.rs":"210cf28143ac17d6c56a9adf4fc0e3b85b1b16bb8b94771f9304f2a43b7ce78e","src/back/msl/writer.rs":"f19698d8854476054ac335fe8a11d947865d931a78aeb2e4671ab47ab2699786","src/back/spv/block.rs":"d970fbf67b2448ce248341bd59da0f19c03ae73e24afbbdd9144f71240377efc","src/back/spv/helpers.rs":"a4e260130f39c7345decec40dadf1e94419c8f6d236ce7a53b5300aa72952a1b","src/back/spv/image.rs":"09522b7d554b8ff7890256c3b080976aff84fb5f06b2d7c10ae62658928149bd","src/back/spv/index.rs":"26611dd50df5cfd214900e19415f5374dd301d3b7d3bfedbc5ec0f254328287a","src/back/spv/instructions.rs":"53ec2944626f214324aca20623b64c84a9e28e5bf9264c8f22a365f69d40fd7e","src/back/spv/layout.rs":"e263de53cd2f9a03ad94b82b434ce636609bc1ed435a2d1132951663bfaa8ebd","src/back/spv/mod.rs":"0eab37d18ee6e1735cfef87ac2fba2a2530d2b699351912648167d9aef3b73c2","src/back/spv/ray.rs":"4f3942cd7a98b5c3be9021e2f9435927e1ba0cde2ccacb973277d8dbee990d57","src/back/spv/recyclable.rs":"114db0ea12774d6514f995d07295cb9a42631ab75165fc60980c10e9b5ecb832","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/writer.rs":"41da1dfc43a0a0cccc1951379fab04011c23c14bbf4fb2b992fd5b20d613ea06","src/back/wgsl/mod.rs":"2dd12bbea9ace835850192bb68c5760953da6bac6a636073d1eca19381c0c0b6","src/back/wgsl/writer.rs":"51c9ae169aa9f6d9c3ca8cc2caa5c55ab4d04dc463bec303f9f791df09f1b3ac","src/block.rs":"89c061206f608365ef3ce03c0d205d7205ef9d892035dd3dfb8d252003159f14","src/front/glsl/ast.rs":"3644350edabd0f83c476873ec22715a4b1a12a6cb7c99c98d7e41a6173be4ca5","src/front/glsl/builtins.rs":"6d65def0faa6a55ae53a522197d4f67d04112a56f00ae0a06da5b8ff4211a7f8","src/front/glsl/constants.rs":"77cf618aa733d80096b11fdb94557ae379371c2fe943fa46a533d217f402e6c7","src/front/glsl/context.rs":"0068b3728f2d0704914d35b18dfe557adda0bacee8b42de5908928714dfdc50e","src/front/glsl/error.rs":"8617dc35fb3b595b897449076a26696c4556cfd77533c9f957feca48989a553c","src/front/glsl/functions.rs":"04da71db76d81bdd135db3e4aae0a4015e224a00f881396669124d761aa79182","src/front/glsl/lex.rs":"08736ae8beb955da5b0e6e3e0f45995a824995f7096d516a2910417e9c7afa32","src/front/glsl/mod.rs":"50e5687bc6dc04162fe3b0901691122bc26dc95283ace429b5f6b633073cd016","src/front/glsl/offset.rs":"f755eff29868c61452fb8c9f124a6af2070076b8166801968f86f6d105d38298","src/front/glsl/parser.rs":"b23c596b62e2fda9fb0cdbff4660c7769520b65d605aa32cc0767a68b355b816","src/front/glsl/parser/declarations.rs":"a5cf8e99115573c08bac277a190303d80f655e3ac2107828ef88d2afbf9245b0","src/front/glsl/parser/expressions.rs":"c0b7c1d1e609de8230efde5e8d4c8c3f5f48be50042afc321cfeebfe6e6fbfe3","src/front/glsl/parser/functions.rs":"9eba9bf7bac9f78004157adcd3c80b81615f0d175b3f2870ef7dd8a83c9ee000","src/front/glsl/parser/types.rs":"2360e9eaada6f10338e0b832350f2f3de3193575724b4d554f2f0e77f3128afd","src/front/glsl/parser_tests.rs":"4b1280fc60a9c07f05fa7a529be28b57a9b68778eba8092a3da4140e01908261","src/front/glsl/token.rs":"42325adbef5bfc9e6f9e40e7ed3cbfa7ef498c05799fdb7694b123e6450410e1","src/front/glsl/types.rs":"e48f839e87933eafc5ded918653b2b65af6c8200ee863cc7ca69f1e5e6d7860d","src/front/glsl/variables.rs":"5902e61c51ca2616d89e681c0bf81c2245ddd9440357b2f871b9dc9c82ca804c","src/front/interpolator.rs":"1f19f8634c639981d83aa8aa132ca5634bdc99830212eec3eac74c856bd25274","src/front/mod.rs":"61b6750b2f8eec6165dfdc36e7b207ed7d2f48dd25f6d3698f03797997895030","src/front/spv/convert.rs":"80cf575de903d69c158b067706bfcda85c3ada006516d01e6e3a0678396199e0","src/front/spv/error.rs":"3129fd1fe346441d61d0f641734df7e919919db15df706788d16402ebf480607","src/front/spv/function.rs":"e25dada43fcbe399726db9f8bc63b497e7e67485724935f5fbbda8f1b1b9a47c","src/front/spv/image.rs":"06be5f35e09a91d7bb20693f777394fe2c3985d01fcfe2977cebba791da05e04","src/front/spv/mod.rs":"ca233be58417e482f152f142da1b3a40333a0940920f45480a69638f60ed2166","src/front/spv/null.rs":"e1446d99d04c76a9c3bbd24dd9b20c4711ce8a918a9b403be6cccbde1175b3b4","src/front/type_gen.rs":"c9293aee27effe07a16977c28cf1109d0fdb3a3200db37039ad1793f308ba91e","src/front/wgsl/error.rs":"4af6c67ab418a666a77a190294b744a42064c13c1a3098d91e27f5e7c700074c","src/front/wgsl/index.rs":"2b9a4929a46bd822d3ed6f9a150e24d437e5bdca8293eb748aebe80ce7e74153","src/front/wgsl/lower/construction.rs":"29045c8fe0b05f317fac56c7d4f895e6b0dd253d3ed05efe87d9d702f4cb8927","src/front/wgsl/lower/mod.rs":"b4b6817229c371411af6675d2908ba1bf6bc9ea2078af38b6427101651fa141f","src/front/wgsl/mod.rs":"f049afd861b0ab0e8acedd8360395e2b2cbb9c055bb72ccf75cf873f7c0e4227","src/front/wgsl/parse/ast.rs":"9eac24b2064d9094905b5cdf2183aa38e595175454b275c57c79e62013110c83","src/front/wgsl/parse/conv.rs":"25d7f636af48d361931f9cf8f46b70a07ff82391ebfc6ea434d097e417f314c5","src/front/wgsl/parse/lexer.rs":"15e77c8b45de0b19e75c09b4e3b991f092ccff1df4aadf5cb89f9ce131e97b20","src/front/wgsl/parse/mod.rs":"f60b8302ac6e3e6df87b732d662352d7a9f226d265042f684488a08d0a93cdd7","src/front/wgsl/parse/number.rs":"64fe5d5f6b1d6a6acf15f4cad3cda8045ad5d82efda179627f848aba9c47e605","src/front/wgsl/tests.rs":"b41bf972dc61de1255f5fd865bab777c5338ca4b847cc6803640340c38a3f3e5","src/keywords/mod.rs":"0138f3931f8af0b0a05174549d0fd2152945b027dc3febefc1bbd676581d2e45","src/keywords/wgsl.rs":"7c3b364b60ca29cb8a68ef781de9ecd28b76b74bed18bf18a35d2ebffaa855ab","src/lib.rs":"4d29d777aec21f0904a8079343495523b992c4f19b739f1d9ec3c5baefd7e604","src/proc/index.rs":"f4250f6944c2b631e8140979024e8deb86fa8d5352d8641ba954a388b2c0940e","src/proc/layouter.rs":"0512547d57920c83b2dfd62595aacf8f437fb5b07e40e790e2dca19c71f5eecc","src/proc/mod.rs":"e76a2e0641d61a62c652d05da323d9e9d67219de7c19253c3879e9cfa886c66c","src/proc/namer.rs":"754e7328ebc4231afcd019aac062dcd8689aead0dec57e6de1a97704ae4289bd","src/proc/terminator.rs":"13c59bf00f5b26171d971effc421091f5e00dedddd246c2daa44fe65aeda060a","src/proc/typifier.rs":"3af9056bc85116613dc0f9e643d1921e31cf74b4ed91220a38eff2523c671b1a","src/span.rs":"67cb6293827f1909b0fce5400df8d39e19a377a16256c61f0a3301aa4248a4bd","src/valid/analyzer.rs":"02500d876bda00fcc21a08c34a808def8b5cc6acb4196529d1dedd2b48b3e004","src/valid/compose.rs":"eebaa461a3a76526361eb5b16dfae42384dfdfde5afa9b1ddca266a2149c68ad","src/valid/expression.rs":"55e4e056750d0e692a61d8b2fab035a232512bcef3d1d05f466a76ab7daf8bad","src/valid/function.rs":"b1b7e52127a3f224488b5749503d51156e3eecf5bd09811db53b77d53dcdc30a","src/valid/handles.rs":"3d90df61a8791fc79f7408cf6cfd339f4db85f372e0e8696a49195e88a4a8bf7","src/valid/interface.rs":"4ba8a5849864805fa017136f6377fbe5d37741a5275b89e329a1327354913035","src/valid/mod.rs":"9a8ff4d5668853090d1179e84125d6c2c2bd1d9e18607518f68ab4fb9ac0dc3e","src/valid/type.rs":"8dc7b9833a59e029f6bdb46d879d03be90fedcddc4c37d8d2a6915d990d58070"},"package":null} \ No newline at end of file diff --git a/third_party/rust/naga/.github/workflows/ci.yml b/third_party/rust/naga/.github/workflows/ci.yml index ce951216b955e..ef2c497129c77 100644 --- a/third_party/rust/naga/.github/workflows/ci.yml +++ b/third_party/rust/naga/.github/workflows/ci.yml @@ -5,7 +5,7 @@ env: CARGO_INCREMENTAL: false CARGO_TERM_COLOR: always RUST_BACKTRACE: full - MSRV: 1.63 + MSRV: 1.65 jobs: check-msrv: @@ -26,7 +26,7 @@ jobs: tool: cargo-hack # -Z avoid-dev-deps doesn't work - - run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z minimal-versions --offline + - run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z minimal-versions - name: Test all features run: cargo +$MSRV clippy --all-features --workspace -- -D warnings diff --git a/third_party/rust/naga/CHANGELOG.md b/third_party/rust/naga/CHANGELOG.md index 376bbf8989e57..c6dd0133958cb 100644 --- a/third_party/rust/naga/CHANGELOG.md +++ b/third_party/rust/naga/CHANGELOG.md @@ -1,5 +1,99 @@ # Change Log +## Unreleased + +#### GENERAL + +- Bump MSRV to 1.65 ([#2420](https://github.com/gfx-rs/naga/pull/2420)) **@jimblandy** + +## v0.13 (2023-07-21) + +#### GENERAL + +- Move from `make` to `cargo xtask` workflows. ([#2297](https://github.com/gfx-rs/naga/pull/2297)) **@ErichDonGubler** +- Omit non referenced expressions from output. ([#2378](https://github.com/gfx-rs/naga/pull/2378)) **@teoxoy** +- Bump `bitflags` to v2. ([#2358](https://github.com/gfx-rs/naga/pull/2358)) **@daxpedda** +- Implement `workgroupUniformLoad`. ([#2201](https://github.com/gfx-rs/naga/pull/2201)) **@DJMcNab** + +#### API + +- Expose early depth test field. ([#2393](https://github.com/gfx-rs/naga/pull/2393)) **@Joeoc2001** +- Split image bounds check policy. ([#2265](https://github.com/gfx-rs/naga/pull/2265)) **@teoxoy** +- Change type of constant sized arrays to `NonZeroU32`. ([#2337](https://github.com/gfx-rs/naga/pull/2337)) **@teoxoy** +- Introduce `GlobalCtx`. ([#2335](https://github.com/gfx-rs/naga/pull/2335)) **@teoxoy** +- Introduce `Expression::Literal`. ([#2333](https://github.com/gfx-rs/naga/pull/2333)) **@teoxoy** +- Introduce `Expression::ZeroValue`. ([#2332](https://github.com/gfx-rs/naga/pull/2332)) **@teoxoy** +- Add support for const-expressions (only at the API level, functionality is still WIP). ([#2266](https://github.com/gfx-rs/naga/pull/2266)) **@teoxoy**, **@jimblandy** + +#### DOCS + +- Document which expressions are in scope for a `break_if` expression. ([#2326](https://github.com/gfx-rs/naga/pull/2326)) **@jimblandy** + +#### VALIDATOR + +- Don't `use std::opsIndex`, used only when `"validate"` is on. ([#2383](https://github.com/gfx-rs/naga/pull/2383)) **@jimblandy** +- Remove unneeded `ConstantError::Unresolved{Component,Size}`. ([#2330](https://github.com/gfx-rs/naga/pull/2330)) **@ErichDonGubler** +- Remove `TypeError::UnresolvedBase`. ([#2308](https://github.com/gfx-rs/naga/pull/2308)) **@ErichDonGubler** + +#### WGSL-IN + +- Error on param redefinition. ([#2342](https://github.com/gfx-rs/naga/pull/2342)) **@SparkyPotato** + +#### SPV-IN + +- Improve documentation for SPIR-V control flow parsing. ([#2324](https://github.com/gfx-rs/naga/pull/2324)) **@jimblandy** +- Obey the `is_depth` field of `OpTypeImage`. ([#2341](https://github.com/gfx-rs/naga/pull/2341)) **@expenses** +- Convert conditional backedges to `break if`. ([#2290](https://github.com/gfx-rs/naga/pull/2290)) **@eddyb** + +#### GLSL-IN + +- Support commas in structure definitions. ([#2400](https://github.com/gfx-rs/naga/pull/2400)) **@fornwall** + +#### SPV-OUT + +- Add debug info. ([#2379](https://github.com/gfx-rs/naga/pull/2379)) **@wicast** +- Use `IndexSet` instead of `HashSet` for iterated sets (capabilities/extensions). ([#2389](https://github.com/gfx-rs/naga/pull/2389)) **@eddyb** +- Support array bindings of buffers. ([#2282](https://github.com/gfx-rs/naga/pull/2282)) **@kvark** + +#### MSL-OUT + +- Rename `allow_point_size` to `allow_and_force_point_size`. ([#2280](https://github.com/gfx-rs/naga/pull/2280)) **@teoxoy** +- Initialize arrays inline. ([#2331](https://github.com/gfx-rs/naga/pull/2331)) **@teoxoy** + +#### HLSL-OUT + +- Implement Pack/Unpack for HLSL. ([#2353](https://github.com/gfx-rs/naga/pull/2353)) **@Elabajaba** +- Complete HLSL reserved symbols. ([#2367](https://github.com/gfx-rs/naga/pull/2367)) **@teoxoy** +- Handle case insensitive FXC keywords. ([#2347](https://github.com/gfx-rs/naga/pull/2347)) **@PJB3005** +- Fix return type for firstbitlow/high. ([#2315](https://github.com/gfx-rs/naga/pull/2315)) **@evahop** + +#### GLSL-OUT + +- `textureSize` level must be a signed integer. ([#2397](https://github.com/gfx-rs/naga/pull/2397)) **@nical** +- Fix functions with array return type. ([#2382](https://github.com/gfx-rs/naga/pull/2382)) **@Gordon-F** + +#### WGSL-OUT + +- Output `@interpolate(flat)` attribute for integer locations. ([#2318](https://github.com/gfx-rs/naga/pull/2318)) **@expenses** + +## v0.12.3 (2023-07-09) + +#### WGSL-OUT + +- (Backport) Output `@interpolate(flat)` attribute for integer locations. ([#2318](https://github.com/gfx-rs/naga/pull/2318)) **@expenses** + +## v0.12.2 (2023-05-30) + +#### SPV-OUT + +- (Backport) Support array bindings of buffers. ([#2282](https://github.com/gfx-rs/naga/pull/2282)) **@kvark** + +## v0.12.1 (2023-05-18) + +#### SPV-IN + +- (Backport) Convert conditional backedges to `break if`. ([#2290](https://github.com/gfx-rs/naga/pull/2290)) **@eddyb** + ## v0.12 (2023-04-19) #### GENERAL @@ -71,6 +165,12 @@ - Skip `invariant` for `gl_FragCoord` on WebGL2. ([#2254](https://github.com/gfx-rs/naga/pull/2254)) **@grovesNL** - Inject default `gl_PointSize = 1.0` in vertex shaders if `FORCE_POINT_SIZE` option was set. ([#2223](https://github.com/gfx-rs/naga/pull/2223)) **@REASY** +## v0.11.1 (2023-05-18) + +#### SPV-IN + +- (Backport) Convert conditional backedges to `break if`. ([#2290](https://github.com/gfx-rs/naga/pull/2290)) **@eddyb** + ## v0.11 (2023-01-25) - Move to the Rust 2021 edition ([#2085](https://github.com/gfx-rs/naga/pull/2085)) **@ErichDonGubler** @@ -163,6 +263,14 @@ - Write correct scalar kind when `width != 4` ([#1514](https://github.com/gfx-rs/naga/pull/1514)) **@fintelia** +## v0.10.1 (2023-06-21) + +SPV-OUT +- Backport #2389 (Use `IndexSet` instead of `HashSet` for iterated sets (capabilities/extensions)) by @eddyb, @jimblandy in https://github.com/gfx-rs/naga/pull/2391 + +SPV-IN +- Backport #2290 (Convert conditional backedges to `break if`) by @eddyb in https://github.com/gfx-rs/naga/pull/2387 + ## v0.10 (2022-10-05) - Make termcolor dependency optional by @AldaronLau in https://github.com/gfx-rs/naga/pull/2014 diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml index 07bbcbdb78a24..56564902867e2 100644 --- a/third_party/rust/naga/Cargo.toml +++ b/third_party/rust/naga/Cargo.toml @@ -11,7 +11,7 @@ [package] edition = "2021" -rust-version = "1.63" +rust-version = "1.65" name = "naga" version = "0.13.0" authors = ["Naga Developers"] @@ -49,14 +49,14 @@ harness = false [dependencies] bit-set = "0.5" -bitflags = "2" +bitflags = "2.2" log = "0.4" num-traits = "0.2" rustc-hash = "1.1.0" thiserror = "1.0.21" [dependencies.arbitrary] -version = "1.0.2" +version = "1.3" features = ["derive"] optional = true @@ -69,7 +69,7 @@ version = "0.2.1" optional = true [dependencies.indexmap] -version = "1.9.2" +version = "2" features = ["std"] [dependencies.petgraph] @@ -134,7 +134,7 @@ default = [] deserialize = [ "serde", "bitflags/serde", - "indexmap/serde-1", + "indexmap/serde", ] dot-out = [] glsl-in = ["pp-rs"] @@ -144,7 +144,7 @@ msl-out = [] serialize = [ "serde", "bitflags/serde", - "indexmap/serde-1", + "indexmap/serde", ] span = [ "codespan-reporting", diff --git a/third_party/rust/naga/README.md b/third_party/rust/naga/README.md index c9f22e502d72b..04ed84ab5ec46 100644 --- a/third_party/rust/naga/README.md +++ b/third_party/rust/naga/README.md @@ -4,7 +4,7 @@ [![Crates.io](https://img.shields.io/crates/v/naga.svg?label=naga)](https://crates.io/crates/naga) [![Docs.rs](https://docs.rs/naga/badge.svg)](https://docs.rs/naga) [![Build Status](https://github.com/gfx-rs/naga/workflows/pipeline/badge.svg)](https://github.com/gfx-rs/naga/actions) -![MSRV](https://img.shields.io/badge/rustc-1.63+-blue.svg) +![MSRV](https://img.shields.io/badge/rustc-1.65+-blue.svg) [![codecov.io](https://codecov.io/gh/gfx-rs/naga/branch/master/graph/badge.svg?token=9VOKYO8BM2)](https://codecov.io/gh/gfx-rs/naga) The shader translation library for the needs of [wgpu](https://github.com/gfx-rs/wgpu). diff --git a/third_party/rust/naga/src/back/glsl/keywords.rs b/third_party/rust/naga/src/back/glsl/keywords.rs index 5a2836c189a96..9679020a0a2ba 100644 --- a/third_party/rust/naga/src/back/glsl/keywords.rs +++ b/third_party/rust/naga/src/back/glsl/keywords.rs @@ -1,10 +1,17 @@ pub const RESERVED_KEYWORDS: &[&str] = &[ - "attribute", + // + // GLSL 4.6 keywords, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L2004-L2322 + // GLSL ES 3.2 keywords, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/es/3.2/GLSL_ES_Specification_3.20.html#L2166-L2478 + // + // Note: The GLSL ES 3.2 keywords are the same as GLSL 4.6 keywords with some residing in the reserved section. + // The only exception are the missing Vulkan keywords which I think is an oversight (see https://github.com/KhronosGroup/OpenGL-Registry/issues/585). + // "const", "uniform", - "varying", "buffer", "shared", + "attribute", + "varying", "coherent", "volatile", "restrict", @@ -18,6 +25,8 @@ pub const RESERVED_KEYWORDS: &[&str] = &[ "noperspective", "patch", "sample", + "invariant", + "precise", "break", "continue", "do", @@ -32,135 +41,176 @@ pub const RESERVED_KEYWORDS: &[&str] = &[ "in", "out", "inout", - "float", - "double", "int", "void", "bool", "true", "false", - "invariant", - "precise", + "float", + "double", "discard", "return", + "vec2", + "vec3", + "vec4", + "ivec2", + "ivec3", + "ivec4", + "bvec2", + "bvec3", + "bvec4", + "uint", + "uvec2", + "uvec3", + "uvec4", + "dvec2", + "dvec3", + "dvec4", "mat2", "mat3", "mat4", - "dmat2", - "dmat3", - "dmat4", "mat2x2", "mat2x3", "mat2x4", - "dmat2x2", - "dmat2x3", - "dmat2x4", "mat3x2", "mat3x3", "mat3x4", - "dmat3x2", - "dmat3x3", - "dmat3x4", "mat4x2", "mat4x3", "mat4x4", + "dmat2", + "dmat3", + "dmat4", + "dmat2x2", + "dmat2x3", + "dmat2x4", + "dmat3x2", + "dmat3x3", + "dmat3x4", "dmat4x2", "dmat4x3", "dmat4x4", - "vec2", - "vec3", - "vec4", - "ivec2", - "ivec3", - "ivec4", - "bvec2", - "bvec3", - "bvec4", - "dvec2", - "dvec3", - "dvec4", - "uint", - "uvec2", - "uvec3", - "uvec4", "lowp", "mediump", "highp", "precision", "sampler1D", - "sampler2D", - "sampler3D", - "samplerCube", "sampler1DShadow", - "sampler2DShadow", - "samplerCubeShadow", "sampler1DArray", - "sampler2DArray", "sampler1DArrayShadow", - "sampler2DArrayShadow", "isampler1D", - "isampler2D", - "isampler3D", - "isamplerCube", "isampler1DArray", - "isampler2DArray", "usampler1D", - "usampler2D", - "usampler3D", - "usamplerCube", "usampler1DArray", + "sampler2D", + "sampler2DShadow", + "sampler2DArray", + "sampler2DArrayShadow", + "isampler2D", + "isampler2DArray", + "usampler2D", "usampler2DArray", "sampler2DRect", "sampler2DRectShadow", - "isampler2D", - "Rect", + "isampler2DRect", "usampler2DRect", - "samplerBuffer", - "isamplerBuffer", - "usamplerBuffer", "sampler2DMS", "isampler2DMS", "usampler2DMS", "sampler2DMSArray", "isampler2DMSArray", "usampler2DMSArray", + "sampler3D", + "isampler3D", + "usampler3D", + "samplerCube", + "samplerCubeShadow", + "isamplerCube", + "usamplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "isamplerCubeArray", "usamplerCubeArray", + "samplerBuffer", + "isamplerBuffer", + "usamplerBuffer", "image1D", "iimage1D", "uimage1D", + "image1DArray", + "iimage1DArray", + "uimage1DArray", "image2D", "iimage2D", "uimage2D", - "image3D", - "iimage3D", - "uimage3D", + "image2DArray", + "iimage2DArray", + "uimage2DArray", "image2DRect", "iimage2DRect", "uimage2DRect", + "image2DMS", + "iimage2DMS", + "uimage2DMS", + "image2DMSArray", + "iimage2DMSArray", + "uimage2DMSArray", + "image3D", + "iimage3D", + "uimage3D", "imageCube", "iimageCube", "uimageCube", - "imageBuffer", - "iimageBuffer", - "uimageBuffer", - "image1DArray", - "iimage1DArray", - "uimage1DArray", - "image2DArray", - "iimage2DArray", - "uimage2DArray", "imageCubeArray", "iimageCubeArray", "uimageCubeArray", - "image2DMS", - "iimage2DMS", - "uimage2DMS", - "image2DMSArray", - "iimage2DMSArray", - "uimage2DMSArraystruct", + "imageBuffer", + "iimageBuffer", + "uimageBuffer", + "struct", + // Vulkan keywords + "texture1D", + "texture1DArray", + "itexture1D", + "itexture1DArray", + "utexture1D", + "utexture1DArray", + "texture2D", + "texture2DArray", + "itexture2D", + "itexture2DArray", + "utexture2D", + "utexture2DArray", + "texture2DRect", + "itexture2DRect", + "utexture2DRect", + "texture2DMS", + "itexture2DMS", + "utexture2DMS", + "texture2DMSArray", + "itexture2DMSArray", + "utexture2DMSArray", + "texture3D", + "itexture3D", + "utexture3D", + "textureCube", + "itextureCube", + "utextureCube", + "textureCubeArray", + "itextureCubeArray", + "utextureCubeArray", + "textureBuffer", + "itextureBuffer", + "utextureBuffer", + "sampler", + "samplerShadow", + "subpassInput", + "isubpassInput", + "usubpassInput", + "subpassInputMS", + "isubpassInputMS", + "usubpassInputMS", + // Reserved keywords "common", "partition", "active", @@ -194,11 +244,237 @@ pub const RESERVED_KEYWORDS: &[&str] = &[ "fvec2", "fvec3", "fvec4", - "sampler3DRect", "filter", "sizeof", "cast", "namespace", "using", + "sampler3DRect", + // + // GLSL 4.6 Built-In Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L13314 + // + // Angle and Trigonometry Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L13469-L13561C5 + "radians", + "degrees", + "sin", + "cos", + "tan", + "asin", + "acos", + "atan", + "sinh", + "cosh", + "tanh", + "asinh", + "acosh", + "atanh", + // Exponential Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L13569-L13620 + "pow", + "exp", + "log", + "exp2", + "log2", + "sqrt", + "inversesqrt", + // Common Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L13628-L13908 + "abs", + "sign", + "floor", + "trunc", + "round", + "roundEven", + "ceil", + "fract", + "mod", + "modf", + "min", + "max", + "clamp", + "mix", + "step", + "smoothstep", + "isnan", + "isinf", + "floatBitsToInt", + "floatBitsToUint", + "intBitsToFloat", + "uintBitsToFloat", + "fma", + "frexp", + "ldexp", + // Floating-Point Pack and Unpack Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L13916-L14007 + "packUnorm2x16", + "packSnorm2x16", + "packUnorm4x8", + "packSnorm4x8", + "unpackUnorm2x16", + "unpackSnorm2x16", + "unpackUnorm4x8", + "unpackSnorm4x8", + "packHalf2x16", + "unpackHalf2x16", + "packDouble2x32", + "unpackDouble2x32", + // Geometric Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14014-L14121 + "length", + "distance", + "dot", + "cross", + "normalize", + "ftransform", + "faceforward", + "reflect", + "refract", + // Matrix Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14151-L14215 + "matrixCompMult", + "outerProduct", + "transpose", + "determinant", + "inverse", + // Vector Relational Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14259-L14322 + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual", + "equal", + "notEqual", + "any", + "all", + "not", + // Integer Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14335-L14432 + "uaddCarry", + "usubBorrow", + "umulExtended", + "imulExtended", + "bitfieldExtract", + "bitfieldInsert", + "bitfieldReverse", + "bitCount", + "findLSB", + "findMSB", + // Texture Query Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14645-L14732 + "textureSize", + "textureQueryLod", + "textureQueryLevels", + "textureSamples", + // Texel Lookup Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L14736-L14997 + "texture", + "textureProj", + "textureLod", + "textureOffset", + "texelFetch", + "texelFetchOffset", + "textureProjOffset", + "textureLodOffset", + "textureProjLod", + "textureProjLodOffset", + "textureGrad", + "textureGradOffset", + "textureProjGrad", + "textureProjGradOffset", + // Texture Gather Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15077-L15154 + "textureGather", + "textureGatherOffset", + "textureGatherOffsets", + // Compatibility Profile Texture Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15161-L15220 + "texture1D", + "texture1DProj", + "texture1DLod", + "texture1DProjLod", + "texture2D", + "texture2DProj", + "texture2DLod", + "texture2DProjLod", + "texture3D", + "texture3DProj", + "texture3DLod", + "texture3DProjLod", + "textureCube", + "textureCubeLod", + "shadow1D", + "shadow2D", + "shadow1DProj", + "shadow2DProj", + "shadow1DLod", + "shadow2DLod", + "shadow1DProjLod", + "shadow2DProjLod", + // Atomic Counter Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15241-L15531 + "atomicCounterIncrement", + "atomicCounterDecrement", + "atomicCounter", + "atomicCounterAdd", + "atomicCounterSubtract", + "atomicCounterMin", + "atomicCounterMax", + "atomicCounterAnd", + "atomicCounterOr", + "atomicCounterXor", + "atomicCounterExchange", + "atomicCounterCompSwap", + // Atomic Memory Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15563-L15624 + "atomicAdd", + "atomicMin", + "atomicMax", + "atomicAnd", + "atomicOr", + "atomicXor", + "atomicExchange", + "atomicCompSwap", + // Image Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15763-L15878 + "imageSize", + "imageSamples", + "imageLoad", + "imageStore", + "imageAtomicAdd", + "imageAtomicMin", + "imageAtomicMax", + "imageAtomicAnd", + "imageAtomicOr", + "imageAtomicXor", + "imageAtomicExchange", + "imageAtomicCompSwap", + // Geometry Shader Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L15886-L15932 + "EmitStreamVertex", + "EndStreamPrimitive", + "EmitVertex", + "EndPrimitive", + // Fragment Processing Functions, Derivative Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16041-L16114 + "dFdx", + "dFdy", + "dFdxFine", + "dFdyFine", + "dFdxCoarse", + "dFdyCoarse", + "fwidth", + "fwidthFine", + "fwidthCoarse", + // Fragment Processing Functions, Interpolation Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16150-L16198 + "interpolateAtCentroid", + "interpolateAtSample", + "interpolateAtOffset", + // Noise Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16214-L16243 + "noise1", + "noise2", + "noise3", + "noise4", + // Shader Invocation Control Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16255-L16276 + "barrier", + // Shader Memory Control Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16336-L16382 + "memoryBarrier", + "memoryBarrierAtomicCounter", + "memoryBarrierBuffer", + "memoryBarrierShared", + "memoryBarrierImage", + "groupMemoryBarrier", + // Subpass-Input Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16451-L16470 + "subpassLoad", + // Shader Invocation Group Functions, from https://github.com/KhronosGroup/OpenGL-Registry/blob/d00e11dc1a1ffba581d633f21f70202051248d5c/specs/gl/GLSLangSpec.4.60.html#L16483-L16511 + "anyInvocation", + "allInvocations", + "allInvocationsEqual", + // + // entry point name (should not be shadowed) + // "main", ]; diff --git a/third_party/rust/naga/src/back/spv/block.rs b/third_party/rust/naga/src/back/spv/block.rs index ec3531ede1fae..11841bc5228b2 100644 --- a/third_party/rust/naga/src/back/spv/block.rs +++ b/third_party/rust/naga/src/back/spv/block.rs @@ -242,7 +242,7 @@ impl<'w> BlockContext<'w> { let init = self.ir_module.constants[handle].init; self.writer.constant_ids[init.index()] } - crate::Expression::ZeroValue(_) => self.writer.write_constant_null(result_type_id), + crate::Expression::ZeroValue(_) => self.writer.get_constant_null(result_type_id), crate::Expression::Compose { ty: _, ref components, @@ -271,6 +271,7 @@ impl<'w> BlockContext<'w> { crate::TypeInner::Vector { .. } => { self.write_vector_access(expr_handle, base, index, block)? } + // Only binding arrays in the Handle address space will take this path (due to `is_intermediate`) crate::TypeInner::BindingArray { base: binding_type, .. } => { @@ -308,6 +309,14 @@ impl<'w> BlockContext<'w> { None, )); + // Subsequent image operations require the image/sampler to be decorated as NonUniform + // if the image/sampler binding array was accessed with a non-uniform index + // see VUID-RuntimeSpirv-NonUniform-06274 + if self.fun_info[index].uniformity.non_uniform_result.is_some() { + self.writer + .decorate_non_uniform_binding_array_access(load_id)?; + } + load_id } ref other => { @@ -347,6 +356,7 @@ impl<'w> BlockContext<'w> { )); id } + // Only binding arrays in the Handle address space will take this path (due to `is_intermediate`) crate::TypeInner::BindingArray { base: binding_type, .. } => { @@ -1426,8 +1436,8 @@ impl<'w> BlockContext<'w> { ) -> Result { let result_lookup_ty = match self.fun_info[expr_handle].ty { TypeResolution::Handle(ty_handle) => match return_type_override { - // We use the return type override as a special case for binding arrays as the OpAccessChain - // needs to return a pointer, but indexing into a binding array just gives you the type of + // We use the return type override as a special case for handle binding arrays as the OpAccessChain + // needs to return a pointer, but indexing into a handle binding array just gives you the type of // the binding in the IR. Some(ty) => ty, None => LookupType::Handle(ty_handle), @@ -1454,12 +1464,20 @@ impl<'w> BlockContext<'w> { if let crate::Expression::GlobalVariable(var_handle) = self.ir_function.expressions[base] { - let gvar = &self.ir_module.global_variables[var_handle]; - if let crate::TypeInner::BindingArray { .. } = - self.ir_module.types[gvar.ty].inner - { - is_non_uniform_binding_array |= - self.fun_info[index].uniformity.non_uniform_result.is_some(); + let gvar: &crate::GlobalVariable = + &self.ir_module.global_variables[var_handle]; + match gvar.space { + crate::AddressSpace::Storage { .. } | crate::AddressSpace::Uniform => { + if let crate::TypeInner::BindingArray { .. } = + self.ir_module.types[gvar.ty].inner + { + is_non_uniform_binding_array = self.fun_info[index] + .uniformity + .non_uniform_result + .is_some(); + } + } + _ => {} } } @@ -1543,6 +1561,9 @@ impl<'w> BlockContext<'w> { }; (pointer_id, expr_pointer) }; + // Subsequent load, store and atomic operations require the pointer to be decorated as NonUniform + // if the buffer binding array was accessed with a non-uniform index + // see VUID-RuntimeSpirv-NonUniform-06274 if is_non_uniform_binding_array { self.writer .decorate_non_uniform_binding_array_access(pointer_id)?; @@ -1658,7 +1679,7 @@ impl<'w> BlockContext<'w> { size: u32, block: &mut Block, ) { - let mut partial_sum = self.writer.write_constant_null(result_type_id); + let mut partial_sum = self.writer.get_constant_null(result_type_id); let last_component = size - 1; for index in 0..=last_component { // compute the product of the current components @@ -2315,7 +2336,7 @@ impl<'w> BlockContext<'w> { BlockExit::Return => match self.ir_function.result { Some(ref result) if self.function.entry_point_context.is_none() => { let type_id = self.get_type_id(LookupType::Handle(result.ty)); - let null_id = self.writer.write_constant_null(type_id); + let null_id = self.writer.get_constant_null(type_id); Instruction::return_value(null_id) } _ => Instruction::return_void(), diff --git a/third_party/rust/naga/src/back/spv/image.rs b/third_party/rust/naga/src/back/spv/image.rs index ac4b71d95897f..b4d2fb9e16cba 100644 --- a/third_party/rust/naga/src/back/spv/image.rs +++ b/third_party/rust/naga/src/back/spv/image.rs @@ -189,7 +189,7 @@ impl Access for Load { } fn out_of_bounds_value(&self, ctx: &mut BlockContext<'_>) -> Word { - ctx.writer.write_constant_null(self.type_id) + ctx.writer.get_constant_null(self.type_id) } } @@ -379,7 +379,7 @@ impl<'w> BlockContext<'w> { }) } - pub(super) fn get_image_id(&mut self, expr_handle: Handle) -> Word { + pub(super) fn get_handle_id(&mut self, expr_handle: Handle) -> Word { let id = match self.ir_function.expressions[expr_handle] { crate::Expression::GlobalVariable(handle) => { self.writer.global_variables[handle.index()].handle_id @@ -745,7 +745,7 @@ impl<'w> BlockContext<'w> { sample: Option>, block: &mut Block, ) -> Result { - let image_id = self.get_image_id(image); + let image_id = self.get_handle_id(image); let image_type = self.fun_info[image].ty.inner_with(&self.ir_module.types); let image_class = match *image_type { crate::TypeInner::Image { class, .. } => class, @@ -830,7 +830,7 @@ impl<'w> BlockContext<'w> { ) -> Result { use super::instructions::SampleLod; // image - let image_id = self.get_image_id(image); + let image_id = self.get_handle_id(image); let image_type = self.fun_info[image].ty.handle().unwrap(); // SPIR-V doesn't know about our `Depth` class, and it returns // `vec4`, so we need to grab the first component out of it. @@ -857,7 +857,7 @@ impl<'w> BlockContext<'w> { let sampled_image_type_id = self.get_type_id(LookupType::Local(LocalType::SampledImage { image_type_id })); - let sampler_id = self.get_image_id(sampler); + let sampler_id = self.get_handle_id(sampler); let coordinates_id = self .write_image_coordinates(coordinate, array_index, block)? .value_id; @@ -1013,7 +1013,7 @@ impl<'w> BlockContext<'w> { ) -> Result { use crate::{ImageClass as Ic, ImageDimension as Id, ImageQuery as Iq}; - let image_id = self.get_image_id(image); + let image_id = self.get_handle_id(image); let image_type = self.fun_info[image].ty.handle().unwrap(); let (dim, arrayed, class) = match self.ir_module.types[image_type].inner { crate::TypeInner::Image { @@ -1045,7 +1045,7 @@ impl<'w> BlockContext<'w> { }; let extended_size_type_id = self.get_type_id(LookupType::Local(LocalType::Value { vector_size, - kind: crate::ScalarKind::Sint, + kind: crate::ScalarKind::Uint, width: 4, pointer_space: None, })); @@ -1077,24 +1077,7 @@ impl<'w> BlockContext<'w> { } block.body.push(inst); - let bitcast_type_id = self.get_type_id( - LocalType::Value { - vector_size, - kind: crate::ScalarKind::Uint, - width: 4, - pointer_space: None, - } - .into(), - ); - let bitcast_id = self.gen_id(); - block.body.push(Instruction::unary( - spirv::Op::Bitcast, - bitcast_type_id, - bitcast_id, - id_extended, - )); - - if result_type_id != bitcast_type_id { + if result_type_id != extended_size_type_id { let id = self.gen_id(); let components = match dim { // always pick the first component, and duplicate it for all 3 dimensions @@ -1104,42 +1087,26 @@ impl<'w> BlockContext<'w> { block.body.push(Instruction::vector_shuffle( result_type_id, id, - bitcast_id, - bitcast_id, + id_extended, + id_extended, components, )); id } else { - bitcast_id + id_extended } } Iq::NumLevels => { let query_id = self.gen_id(); block.body.push(Instruction::image_query( spirv::Op::ImageQueryLevels, - self.get_type_id( - LocalType::Value { - vector_size: None, - kind: crate::ScalarKind::Sint, - width: 4, - pointer_space: None, - } - .into(), - ), - query_id, - image_id, - )); - - let id = self.gen_id(); - block.body.push(Instruction::unary( - spirv::Op::Bitcast, result_type_id, - id, query_id, + image_id, )); - id + query_id } Iq::NumLayers => { let vec_size = match dim { @@ -1149,7 +1116,7 @@ impl<'w> BlockContext<'w> { }; let extended_size_type_id = self.get_type_id(LookupType::Local(LocalType::Value { vector_size: Some(vec_size), - kind: crate::ScalarKind::Sint, + kind: crate::ScalarKind::Uint, width: 4, pointer_space: None, })); @@ -1165,56 +1132,24 @@ impl<'w> BlockContext<'w> { let extract_id = self.gen_id(); block.body.push(Instruction::composite_extract( - self.get_type_id( - LocalType::Value { - vector_size: None, - kind: crate::ScalarKind::Sint, - width: 4, - pointer_space: None, - } - .into(), - ), + result_type_id, extract_id, id_extended, &[vec_size as u32 - 1], )); - let id = self.gen_id(); - block.body.push(Instruction::unary( - spirv::Op::Bitcast, - result_type_id, - id, - extract_id, - )); - - id + extract_id } Iq::NumSamples => { let query_id = self.gen_id(); block.body.push(Instruction::image_query( spirv::Op::ImageQuerySamples, - self.get_type_id( - LocalType::Value { - vector_size: None, - kind: crate::ScalarKind::Sint, - width: 4, - pointer_space: None, - } - .into(), - ), - query_id, - image_id, - )); - - let id = self.gen_id(); - block.body.push(Instruction::unary( - spirv::Op::Bitcast, result_type_id, - id, query_id, + image_id, )); - id + query_id } }; @@ -1229,7 +1164,7 @@ impl<'w> BlockContext<'w> { value: Handle, block: &mut Block, ) -> Result<(), Error> { - let image_id = self.get_image_id(image); + let image_id = self.get_handle_id(image); let coordinates = self.write_image_coordinates(coordinate, array_index, block)?; let value_id = self.cached[value]; diff --git a/third_party/rust/naga/src/back/spv/index.rs b/third_party/rust/naga/src/back/spv/index.rs index 19cc4a896fd5d..92e0f88d9a92d 100644 --- a/third_party/rust/naga/src/back/spv/index.rs +++ b/third_party/rust/naga/src/back/spv/index.rs @@ -304,7 +304,7 @@ impl<'w> BlockContext<'w> { F: FnOnce(&mut IdGenerator, &mut Block) -> Word, { // For the out-of-bounds case, we produce a zero value. - let null_id = self.writer.write_constant_null(result_type); + let null_id = self.writer.get_constant_null(result_type); let mut selection = Selection::start(block, result_type); diff --git a/third_party/rust/naga/src/back/spv/mod.rs b/third_party/rust/naga/src/back/spv/mod.rs index 2d395effa085e..52e304a237886 100644 --- a/third_party/rust/naga/src/back/spv/mod.rs +++ b/third_party/rust/naga/src/back/spv/mod.rs @@ -466,6 +466,7 @@ enum CachedConstant { ty: LookupType, constituent_ids: Vec, }, + ZeroValue(Word), } #[derive(Clone)] diff --git a/third_party/rust/naga/src/back/spv/ray.rs b/third_party/rust/naga/src/back/spv/ray.rs index 0b53b9cc52658..ed61129f929e5 100644 --- a/third_party/rust/naga/src/back/spv/ray.rs +++ b/third_party/rust/naga/src/back/spv/ray.rs @@ -20,7 +20,7 @@ impl<'w> BlockContext<'w> { } => { //Note: composite extract indices and types must match `generate_ray_desc_type` let desc_id = self.cached[descriptor]; - let acc_struct_id = self.get_image_id(acceleration_structure); + let acc_struct_id = self.get_handle_id(acceleration_structure); let width = 4; let flag_type_id = self.get_type_id(LookupType::Local(LocalType::Value { diff --git a/third_party/rust/naga/src/back/spv/writer.rs b/third_party/rust/naga/src/back/spv/writer.rs index e402400b3a36d..e6db93602a426 100644 --- a/third_party/rust/naga/src/back/spv/writer.rs +++ b/third_party/rust/naga/src/back/spv/writer.rs @@ -356,7 +356,7 @@ impl Writer { crate::TypeInner::RayQuery => None, _ => { let type_id = self.get_type_id(LookupType::Handle(variable.ty)); - Some(self.write_constant_null(type_id)) + Some(self.get_constant_null(type_id)) } }), ); @@ -1206,6 +1206,16 @@ impl Writer { .to_words(&mut self.logical_layout.declarations); } + pub(super) fn get_constant_null(&mut self, type_id: Word) -> Word { + let null = CachedConstant::ZeroValue(type_id); + if let Some(&id) = self.cached_constants.get(&null) { + return id; + } + let id = self.write_constant_null(type_id); + self.cached_constants.insert(null, id); + id + } + pub(super) fn write_constant_null(&mut self, type_id: Word) -> Word { let null_id = self.id_gen.next(); Instruction::constant_null(type_id, null_id) @@ -1226,7 +1236,7 @@ impl Writer { } crate::Expression::ZeroValue(ty) => { let type_id = self.get_type_id(LookupType::Handle(ty)); - self.write_constant_null(type_id) + self.get_constant_null(type_id) } crate::Expression::Compose { ty, ref components } => { let component_ids: Vec<_> = components @@ -1289,7 +1299,7 @@ impl Writer { // get wrapped, and we're initializing `WorkGroup` variables. let var_id = self.global_variables[handle.index()].var_id; let var_type_id = self.get_type_id(LookupType::Handle(var.ty)); - let init_word = self.write_constant_null(var_type_id); + let init_word = self.get_constant_null(var_type_id); Instruction::store(var_id, init_word, None) }) .collect::>(); @@ -1327,7 +1337,7 @@ impl Writer { id }; - let zero_id = self.write_constant_null(uint3_type_id); + let zero_id = self.get_constant_null(uint3_type_id); let bool3_type_id = self.get_bool3_type_id(); let eq_id = self.id_gen.next(); @@ -1663,7 +1673,7 @@ impl Writer { let init_word = match (global_variable.space, self.zero_initialize_workgroup_memory) { (crate::AddressSpace::Private, _) | (crate::AddressSpace::WorkGroup, super::ZeroInitializeWorkgroupMemoryMode::Native) => { - init_word.or_else(|| Some(self.write_constant_null(inner_type_id))) + init_word.or_else(|| Some(self.get_constant_null(inner_type_id))) } _ => init_word, }; diff --git a/third_party/rust/naga/src/front/spv/image.rs b/third_party/rust/naga/src/front/spv/image.rs index ac0129059a7c9..1cefeb4fcc4dd 100644 --- a/third_party/rust/naga/src/front/spv/image.rs +++ b/third_party/rust/naga/src/front/spv/image.rs @@ -1,4 +1,4 @@ -use crate::arena::{Arena, Handle, UniqueArena}; +use crate::arena::{Handle, UniqueArena}; use super::{Error, LookupExpression, LookupHelper as _}; @@ -689,11 +689,20 @@ impl> super::Frontend { image: image_lexp.handle, query: crate::ImageQuery::Size { level }, }; - let expr = crate::Expression::As { - expr: ctx.expressions.append(expr, self.span_from_with_op(start)), - kind: crate::ScalarKind::Sint, - convert: Some(4), + + let result_type_handle = self.lookup_type.lookup(result_type_id)?.handle; + let maybe_scalar_kind = ctx.type_arena[result_type_handle].inner.scalar_kind(); + + let expr = if maybe_scalar_kind == Some(crate::ScalarKind::Sint) { + crate::Expression::As { + expr: ctx.expressions.append(expr, self.span_from_with_op(start)), + kind: crate::ScalarKind::Sint, + convert: Some(4), + } + } else { + expr }; + self.lookup_expression.insert( result_id, LookupExpression { @@ -702,13 +711,14 @@ impl> super::Frontend { block_id, }, ); + Ok(()) } pub(super) fn parse_image_query_other( &mut self, query: crate::ImageQuery, - expressions: &mut Arena, + ctx: &mut super::BlockContext, block_id: spirv::Word, ) -> Result<(), Error> { let start = self.data_offset; @@ -724,19 +734,29 @@ impl> super::Frontend { image: image_lexp.handle, query, }; - let expr = crate::Expression::As { - expr: expressions.append(expr, self.span_from_with_op(start)), - kind: crate::ScalarKind::Sint, - convert: Some(4), + + let result_type_handle = self.lookup_type.lookup(result_type_id)?.handle; + let maybe_scalar_kind = ctx.type_arena[result_type_handle].inner.scalar_kind(); + + let expr = if maybe_scalar_kind == Some(crate::ScalarKind::Sint) { + crate::Expression::As { + expr: ctx.expressions.append(expr, self.span_from_with_op(start)), + kind: crate::ScalarKind::Sint, + convert: Some(4), + } + } else { + expr }; + self.lookup_expression.insert( result_id, LookupExpression { - handle: expressions.append(expr, self.span_from_with_op(start)), + handle: ctx.expressions.append(expr, self.span_from_with_op(start)), type_id: result_type_id, block_id, }, ); + Ok(()) } } diff --git a/third_party/rust/naga/src/front/spv/mod.rs b/third_party/rust/naga/src/front/spv/mod.rs index 6ddd1d70c84b0..a210e8c421b91 100644 --- a/third_party/rust/naga/src/front/spv/mod.rs +++ b/third_party/rust/naga/src/front/spv/mod.rs @@ -2695,19 +2695,11 @@ impl> Frontend { } Op::ImageQueryLevels => { inst.expect(4)?; - self.parse_image_query_other( - crate::ImageQuery::NumLevels, - ctx.expressions, - block_id, - )?; + self.parse_image_query_other(crate::ImageQuery::NumLevels, ctx, block_id)?; } Op::ImageQuerySamples => { inst.expect(4)?; - self.parse_image_query_other( - crate::ImageQuery::NumSamples, - ctx.expressions, - block_id, - )?; + self.parse_image_query_other(crate::ImageQuery::NumSamples, ctx, block_id)?; } // other ops Op::Select => { diff --git a/third_party/rust/naga/src/front/wgsl/error.rs b/third_party/rust/naga/src/front/wgsl/error.rs index 701eca992b417..a3355f861a96b 100644 --- a/third_party/rust/naga/src/front/wgsl/error.rs +++ b/third_party/rust/naga/src/front/wgsl/error.rs @@ -168,6 +168,7 @@ pub enum Error<'a> { InvalidIdentifierUnderscore(Span), ReservedIdentifierPrefix(Span), UnknownAddressSpace(Span), + RepeatedAttribute(Span), UnknownAttribute(Span), UnknownBuiltin(Span), UnknownAccess(Span), @@ -430,6 +431,11 @@ impl<'a> Error<'a> { labels: vec![(bad_span, "unknown address space".into())], notes: vec![], }, + Error::RepeatedAttribute(bad_span) => ParseError { + message: format!("repeated attribute: '{}'", &source[bad_span]), + labels: vec![(bad_span, "repated attribute".into())], + notes: vec![], + }, Error::UnknownAttribute(bad_span) => ParseError { message: format!("unknown attribute: '{}'", &source[bad_span]), labels: vec![(bad_span, "unknown attribute".into())], diff --git a/third_party/rust/naga/src/front/wgsl/lower/mod.rs b/third_party/rust/naga/src/front/wgsl/lower/mod.rs index cf52d6ce80a84..84c0d993e1dd1 100644 --- a/third_party/rust/naga/src/front/wgsl/lower/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/lower/mod.rs @@ -1937,7 +1937,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { let (_, arrayed) = ctx.image_data(image, image_span)?; let array_index = arrayed - .then(|| self.expression(args.next()?, ctx.reborrow())) + .then(|| { + args.min_args += 1; + self.expression(args.next()?, ctx.reborrow()) + }) .transpose()?; let value = self.expression(args.next()?, ctx.reborrow())?; @@ -1968,7 +1971,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { let (class, arrayed) = ctx.image_data(image, image_span)?; let array_index = arrayed - .then(|| self.expression(args.next()?, ctx.reborrow())) + .then(|| { + args.min_args += 1; + self.expression(args.next()?, ctx.reborrow()) + }) .transpose()?; let level = class diff --git a/third_party/rust/naga/src/front/wgsl/parse/mod.rs b/third_party/rust/naga/src/front/wgsl/parse/mod.rs index c13ee5277549a..b6798027ea2ae 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/mod.rs @@ -120,13 +120,33 @@ enum Rule { GeneralExpr, } +struct ParsedAttribute { + value: Option, +} + +impl Default for ParsedAttribute { + fn default() -> Self { + Self { value: None } + } +} + +impl ParsedAttribute { + fn set(&mut self, value: T, name_span: Span) -> Result<(), Error<'static>> { + if self.value.is_some() { + return Err(Error::RepeatedAttribute(name_span)); + } + self.value = Some(value); + Ok(()) + } +} + #[derive(Default)] struct BindingParser { - location: Option, - built_in: Option, - interpolation: Option, - sampling: Option, - invariant: bool, + location: ParsedAttribute, + built_in: ParsedAttribute, + interpolation: ParsedAttribute, + sampling: ParsedAttribute, + invariant: ParsedAttribute, } impl BindingParser { @@ -139,38 +159,44 @@ impl BindingParser { match name { "location" => { lexer.expect(Token::Paren('('))?; - self.location = Some(Parser::non_negative_i32_literal(lexer)?); + self.location + .set(Parser::non_negative_i32_literal(lexer)?, name_span)?; lexer.expect(Token::Paren(')'))?; } "builtin" => { lexer.expect(Token::Paren('('))?; let (raw, span) = lexer.next_ident_with_span()?; - self.built_in = Some(conv::map_built_in(raw, span)?); + self.built_in + .set(conv::map_built_in(raw, span)?, name_span)?; lexer.expect(Token::Paren(')'))?; } "interpolate" => { lexer.expect(Token::Paren('('))?; let (raw, span) = lexer.next_ident_with_span()?; - self.interpolation = Some(conv::map_interpolation(raw, span)?); + self.interpolation + .set(conv::map_interpolation(raw, span)?, name_span)?; if lexer.skip(Token::Separator(',')) { let (raw, span) = lexer.next_ident_with_span()?; - self.sampling = Some(conv::map_sampling(raw, span)?); + self.sampling + .set(conv::map_sampling(raw, span)?, name_span)?; } lexer.expect(Token::Paren(')'))?; } - "invariant" => self.invariant = true, + "invariant" => { + self.invariant.set(true, name_span)?; + } _ => return Err(Error::UnknownAttribute(name_span)), } Ok(()) } - const fn finish<'a>(self, span: Span) -> Result, Error<'a>> { + fn finish<'a>(self, span: Span) -> Result, Error<'a>> { match ( - self.location, - self.built_in, - self.interpolation, - self.sampling, - self.invariant, + self.location.value, + self.built_in.value, + self.interpolation.value, + self.sampling.value, + self.invariant.value.unwrap_or_default(), ) { (None, None, None, None, false) => Ok(None), (Some(location), None, interpolation, sampling, false) => { @@ -990,22 +1016,22 @@ impl Parser { ExpectedToken::Token(Token::Separator(',')), )); } - let (mut size, mut align) = (None, None); + let (mut size, mut align) = (ParsedAttribute::default(), ParsedAttribute::default()); self.push_rule_span(Rule::Attribute, lexer); let mut bind_parser = BindingParser::default(); while lexer.skip(Token::Attribute) { match lexer.next_ident_with_span()? { - ("size", _) => { + ("size", name_span) => { lexer.expect(Token::Paren('('))?; let (value, span) = lexer.capture_span(Self::non_negative_i32_literal)?; lexer.expect(Token::Paren(')'))?; - size = Some((value, span)); + size.set((value, span), name_span)?; } - ("align", _) => { + ("align", name_span) => { lexer.expect(Token::Paren('('))?; let (value, span) = lexer.capture_span(Self::non_negative_i32_literal)?; lexer.expect(Token::Paren(')'))?; - align = Some((value, span)); + align.set((value, span), name_span)?; } (word, word_span) => bind_parser.parse(lexer, word, word_span)?, } @@ -1023,8 +1049,8 @@ impl Parser { name, ty, binding, - size, - align, + size: size.value, + align: align.value, }); } @@ -2131,32 +2157,33 @@ impl Parser { ) -> Result<(), Error<'a>> { // read attributes let mut binding = None; - let mut stage = None; + let mut stage = ParsedAttribute::default(); let mut workgroup_size = [0u32; 3]; - let mut early_depth_test = None; - let (mut bind_index, mut bind_group) = (None, None); + let mut early_depth_test = ParsedAttribute::default(); + let (mut bind_index, mut bind_group) = + (ParsedAttribute::default(), ParsedAttribute::default()); self.push_rule_span(Rule::Attribute, lexer); while lexer.skip(Token::Attribute) { match lexer.next_ident_with_span()? { - ("binding", _) => { + ("binding", name_span) => { lexer.expect(Token::Paren('('))?; - bind_index = Some(Self::non_negative_i32_literal(lexer)?); + bind_index.set(Self::non_negative_i32_literal(lexer)?, name_span)?; lexer.expect(Token::Paren(')'))?; } - ("group", _) => { + ("group", name_span) => { lexer.expect(Token::Paren('('))?; - bind_group = Some(Self::non_negative_i32_literal(lexer)?); + bind_group.set(Self::non_negative_i32_literal(lexer)?, name_span)?; lexer.expect(Token::Paren(')'))?; } - ("vertex", _) => { - stage = Some(crate::ShaderStage::Vertex); + ("vertex", name_span) => { + stage.set(crate::ShaderStage::Vertex, name_span)?; } - ("fragment", _) => { - stage = Some(crate::ShaderStage::Fragment); + ("fragment", name_span) => { + stage.set(crate::ShaderStage::Fragment, name_span)?; } - ("compute", _) => { - stage = Some(crate::ShaderStage::Compute); + ("compute", name_span) => { + stage.set(crate::ShaderStage::Compute, name_span)?; } ("workgroup_size", _) => { lexer.expect(Token::Paren('('))?; @@ -2175,7 +2202,7 @@ impl Parser { } } } - ("early_depth_test", _) => { + ("early_depth_test", name_span) => { let conservative = if lexer.skip(Token::Paren('(')) { let (ident, ident_span) = lexer.next_ident_with_span()?; let value = conv::map_conservative_depth(ident, ident_span)?; @@ -2184,14 +2211,14 @@ impl Parser { } else { None }; - early_depth_test = Some(crate::EarlyDepthTest { conservative }); + early_depth_test.set(crate::EarlyDepthTest { conservative }, name_span)?; } (_, word_span) => return Err(Error::UnknownAttribute(word_span)), } } let attrib_span = self.pop_rule_span(lexer); - match (bind_group, bind_index) { + match (bind_group.value, bind_index.value) { (Some(group), Some(index)) => { binding = Some(crate::ResourceBinding { group, @@ -2254,9 +2281,9 @@ impl Parser { (Token::Word("fn"), _) => { let function = self.function_decl(lexer, out, &mut dependencies)?; Some(ast::GlobalDeclKind::Fn(ast::Function { - entry_point: stage.map(|stage| ast::EntryPoint { + entry_point: stage.value.map(|stage| ast::EntryPoint { stage, - early_depth_test, + early_depth_test: early_depth_test.value, workgroup_size, }), ..function diff --git a/third_party/rust/naga/src/front/wgsl/tests.rs b/third_party/rust/naga/src/front/wgsl/tests.rs index 31b58907076b1..80ea261434c14 100644 --- a/third_party/rust/naga/src/front/wgsl/tests.rs +++ b/third_party/rust/naga/src/front/wgsl/tests.rs @@ -481,3 +481,70 @@ fn parse_alias() { ) .unwrap(); } + +#[test] +fn parse_texture_load_store_expecting_four_args() { + for (func, texture) in [ + ( + "textureStore", + "texture_storage_2d_array", + ), + ("textureLoad", "texture_2d_array"), + ] { + let error = parse_str(&format!( + " + @group(0) @binding(0) var tex_los_res: {texture}; + @compute + @workgroup_size(1) + fn main(@builtin(global_invocation_id) id: vec3) {{ + var color = vec4(1, 1, 1, 1); + {func}(tex_los_res, id, color); + }} + " + )) + .unwrap_err(); + assert_eq!( + error.message(), + "wrong number of arguments: expected 4, found 3" + ); + } +} + +#[test] +fn parse_repeated_attributes() { + use crate::{ + front::wgsl::{error::Error, Frontend}, + Span, + }; + + let template_vs = "@vertex fn vs() -> __REPLACE__ vec4 { return vec4(0.0); }"; + let template_struct = "struct A { __REPLACE__ data: vec3 }"; + let template_resource = "__REPLACE__ var tex_los_res: texture_2d_array;"; + let template_stage = "__REPLACE__ fn vs() -> vec4 { return vec4(0.0); }"; + for (attribute, template) in [ + ("align(16)", template_struct), + ("binding(0)", template_resource), + ("builtin(position)", template_vs), + ("compute", template_stage), + ("fragment", template_stage), + ("group(0)", template_resource), + ("interpolate(flat)", template_vs), + ("invariant", template_vs), + ("location(0)", template_vs), + ("size(16)", template_struct), + ("vertex", template_stage), + ("early_depth_test(less_equal)", template_resource), + ] { + let shader = template.replace("__REPLACE__", &format!("@{attribute} @{attribute}")); + let name_length = attribute.rfind('(').unwrap_or(attribute.len()) as u32; + let span_start = shader.rfind(attribute).unwrap() as u32; + let span_end = span_start + name_length; + let expected_span = Span::new(span_start, span_end); + + let result = Frontend::new().inner(&shader); + assert!(matches!( + result.unwrap_err(), + Error::RepeatedAttribute(span) if span == expected_span + )); + } +} diff --git a/third_party/rust/naga/src/lib.rs b/third_party/rust/naga/src/lib.rs index a835fec32d616..a1f7ef1654d74 100644 --- a/third_party/rust/naga/src/lib.rs +++ b/third_party/rust/naga/src/lib.rs @@ -1263,8 +1263,7 @@ bitflags::bitflags! { /// An expression that can be evaluated to obtain a value. /// /// This is a Single Static Assignment (SSA) scheme similar to SPIR-V. -#[derive(Clone, Debug)] -#[cfg_attr(test, derive(PartialEq))] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/third_party/rust/naga/src/valid/interface.rs b/third_party/rust/naga/src/valid/interface.rs index f1f9548a72024..2e54df24787df 100644 --- a/third_party/rust/naga/src/valid/interface.rs +++ b/third_party/rust/naga/src/valid/interface.rs @@ -33,6 +33,8 @@ pub enum GlobalVariableError { ), #[error("Initializer doesn't match the variable type")] InitializerType, + #[error("Storage address space doesn't support write-only access")] + StorageAddressSpaceWriteOnlyNotSupported, } #[derive(Clone, Debug, thiserror::Error)] @@ -407,7 +409,12 @@ impl super::Validator { // A binding array is (mostly) supposed to behave the same as a // series of individually bound resources, so we can (mostly) // validate a `binding_array` as if it were just a plain `T`. - crate::TypeInner::BindingArray { base, .. } => base, + crate::TypeInner::BindingArray { base, .. } => match var.space { + crate::AddressSpace::Storage { .. } + | crate::AddressSpace::Uniform + | crate::AddressSpace::Handle => base, + _ => return Err(GlobalVariableError::InvalidUsage(var.space)), + }, _ => var.ty, }; let type_info = &self.types[inner_ty.index()]; @@ -416,7 +423,7 @@ impl super::Validator { crate::AddressSpace::Function => { return Err(GlobalVariableError::InvalidUsage(var.space)) } - crate::AddressSpace::Storage { .. } => { + crate::AddressSpace::Storage { access } => { if let Err((ty_handle, disalignment)) = type_info.storage_layout { if self.flags.contains(super::ValidationFlags::STRUCT_LAYOUTS) { return Err(GlobalVariableError::Alignment( @@ -426,6 +433,9 @@ impl super::Validator { )); } } + if access == crate::StorageAccess::STORE { + return Err(GlobalVariableError::StorageAddressSpaceWriteOnlyNotSupported); + } (TypeFlags::DATA | TypeFlags::HOST_SHAREABLE, true) } crate::AddressSpace::Uniform => { diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json index d39f2a3042a7b..5f24ff6072327 100644 --- a/third_party/rust/wgpu-core/.cargo-checksum.json +++ b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"fc7c48cea2d58e3baa0f569d89f2680e92c509e268c8f565cce461d759643569","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/binding_model.rs":"d92a2c21642d0bece4ce1a9877d08567a86af4991cfe0bf6ecaaaf8f8b9c8d74","src/command/bind.rs":"aa778a7a125496f31220e8aa06a7eee5c5bc524a29e77cc5a314a178a0813a80","src/command/bundle.rs":"b26eb6cb877a19d203e9d2b8ac3b10e81f6a94b8b68617eac97a3b861cbe102b","src/command/clear.rs":"418ac36738d782ab72e8700aabef802638cdef1c873f4b036aa8a4c521cb9caf","src/command/compute.rs":"8f0ce8f80ad19454c7a0fdaf7a7fbb6d84f2cb0e374346f740a4ebe01beee53d","src/command/draw.rs":"1cbdeff80fa57663262f92141c5752530e911bad23c5379667b406cb8b57c4f7","src/command/memory_init.rs":"b50d3d20dbf659052f19da2e79469ba6435e06370f19d6ef45e1b1128d9900b7","src/command/mod.rs":"a63937a5b8a441b714329a5e1b0b4dd4b70ae2f39b52da633fd79edbe183edc6","src/command/query.rs":"d39e1b8cb6a054fd31333a916da5d79a6671a724212c90c490c13e55043a1685","src/command/render.rs":"c40036b5d3220ec621903473085ef8b9e0eb9dc51751ddab914d4f67b4852229","src/command/transfer.rs":"c777c6e51afb459d2b5416e31071f24e4215c66f456fee3bd8f7395f9d1c5db1","src/conv.rs":"da95b36b7680ae74ebf810ad8f1decf01bd3eeaff44b3c5af1d4b3c3f0e2059a","src/device/global.rs":"a06a5b10cda63dd97f5cd59e2813fd189d2cf59fd4154950a878874d4221cc12","src/device/life.rs":"c935c15c4c7f929e378a5ea930d0d36b47616a49991c236aaa10d25ce5852d15","src/device/mod.rs":"c150878d8b80b727ba1904725dafd747d6459106196b1cc67d9428dae75b0163","src/device/queue.rs":"b1ef887b92574d2541ef6f572cd14067e2af3a514fa26d547f9c18e2cbd30b92","src/device/resource.rs":"cbb1bcd91c5e62a2a98288fa1cd9b5d8eb54cc78fa5ba042adaffe6b6770675a","src/device/trace.rs":"21408dfd2c99e3ce36a77d08ba86cf52f32bb376ed82690bbbf74937bfd42cbe","src/error.rs":"ca37282283985e2b7d184b2ab7ca6f53f726432d920f8d8477bfff6fab9b34e2","src/global.rs":"cf551de97c3eb5acd0c2710da09ebd92cc863ad0bb0f53c0fd4911bf8cd3ad97","src/hal_api.rs":"92a2f0cb80f192693530ed61048919bbad446742c2370bf0944c44b1c5df8362","src/hub.rs":"49f479c3ebed842a4bc8ab2fee00bc02dceb57790fbac8ba33e1bfed795fa675","src/id.rs":"f6245d024586c7fe63ded13b3cb926b940c191bbee56aedc655e8cef74bdd66b","src/identity.rs":"c2e008e652723f7896465bfdafd5a10141cf5866e8c481a8efcf0bdaa9619a6a","src/init_tracker/buffer.rs":"a0ebf54a1e6d269c7b4aa0ac7bb8b04fd2cea3221a1d058ff33cb683b2aea3e9","src/init_tracker/mod.rs":"0867f79f83555390d0982d1dc6dcf0d4340e10cb89aa633d3c3ecc45deb3c78c","src/init_tracker/texture.rs":"37b6584aaca11c407d91f77002dcbb48d8a4876e27edd1b71b7929ef966f901d","src/instance.rs":"1a44acecaba0031be7b2450846f56ec741bafb2e4e9f0fc606e13788e5600083","src/lib.rs":"27ff8dd787d41cf412e90d0c4674aa70db59e608f9eb3be485c0bd18e9f13369","src/pipeline.rs":"669219add15448fdf5fe8bc5e03fd6fd1ada2b45b07047fd8c0a9bbbcdecad8b","src/present.rs":"ebcbf2e3b35d13a8dad191126de5f5006233ba8a0fb186303eafe2aeb412dce3","src/registry.rs":"4098413de7f48e9ff15d0246793be47a0d54c95b4c8594baf9fafd222a90ba84","src/resource.rs":"a03329428f820b43810d82f990c72990a45a6bdf482d3ce4b096b0f99c6c6844","src/storage.rs":"bc70689ba299e9b4d9f4992c4d3f4dd36b1d8e71327595094981fdfd624f811a","src/track/buffer.rs":"dd6f632c6f31b15807148d705c516a8a1a8d72d02b137dd3b9d7c939447917cb","src/track/metadata.rs":"a80bd086ce825f7484ce6318a586c482d06fea0efc9c76bfa0124e480cc8b75e","src/track/mod.rs":"04cd09cf5f26262175e48cc3855b79fbd8988916c4367a55d39a4c95784d249b","src/track/range.rs":"5bbfed6e103b3234d9de8e42057022da6d628c2cc1db6bb51b88f87f2d8adf8b","src/track/stateless.rs":"1d786b5e9558672243ba7d913736561065ef2bd5c6105c935e982486d10841f0","src/track/texture.rs":"7d60dc81ba7f7e2c2819525b90e6e6c7760cb0920e36aeefe98e76cedd49d26e","src/validation.rs":"6be9229cc34ef293ae99cfa520c6ad22bab39b83a53880a4aca36c42c53d40c3"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"dd1ecc9d26c0bac60aafeb9e404fd076025cc5f4a5bc405adfa08d2ca38608ac","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/binding_model.rs":"d92a2c21642d0bece4ce1a9877d08567a86af4991cfe0bf6ecaaaf8f8b9c8d74","src/command/bind.rs":"aa778a7a125496f31220e8aa06a7eee5c5bc524a29e77cc5a314a178a0813a80","src/command/bundle.rs":"b26eb6cb877a19d203e9d2b8ac3b10e81f6a94b8b68617eac97a3b861cbe102b","src/command/clear.rs":"418ac36738d782ab72e8700aabef802638cdef1c873f4b036aa8a4c521cb9caf","src/command/compute.rs":"8f0ce8f80ad19454c7a0fdaf7a7fbb6d84f2cb0e374346f740a4ebe01beee53d","src/command/draw.rs":"92facdd0e3fd553af590ecbc0de3491f212e237ea66494ff99f67dbf090d10df","src/command/memory_init.rs":"b50d3d20dbf659052f19da2e79469ba6435e06370f19d6ef45e1b1128d9900b7","src/command/mod.rs":"a63937a5b8a441b714329a5e1b0b4dd4b70ae2f39b52da633fd79edbe183edc6","src/command/query.rs":"d39e1b8cb6a054fd31333a916da5d79a6671a724212c90c490c13e55043a1685","src/command/render.rs":"55b7ccbac0bbcb53080901ba11aafb92bff0c53b604cc7f504c00ce3e8c297c7","src/command/transfer.rs":"c777c6e51afb459d2b5416e31071f24e4215c66f456fee3bd8f7395f9d1c5db1","src/conv.rs":"da95b36b7680ae74ebf810ad8f1decf01bd3eeaff44b3c5af1d4b3c3f0e2059a","src/device/global.rs":"a06a5b10cda63dd97f5cd59e2813fd189d2cf59fd4154950a878874d4221cc12","src/device/life.rs":"26ac37c2a54c6fb942e6d2fbdf4d6fa4e3e50f41e1dd003c750f7e20295cbae7","src/device/mod.rs":"dbb98ce046651fd70a26df2030913f7224557eceb5f84198daf433c266356c7c","src/device/queue.rs":"d2692b5c12d05dfaf325d437b5bffe069cfff43228ce40f25147cec2cda428ba","src/device/resource.rs":"cbb1bcd91c5e62a2a98288fa1cd9b5d8eb54cc78fa5ba042adaffe6b6770675a","src/device/trace.rs":"21408dfd2c99e3ce36a77d08ba86cf52f32bb376ed82690bbbf74937bfd42cbe","src/error.rs":"ca37282283985e2b7d184b2ab7ca6f53f726432d920f8d8477bfff6fab9b34e2","src/global.rs":"cf551de97c3eb5acd0c2710da09ebd92cc863ad0bb0f53c0fd4911bf8cd3ad97","src/hal_api.rs":"92a2f0cb80f192693530ed61048919bbad446742c2370bf0944c44b1c5df8362","src/hub.rs":"49f479c3ebed842a4bc8ab2fee00bc02dceb57790fbac8ba33e1bfed795fa675","src/id.rs":"f6245d024586c7fe63ded13b3cb926b940c191bbee56aedc655e8cef74bdd66b","src/identity.rs":"c2e008e652723f7896465bfdafd5a10141cf5866e8c481a8efcf0bdaa9619a6a","src/init_tracker/buffer.rs":"a0ebf54a1e6d269c7b4aa0ac7bb8b04fd2cea3221a1d058ff33cb683b2aea3e9","src/init_tracker/mod.rs":"0867f79f83555390d0982d1dc6dcf0d4340e10cb89aa633d3c3ecc45deb3c78c","src/init_tracker/texture.rs":"37b6584aaca11c407d91f77002dcbb48d8a4876e27edd1b71b7929ef966f901d","src/instance.rs":"1a44acecaba0031be7b2450846f56ec741bafb2e4e9f0fc606e13788e5600083","src/lib.rs":"27ff8dd787d41cf412e90d0c4674aa70db59e608f9eb3be485c0bd18e9f13369","src/pipeline.rs":"669219add15448fdf5fe8bc5e03fd6fd1ada2b45b07047fd8c0a9bbbcdecad8b","src/present.rs":"ebcbf2e3b35d13a8dad191126de5f5006233ba8a0fb186303eafe2aeb412dce3","src/registry.rs":"4098413de7f48e9ff15d0246793be47a0d54c95b4c8594baf9fafd222a90ba84","src/resource.rs":"a03329428f820b43810d82f990c72990a45a6bdf482d3ce4b096b0f99c6c6844","src/storage.rs":"bc70689ba299e9b4d9f4992c4d3f4dd36b1d8e71327595094981fdfd624f811a","src/track/buffer.rs":"dd6f632c6f31b15807148d705c516a8a1a8d72d02b137dd3b9d7c939447917cb","src/track/metadata.rs":"a80bd086ce825f7484ce6318a586c482d06fea0efc9c76bfa0124e480cc8b75e","src/track/mod.rs":"04cd09cf5f26262175e48cc3855b79fbd8988916c4367a55d39a4c95784d249b","src/track/range.rs":"5bbfed6e103b3234d9de8e42057022da6d628c2cc1db6bb51b88f87f2d8adf8b","src/track/stateless.rs":"1d786b5e9558672243ba7d913736561065ef2bd5c6105c935e982486d10841f0","src/track/texture.rs":"7d60dc81ba7f7e2c2819525b90e6e6c7760cb0920e36aeefe98e76cedd49d26e","src/validation.rs":"6be9229cc34ef293ae99cfa520c6ad22bab39b83a53880a4aca36c42c53d40c3"},"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 709f0d428f6c1..d6028e5833e7d 100644 --- a/third_party/rust/wgpu-core/Cargo.toml +++ b/third_party/rust/wgpu-core/Cargo.toml @@ -55,7 +55,7 @@ package = "wgpu-hal" [dependencies.naga] version = "0.13.0" git = "https://github.com/gfx-rs/naga" -rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" +rev = "7a19f3af909202c7eafd36633b5584bfbb353ecb" features = [ "clone", "span", diff --git a/third_party/rust/wgpu-core/src/command/draw.rs b/third_party/rust/wgpu-core/src/command/draw.rs index 0b7b48cda9fb0..50ca9516b4936 100644 --- a/third_party/rust/wgpu-core/src/command/draw.rs +++ b/third_party/rust/wgpu-core/src/command/draw.rs @@ -89,8 +89,8 @@ pub enum RenderCommandError { MissingTextureUsage(#[from] MissingTextureUsageError), #[error(transparent)] PushConstants(#[from] PushConstantUploadError), - #[error("Viewport width {0} and/or height {1} are less than or equal to 0")] - InvalidViewportDimension(f32, f32), + #[error("Viewport has invalid rect {0:?}; origin and/or size is less than or equal to 0, and/or is not contained in the render target {1:?}")] + InvalidViewportRect(Rect, wgt::Extent3d), #[error("Viewport minDepth {0} and/or maxDepth {1} are not in [0, 1]")] InvalidViewportDepth(f32, f32), #[error("Scissor {0:?} is not contained in the render target {1:?}")] diff --git a/third_party/rust/wgpu-core/src/command/render.rs b/third_party/rust/wgpu-core/src/command/render.rs index 4066bb3a0780a..7f16f3180797c 100644 --- a/third_party/rust/wgpu-core/src/command/render.rs +++ b/third_party/rust/wgpu-core/src/command/render.rs @@ -960,7 +960,13 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> { (is_depth_read_only, is_stencil_read_only) = at.depth_stencil_read_only(ds_aspects)?; - let usage = if is_depth_read_only && is_stencil_read_only { + let usage = if is_depth_read_only + && is_stencil_read_only + && device + .downlevel + .flags + .contains(wgt::DownlevelFlags::READ_ONLY_DEPTH_STENCIL) + { hal::TextureUses::DEPTH_STENCIL_READ | hal::TextureUses::RESOURCE } else { hal::TextureUses::DEPTH_STENCIL_WRITE @@ -1721,9 +1727,16 @@ impl Global { depth_max, } => { let scope = PassErrorScope::SetViewport; - if rect.w <= 0.0 || rect.h <= 0.0 { - return Err(RenderCommandError::InvalidViewportDimension( - rect.w, rect.h, + if rect.x < 0.0 + || rect.y < 0.0 + || rect.w <= 0.0 + || rect.h <= 0.0 + || rect.x + rect.w > info.extent.width as f32 + || rect.y + rect.h > info.extent.height as f32 + { + return Err(RenderCommandError::InvalidViewportRect( + *rect, + info.extent, )) .map_pass_err(scope); } diff --git a/third_party/rust/wgpu-core/src/device/life.rs b/third_party/rust/wgpu-core/src/device/life.rs index 75491d10cb9df..a12d864104c5a 100644 --- a/third_party/rust/wgpu-core/src/device/life.rs +++ b/third_party/rust/wgpu-core/src/device/life.rs @@ -219,6 +219,9 @@ struct ActiveSubmission { mapped: Vec>, encoders: Vec>, + + /// List of queue "on_submitted_work_done" closures to be called once this + /// submission has completed. work_done_closures: SmallVec<[SubmittedWorkDoneClosure; 1]>, } @@ -304,6 +307,12 @@ pub(super) struct LifetimeTracker { /// Buffers the user has asked us to map, and which are not used by any /// queue submission still in flight. ready_to_map: Vec>, + + /// Queue "on_submitted_work_done" closures that were initiated for while there is no + /// currently pending submissions. These cannot be immeidately invoked as they + /// must happen _after_ all mapped buffer callbacks are mapped, so we defer them + /// here until the next time the device is maintained. + work_done_closures: SmallVec<[SubmittedWorkDoneClosure; 1]>, } impl LifetimeTracker { @@ -316,6 +325,7 @@ impl LifetimeTracker { active: Vec::new(), free_resources: NonReferencedResources::new(), ready_to_map: Vec::new(), + work_done_closures: SmallVec::new(), } } @@ -405,7 +415,7 @@ impl LifetimeTracker { .position(|a| a.index > last_done) .unwrap_or(self.active.len()); - let mut work_done_closures = SmallVec::new(); + let mut work_done_closures: SmallVec<_> = self.work_done_closures.drain(..).collect(); for a in self.active.drain(..done_count) { log::trace!("Active submission {} is done", a.index); self.free_resources.extend(a.last_resources); @@ -445,18 +455,16 @@ impl LifetimeTracker { } } - pub fn add_work_done_closure( - &mut self, - closure: SubmittedWorkDoneClosure, - ) -> Option { + pub fn add_work_done_closure(&mut self, closure: SubmittedWorkDoneClosure) { match self.active.last_mut() { Some(active) => { active.work_done_closures.push(closure); - None } - // Note: we can't immediately invoke the closure, since it assumes - // nothing is currently locked in the hubs. - None => Some(closure), + // We must defer the closure until all previously occuring map_async closures + // have fired. This is required by the spec. + None => { + self.work_done_closures.push(closure); + } } } } diff --git a/third_party/rust/wgpu-core/src/device/mod.rs b/third_party/rust/wgpu-core/src/device/mod.rs index 5792791abe767..0ae6d7a2dd0d0 100644 --- a/third_party/rust/wgpu-core/src/device/mod.rs +++ b/third_party/rust/wgpu-core/src/device/mod.rs @@ -181,6 +181,9 @@ impl UserClosures { fn fire(self) { // Note: this logic is specifically moved out of `handle_mapping()` in order to // have nothing locked by the time we execute users callback code. + + // Mappings _must_ be fired before submissions, as the spec requires all mapping callbacks that are registered before + // a on_submitted_work_done callback to be fired before the on_submitted_work_done callback. for (operation, status) in self.mappings { operation.callback.call(status); } diff --git a/third_party/rust/wgpu-core/src/device/queue.rs b/third_party/rust/wgpu-core/src/device/queue.rs index 6e0be3b297a69..73fa5de3b0d1a 100644 --- a/third_party/rust/wgpu-core/src/device/queue.rs +++ b/third_party/rust/wgpu-core/src/device/queue.rs @@ -1435,17 +1435,12 @@ impl Global { closure: SubmittedWorkDoneClosure, ) -> Result<(), InvalidQueue> { //TODO: flush pending writes - let closure_opt = { - let hub = A::hub(self); - let mut token = Token::root(); - let (device_guard, mut token) = hub.devices.read(&mut token); - match device_guard.get(queue_id) { - Ok(device) => device.lock_life(&mut token).add_work_done_closure(closure), - Err(_) => return Err(InvalidQueue), - } - }; - if let Some(closure) = closure_opt { - closure.call(); + let hub = A::hub(self); + let mut token = Token::root(); + let (device_guard, mut token) = hub.devices.read(&mut token); + match device_guard.get(queue_id) { + Ok(device) => device.lock_life(&mut token).add_work_done_closure(closure), + Err(_) => return Err(InvalidQueue), } Ok(()) } diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index e7f14a61049a1..f0177d558a77d 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3b84e07e7947faaa8195e08012891802ffeaa52ce3bcc18009ec4a4b9ebfac32","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"dcbe0d8309d0842d33a598137d2f2c8a23f510497f6cb5c3917857688db308d1","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"d7e0d311514555f41b633eef2fdf355737e22c0b01d045d6afa6ba1b95511b2b","src/auxil/dxgi/conv.rs":"c1e8d584e408712097d075455375e04d1895a0ff9a494305c16d658277ce7b90","src/auxil/dxgi/exception.rs":"baad31f4529f1cf9d10519c4cceccbb21ed9bba7d7ea99e4789c1d5ddf3a450b","src/auxil/dxgi/factory.rs":"4d934b586dec17f49da0b63a57885107336e111f98556af95b45339a3898c23d","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"20c8eb03d738062dff198feca6327addb9882ed0462be842c789eadf7dca0573","src/auxil/dxgi/time.rs":"b6f966b250e9424d5d7e4065f2108cba87197c1e30baae6d87083055d1bc5a4b","src/auxil/mod.rs":"c38f0d3b10804d1c1d7e3b8e4a975fcb87271f8b1904f2f4a3153cceddafb56b","src/auxil/renderdoc.rs":"c2f849f70f576b0c9b0d32dd155b6a6353f74dff59cbeeaa994a12789d047c0f","src/dx11/adapter.rs":"621c7d06ebac419f17f88c64b1a7cd2930499f2826f62a209cd93c42c47c316c","src/dx11/command.rs":"32a759d36ebc6d92528a128b117a752dd7fb6f4f0b4d8eda3ed564e5b8d783c2","src/dx11/device.rs":"96ccd8d6645839f3daf832ddf569676643ac92d1b332ab9a0c8563b3b5026295","src/dx11/instance.rs":"451fbe179dfdad74fe9ea378ad38a5db525e7008ec492e40ce78cc7b530b53ae","src/dx11/library.rs":"4fb09475fb24bc45fb7a464a7c6a30b45e10fed0022aad2891a390b512c11ae1","src/dx11/mod.rs":"21bc698bc0ff8b36a4906ee8dfaf469b6ed35ad852b7c0a5f60c5e5007bba128","src/dx12/adapter.rs":"1ecf0277171ff09368daa62b31759aadee3044e8033699b306e359cf10f01bdc","src/dx12/command.rs":"9074f4b3f80d9a9168b12b59518ca613a81bb7799f8756f5221e46c16cbeae8e","src/dx12/conv.rs":"4746ab2e46d8fbf4eac66c4dde11ca932f7ca9ba8177b5316eb12710a89700c2","src/dx12/descriptor.rs":"d9e295c48dc7d1759fd121c927c2218c1bde90e9f1b35f2ad01b610b184b614e","src/dx12/device.rs":"1e622243cddd09a4c39a5abb516421e1aa9bea5b2291f049b9fe44024592bc5a","src/dx12/instance.rs":"cb838a49a69f91aff364c8f76fe6c42307152aed56f456f74218b716a770ef99","src/dx12/mod.rs":"d7a34fd7143f62db30d3909ea7b66cc129ba1d971c27ce4cb38cbe1028ea2785","src/dx12/shader_compilation.rs":"dcff4c2c37b4d8c971a1e940eb7a843a32a3016cc65ef26bad71372687a835dc","src/dx12/suballocation.rs":"f5eb7c11dfe9c8d319ec853fec2a1aec8abe6bc61a729faa60302b105265f677","src/dx12/types.rs":"29b11268d11c1b7437de3dac403af574ec8aa84fd9954a95a16d80f5808be44d","src/dx12/view.rs":"c09241520377e6a47ad8822c69075e6e16e6c558e18bb64398c8d7424fc57dcf","src/empty.rs":"98c4ad29fdf1bad55097d540393b9ef62cce23b9d5cfd2a131f790042e3bd8b8","src/gles/adapter.rs":"4ee3f6b4604bed1beb08dcd8715700855b495dac0689f23119ba1d74440aaeff","src/gles/command.rs":"c7d6ff845b597d85d2fd61be625cf43554944d93f9324c98c2123995946cfd6b","src/gles/conv.rs":"84164c6b93afdbd07b037cdbee4c94dd40df0a21d42703481d0c293e92a13efd","src/gles/device.rs":"11b99f2da55ee07db7549b4313ceb68e35a13f87041832643359e80e6f355034","src/gles/egl.rs":"aeabffbd826df8c8512b7a2658da4e74b29e87db0012d053947c846d5a094bf7","src/gles/emscripten.rs":"19bb73a9d140645f3f32cd48b002151711a9b8456e213eab5f3a2be79239e147","src/gles/mod.rs":"65996152dff84f00d6d491bfe5edc5c343f2302a4aa01eef14aadb4bdab096ed","src/gles/queue.rs":"5a85e6c2ad9e97779b6fec81d2811c1e05d71f82f7c5bee87b31eade64c1501e","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"0e39ca4011e0ceb8c8d1a615d3cf81feb722d6245f863090cab5f92d51488981","src/lib.rs":"8953b775ad67e5cb0102bd78f70410c4fd9f8b30c170ab3f8a7558f78686b91a","src/metal/adapter.rs":"93f48f24ff4add6c54891d630018b668127a52471acbdfcb2f888209c1231ed4","src/metal/command.rs":"a43a399b6f65a15ddd943bf981506d51571da6af73eeb8932c62a36c202d786c","src/metal/conv.rs":"e4aeafcddc75b2f9b54245faedaf0566f1e63681807ae786ceb46ac35f0e13bf","src/metal/device.rs":"d2fb16e8d7cfc0c9e3141dcf1245a1f0ea8a891962c0cd83c0cd4450e7acaf36","src/metal/mod.rs":"2ace6e0ac37b09e98f5fb7c19d5fb8f23f7b14ac35137ba7a7ad99f0ba032d77","src/metal/surface.rs":"f4b3f8364ec32a7540f7a1da3b4b7e8c6c1cf336aa5535a4515b4efb5b11c443","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"bdd26edf5dacd7e3c9ee7678e1e040624c5a27dd40128649bf30bc1836d6a5a0","src/vulkan/command.rs":"08d9a43bd43820f2681efe4207a1be678f1aab47d779390c4dbb929d1b5450fa","src/vulkan/conv.rs":"284f002063260811ba3fcfe75d6dc1c4c2eb2bc8b6622eac781157b7683478cd","src/vulkan/device.rs":"9f445c3fcaf5b162b283c9abf112948b2e5a1ee0799156288a08acfb8fc7daa2","src/vulkan/instance.rs":"e840e512a2efa025c84696bf7750cd4f75f8a3f6efe9cc526445c369f578848b","src/vulkan/mod.rs":"1bef6c8213bfccf6dd23fe07414db2893a0f85a755bcf26f461371956c960173"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"6fff19dc49401b0268c9666c1f61838069a652f15e61edc69d96c759dc72d1c9","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"dcbe0d8309d0842d33a598137d2f2c8a23f510497f6cb5c3917857688db308d1","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"d7e0d311514555f41b633eef2fdf355737e22c0b01d045d6afa6ba1b95511b2b","src/auxil/dxgi/conv.rs":"c1e8d584e408712097d075455375e04d1895a0ff9a494305c16d658277ce7b90","src/auxil/dxgi/exception.rs":"baad31f4529f1cf9d10519c4cceccbb21ed9bba7d7ea99e4789c1d5ddf3a450b","src/auxil/dxgi/factory.rs":"4d934b586dec17f49da0b63a57885107336e111f98556af95b45339a3898c23d","src/auxil/dxgi/mod.rs":"a202564d9ac97530b16a234b87d180cd345aae705e082a9b1177dcde813645f9","src/auxil/dxgi/result.rs":"20c8eb03d738062dff198feca6327addb9882ed0462be842c789eadf7dca0573","src/auxil/dxgi/time.rs":"b6f966b250e9424d5d7e4065f2108cba87197c1e30baae6d87083055d1bc5a4b","src/auxil/mod.rs":"c38f0d3b10804d1c1d7e3b8e4a975fcb87271f8b1904f2f4a3153cceddafb56b","src/auxil/renderdoc.rs":"c2f849f70f576b0c9b0d32dd155b6a6353f74dff59cbeeaa994a12789d047c0f","src/dx11/adapter.rs":"aa990ebdd238e2a942d9cdbd0a9787018509da21f4c14664a18be0b4d6dd5f70","src/dx11/command.rs":"32a759d36ebc6d92528a128b117a752dd7fb6f4f0b4d8eda3ed564e5b8d783c2","src/dx11/device.rs":"96ccd8d6645839f3daf832ddf569676643ac92d1b332ab9a0c8563b3b5026295","src/dx11/instance.rs":"451fbe179dfdad74fe9ea378ad38a5db525e7008ec492e40ce78cc7b530b53ae","src/dx11/library.rs":"4fb09475fb24bc45fb7a464a7c6a30b45e10fed0022aad2891a390b512c11ae1","src/dx11/mod.rs":"21bc698bc0ff8b36a4906ee8dfaf469b6ed35ad852b7c0a5f60c5e5007bba128","src/dx12/adapter.rs":"2bf463c2b8508219fc5367fbb26dd72d8fca389e0a3de2661e5e23f4bd16a9db","src/dx12/command.rs":"9074f4b3f80d9a9168b12b59518ca613a81bb7799f8756f5221e46c16cbeae8e","src/dx12/conv.rs":"6c6ca090d4976c6008304d7f44574d88f1e506c8d24f3a872f89d8f900fcf259","src/dx12/descriptor.rs":"d9e295c48dc7d1759fd121c927c2218c1bde90e9f1b35f2ad01b610b184b614e","src/dx12/device.rs":"1e622243cddd09a4c39a5abb516421e1aa9bea5b2291f049b9fe44024592bc5a","src/dx12/instance.rs":"cb838a49a69f91aff364c8f76fe6c42307152aed56f456f74218b716a770ef99","src/dx12/mod.rs":"d7a34fd7143f62db30d3909ea7b66cc129ba1d971c27ce4cb38cbe1028ea2785","src/dx12/shader_compilation.rs":"dcff4c2c37b4d8c971a1e940eb7a843a32a3016cc65ef26bad71372687a835dc","src/dx12/suballocation.rs":"f5eb7c11dfe9c8d319ec853fec2a1aec8abe6bc61a729faa60302b105265f677","src/dx12/types.rs":"29b11268d11c1b7437de3dac403af574ec8aa84fd9954a95a16d80f5808be44d","src/dx12/view.rs":"c09241520377e6a47ad8822c69075e6e16e6c558e18bb64398c8d7424fc57dcf","src/empty.rs":"98c4ad29fdf1bad55097d540393b9ef62cce23b9d5cfd2a131f790042e3bd8b8","src/gles/adapter.rs":"4ee3f6b4604bed1beb08dcd8715700855b495dac0689f23119ba1d74440aaeff","src/gles/command.rs":"c7d6ff845b597d85d2fd61be625cf43554944d93f9324c98c2123995946cfd6b","src/gles/conv.rs":"1e1c4a0887fd0062b8e66c86a824e6ddb63b458dcd968e84fffbca519e7b5690","src/gles/device.rs":"11b99f2da55ee07db7549b4313ceb68e35a13f87041832643359e80e6f355034","src/gles/egl.rs":"aeabffbd826df8c8512b7a2658da4e74b29e87db0012d053947c846d5a094bf7","src/gles/emscripten.rs":"19bb73a9d140645f3f32cd48b002151711a9b8456e213eab5f3a2be79239e147","src/gles/mod.rs":"65996152dff84f00d6d491bfe5edc5c343f2302a4aa01eef14aadb4bdab096ed","src/gles/queue.rs":"5a85e6c2ad9e97779b6fec81d2811c1e05d71f82f7c5bee87b31eade64c1501e","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"0e39ca4011e0ceb8c8d1a615d3cf81feb722d6245f863090cab5f92d51488981","src/lib.rs":"8953b775ad67e5cb0102bd78f70410c4fd9f8b30c170ab3f8a7558f78686b91a","src/metal/adapter.rs":"93f48f24ff4add6c54891d630018b668127a52471acbdfcb2f888209c1231ed4","src/metal/command.rs":"a43a399b6f65a15ddd943bf981506d51571da6af73eeb8932c62a36c202d786c","src/metal/conv.rs":"e4aeafcddc75b2f9b54245faedaf0566f1e63681807ae786ceb46ac35f0e13bf","src/metal/device.rs":"d2fb16e8d7cfc0c9e3141dcf1245a1f0ea8a891962c0cd83c0cd4450e7acaf36","src/metal/mod.rs":"2ace6e0ac37b09e98f5fb7c19d5fb8f23f7b14ac35137ba7a7ad99f0ba032d77","src/metal/surface.rs":"f4b3f8364ec32a7540f7a1da3b4b7e8c6c1cf336aa5535a4515b4efb5b11c443","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/vulkan/adapter.rs":"bdd26edf5dacd7e3c9ee7678e1e040624c5a27dd40128649bf30bc1836d6a5a0","src/vulkan/command.rs":"08d9a43bd43820f2681efe4207a1be678f1aab47d779390c4dbb929d1b5450fa","src/vulkan/conv.rs":"284f002063260811ba3fcfe75d6dc1c4c2eb2bc8b6622eac781157b7683478cd","src/vulkan/device.rs":"9f445c3fcaf5b162b283c9abf112948b2e5a1ee0799156288a08acfb8fc7daa2","src/vulkan/instance.rs":"81d85ca87480ae2cde7a53b6a83857a83be7ade72b1d7fd9dd934d5c46d4c84a","src/vulkan/mod.rs":"1bef6c8213bfccf6dd23fe07414db2893a0f85a755bcf26f461371956c960173"},"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 43eca8286ae0f..ba3b5ff2d9c60 100644 --- a/third_party/rust/wgpu-hal/Cargo.toml +++ b/third_party/rust/wgpu-hal/Cargo.toml @@ -64,7 +64,7 @@ optional = true [dependencies.naga] version = "0.13.0" git = "https://github.com/gfx-rs/naga" -rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" +rev = "7a19f3af909202c7eafd36633b5584bfbb353ecb" features = ["clone"] [dependencies.profiling] @@ -83,7 +83,7 @@ env_logger = "0.10" [dev-dependencies.naga] version = "0.13.0" git = "https://github.com/gfx-rs/naga" -rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" +rev = "7a19f3af909202c7eafd36633b5584bfbb353ecb" features = ["wgsl-in"] [dev-dependencies.winit] diff --git a/third_party/rust/wgpu-hal/src/dx11/adapter.rs b/third_party/rust/wgpu-hal/src/dx11/adapter.rs index a28106a9bbfa1..34ce34238dea8 100644 --- a/third_party/rust/wgpu-hal/src/dx11/adapter.rs +++ b/third_party/rust/wgpu-hal/src/dx11/adapter.rs @@ -94,7 +94,8 @@ impl super::Adapter { | wgt::Features::POLYGON_MODE_LINE | wgt::Features::CLEAR_TEXTURE | wgt::Features::TEXTURE_FORMAT_16BIT_NORM - | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO; + | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO + | wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER; let mut downlevel = wgt::DownlevelFlags::BASE_VERTEX | wgt::DownlevelFlags::READ_ONLY_DEPTH_STENCIL | wgt::DownlevelFlags::UNRESTRICTED_INDEX_BUFFER @@ -132,6 +133,8 @@ impl super::Adapter { features |= wgt::Features::TIMESTAMP_QUERY; features |= wgt::Features::PIPELINE_STATISTICS_QUERY; features |= wgt::Features::SHADER_PRIMITIVE_INDEX; + features |= wgt::Features::DEPTH32FLOAT_STENCIL8; + features |= wgt::Features::RG11B10UFLOAT_RENDERABLE; } if feature_level >= FL10_1 { diff --git a/third_party/rust/wgpu-hal/src/dx12/adapter.rs b/third_party/rust/wgpu-hal/src/dx12/adapter.rs index 27e8e8e05f8b4..eb94d4eb1130b 100644 --- a/third_party/rust/wgpu-hal/src/dx12/adapter.rs +++ b/third_party/rust/wgpu-hal/src/dx12/adapter.rs @@ -242,7 +242,6 @@ impl super::Adapter { | wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO | wgt::Features::POLYGON_MODE_LINE - | wgt::Features::POLYGON_MODE_POINT | wgt::Features::VERTEX_WRITABLE_STORAGE | wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | wgt::Features::TIMESTAMP_QUERY diff --git a/third_party/rust/wgpu-hal/src/dx12/conv.rs b/third_party/rust/wgpu-hal/src/dx12/conv.rs index 7b39e98ad2528..8b44ae9c4b05a 100644 --- a/third_party/rust/wgpu-hal/src/dx12/conv.rs +++ b/third_party/rust/wgpu-hal/src/dx12/conv.rs @@ -213,12 +213,12 @@ pub fn map_topology( pub fn map_polygon_mode(mode: wgt::PolygonMode) -> d3d12_ty::D3D12_FILL_MODE { match mode { - wgt::PolygonMode::Point => { - log::error!("Point rasterization is not supported"); - d3d12_ty::D3D12_FILL_MODE_WIREFRAME - } - wgt::PolygonMode::Line => d3d12_ty::D3D12_FILL_MODE_WIREFRAME, wgt::PolygonMode::Fill => d3d12_ty::D3D12_FILL_MODE_SOLID, + wgt::PolygonMode::Line => d3d12_ty::D3D12_FILL_MODE_WIREFRAME, + wgt::PolygonMode::Point => panic!( + "{:?} is not enabled for this backend", + wgt::Features::POLYGON_MODE_POINT + ), } } diff --git a/third_party/rust/wgpu-hal/src/gles/conv.rs b/third_party/rust/wgpu-hal/src/gles/conv.rs index 86ff3b60b02ce..dd5d764c6a556 100644 --- a/third_party/rust/wgpu-hal/src/gles/conv.rs +++ b/third_party/rust/wgpu-hal/src/gles/conv.rs @@ -279,8 +279,18 @@ pub fn map_primitive_topology(topology: wgt::PrimitiveTopology) -> u32 { } pub(super) fn map_primitive_state(state: &wgt::PrimitiveState) -> super::PrimitiveState { - //Note: state.polygon_mode is not supported, see `Features::POLYGON_MODE_LINE` and - //`Features::POLYGON_MODE_POINT` + match state.polygon_mode { + wgt::PolygonMode::Fill => {} + wgt::PolygonMode::Line => panic!( + "{:?} is not enabled for this backend", + wgt::Features::POLYGON_MODE_LINE + ), + wgt::PolygonMode::Point => panic!( + "{:?} is not enabled for this backend", + wgt::Features::POLYGON_MODE_POINT + ), + } + super::PrimitiveState { //Note: we are flipping the front face, so that // the Y-flip in the generated GLSL keeps the same visibility. diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs index 931d4a2819b86..4fa4a3e27db7d 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/instance.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -228,8 +228,7 @@ impl super::Instance { if cfg!(target_os = "macos") { // VK_EXT_metal_surface extensions.push(ext::MetalSurface::name()); - extensions - .push(CStr::from_bytes_with_nul(b"VK_KHR_portability_enumeration\0").unwrap()); + extensions.push(ash::vk::KhrPortabilityEnumerationFn::name()); } if flags.contains(crate::InstanceFlags::DEBUG) { @@ -657,6 +656,15 @@ impl crate::Instance for super::Instance { #[cfg(not(target_os = "android"))] let android_sdk_version = 0; + let mut flags = vk::InstanceCreateFlags::empty(); + + // Avoid VUID-VkInstanceCreateInfo-flags-06559: Only ask the instance to + // enumerate incomplete Vulkan implementations (which we need on Mac) if + // we managed to find the extension that provides the flag. + if extensions.contains(&ash::vk::KhrPortabilityEnumerationFn::name()) { + flags |= vk::InstanceCreateFlags::ENUMERATE_PORTABILITY_KHR; + } + let vk_instance = { let str_pointers = layers .iter() @@ -667,11 +675,8 @@ impl crate::Instance for super::Instance { }) .collect::>(); - const VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR: u32 = 0x00000001; let create_info = vk::InstanceCreateInfo::builder() - .flags(vk::InstanceCreateFlags::from_raw( - VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR, - )) + .flags(flags) .application_info(&app_info) .enabled_layer_names(&str_pointers[..layers.len()]) .enabled_extension_names(&str_pointers[layers.len()..]); diff --git a/third_party/rust/wgpu-types/.cargo-checksum.json b/third_party/rust/wgpu-types/.cargo-checksum.json index 38bb584a29414..8c6fdc7f6c57b 100644 --- a/third_party/rust/wgpu-types/.cargo-checksum.json +++ b/third_party/rust/wgpu-types/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3e6c7a81b7f5b26b82b7a8a423eda073864e457083fe884b5ba53bda62e68cc9","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"3fe98027aa73970c8ab7874a3e13dbfd6faa87df2081beb5c83aeec4c60f372f","src/lib.rs":"539e99813685991a2e57e84b503c9a144d1b9ae24b36f321114f15d5b2867fec","src/math.rs":"4d03039736dd6926feb139bc68734cb59df34ede310427bbf059e5c925e0af3b"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"3e6c7a81b7f5b26b82b7a8a423eda073864e457083fe884b5ba53bda62e68cc9","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"3fe98027aa73970c8ab7874a3e13dbfd6faa87df2081beb5c83aeec4c60f372f","src/lib.rs":"963d72ccc233e5121b0cba2df6d6002d27022d898a5634dbc1c3f4ef03c4b1b9","src/math.rs":"4d03039736dd6926feb139bc68734cb59df34ede310427bbf059e5c925e0af3b"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-types/src/lib.rs b/third_party/rust/wgpu-types/src/lib.rs index a3dc1906c6279..310e10a6c2fea 100644 --- a/third_party/rust/wgpu-types/src/lib.rs +++ b/third_party/rust/wgpu-types/src/lib.rs @@ -679,7 +679,6 @@ bitflags::bitflags! { /// This allows only drawing the vertices of polygons/triangles instead of filled /// /// Supported platforms: - /// - DX12 /// - Vulkan /// /// This is a native only feature. @@ -1270,8 +1269,8 @@ bitflags::bitflags! { const INDIRECT_EXECUTION = 1 << 2; /// Supports non-zero `base_vertex` parameter to indexed draw calls. const BASE_VERTEX = 1 << 3; - /// Supports reading from a depth/stencil buffer while using as a read-only depth/stencil - /// attachment. + /// Supports reading from a depth/stencil texture while using it as a read-only + /// depth/stencil attachment. /// /// The WebGL2 and GLES backends do not support RODS. const READ_ONLY_DEPTH_STENCIL = 1 << 4;