diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in index 1a42e6bc9f50..1540c0f0bb21 100644 --- a/.cargo/config.toml.in +++ b/.cargo/config.toml.in @@ -40,9 +40,9 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0"] +[source."git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c"] git = "https://github.com/gfx-rs/wgpu" -rev = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" replace-with = "vendored-sources" [source."git+https://github.com/glandium/rust-objc?rev=4de89f5aa9851ceca4d40e7ac1e2759410c04324"] diff --git a/Cargo.lock b/Cargo.lock index e8c4b3986611..15deecdbc097 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4480,7 +4480,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "arrayvec", "bit-set", @@ -7350,7 +7350,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "arrayvec", "bit-vec", @@ -7378,7 +7378,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "wgpu-hal", ] @@ -7386,7 +7386,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-windows-linux-android" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "wgpu-hal", ] @@ -7394,7 +7394,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "android_system_properties", "arrayvec", @@ -7429,7 +7429,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "24.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=93f64dc847a0e6788b17b292ae4d7d59361e3be0#93f64dc847a0e6788b17b292ae4d7d59361e3be0" +source = "git+https://github.com/gfx-rs/wgpu?rev=dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c#dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" dependencies = [ "bitflags 2.9.0", "js-sys", diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml index acfacd058d7c..3a02fd31e0a4 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 = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" # TODO: remove the replay feature on the next update containing https://github.com/gfx-rs/wgpu/pull/5182 features = ["serde", "replay", "trace", "strict_asserts", "wgsl", "api_log_info", "indirect-validation"] @@ -26,32 +26,32 @@ features = ["serde", "replay", "trace", "strict_asserts", "wgsl", "api_log_info" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" 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 = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" features = ["dx12"] # We want the wgpu-core Vulkan backend on Linux and Windows. [target.'cfg(any(windows, all(unix, not(any(target_os = "macos", target_os = "ios")))))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "93f64dc847a0e6788b17b292ae4d7d59361e3be0" +rev = "dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" features = ["oom_panic", "device_lost_panic", "internal_error_panic"] [target.'cfg(windows)'.dependencies] diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml index 8e4cf0207b91..7832de51c2d6 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 93f64dc847a0e6788b17b292ae4d7d59361e3be0 + release: dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c (2025-03-07T03:44:36Z). # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: 93f64dc847a0e6788b17b292ae4d7d59361e3be0 + revision: dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c license: ['MIT', 'Apache-2.0'] diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 88b4be9ccf25..47464b5e8a62 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3647,9 +3647,12 @@ criteria = "safe-to-deploy" delta = "23.1.0 -> 24.0.0" [[audits.naga]] -who = "Teodor Tanasoaia " +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", +] criteria = "safe-to-deploy" -delta = "24.0.0 -> 24.0.0@git:93f64dc847a0e6788b17b292ae4d7d59361e3be0" +delta = "24.0.0 -> 24.0.0@git:dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" importable = false [[audits.net2]] @@ -5868,9 +5871,12 @@ criteria = "safe-to-deploy" delta = "23.0.1 -> 24.0.0" [[audits.wgpu-core]] -who = "Teodor Tanasoaia " +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", +] criteria = "safe-to-deploy" -delta = "24.0.0 -> 24.0.0@git:93f64dc847a0e6788b17b292ae4d7d59361e3be0" +delta = "24.0.0 -> 24.0.0@git:dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" importable = false [[audits.wgpu-hal]] @@ -5952,9 +5958,12 @@ criteria = "safe-to-deploy" delta = "23.0.1 -> 24.0.0" [[audits.wgpu-hal]] -who = "Teodor Tanasoaia " +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", +] criteria = "safe-to-deploy" -delta = "24.0.0 -> 24.0.0@git:93f64dc847a0e6788b17b292ae4d7d59361e3be0" +delta = "24.0.0 -> 24.0.0@git:dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" importable = false [[audits.wgpu-types]] @@ -6031,9 +6040,12 @@ criteria = "safe-to-deploy" delta = "23.0.0 -> 24.0.0" [[audits.wgpu-types]] -who = "Teodor Tanasoaia " +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", +] criteria = "safe-to-deploy" -delta = "24.0.0 -> 24.0.0@git:93f64dc847a0e6788b17b292ae4d7d59361e3be0" +delta = "24.0.0 -> 24.0.0@git:dc02f91ffe1feab8c35d3fdf41f61a62a5004d2c" importable = false [[audits.whatsys]] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/operation/render_pipeline/sample_mask/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/operation/render_pipeline/sample_mask/cts.https.html.ini index 8ea9de807d0f..5e963586601e 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/operation/render_pipeline/sample_mask/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/operation/render_pipeline/sample_mask/cts.https.html.ini @@ -102,10 +102,10 @@ expected: if os == "win": [OK, ERROR] [:interpolated=false;sampleCount=1;rasterizationMask=0] - expected: FAIL [:interpolated=false;sampleCount=1;rasterizationMask=1] - expected: FAIL + expected: + if os == "mac": FAIL [:interpolated=false;sampleCount=4;rasterizationMask=0] expected: FAIL @@ -156,10 +156,10 @@ expected: FAIL [:interpolated=true;sampleCount=1;rasterizationMask=0] - expected: FAIL [:interpolated=true;sampleCount=1;rasterizationMask=1] - expected: FAIL + expected: + if os == "mac": FAIL [:interpolated=true;sampleCount=4;rasterizationMask=0] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxBufferSize/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxBufferSize/cts.https.html.ini index 1ce50e3302b3..1f310648a640 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxBufferSize/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxBufferSize/cts.https.html.ini @@ -7,6 +7,8 @@ [:limitTest="atDefault";testValueName="overLimit"] [:limitTest="atMaximum";testValueName="atLimit"] + expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxColorAttachmentBytesPerSample/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxColorAttachmentBytesPerSample/cts.https.html.ini index c78d927e2acf..f0f2ff6e6959 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxColorAttachmentBytesPerSample/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxColorAttachmentBytesPerSample/cts.https.html.ini @@ -72,7 +72,11 @@ if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] + if os == "mac": FAIL [:limitTest="atDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: @@ -83,7 +87,11 @@ if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] + if os == "mac": FAIL [:limitTest="atDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: @@ -100,7 +108,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -111,7 +119,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -128,7 +136,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -139,7 +147,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -158,8 +166,7 @@ [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -172,8 +179,7 @@ [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -193,8 +199,7 @@ [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -207,8 +212,7 @@ [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -226,7 +230,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -237,6 +241,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -253,7 +258,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -264,7 +269,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -283,8 +288,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -297,8 +301,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -318,8 +321,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -332,8 +334,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL + if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -351,7 +352,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -362,7 +363,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -379,7 +380,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -390,7 +391,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -407,7 +408,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -418,7 +419,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -435,7 +436,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -446,7 +447,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: - if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "linux": [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -463,6 +464,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -472,6 +474,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -487,6 +490,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -497,6 +501,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: + if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "mac": [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -515,7 +520,8 @@ [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] @@ -528,7 +534,8 @@ [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] @@ -548,7 +555,8 @@ [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "win": FAIL - if os == "linux": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] @@ -561,7 +569,8 @@ [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "win": FAIL - if os == "linux": FAIL + if os == "linux" and debug: FAIL + if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] @@ -671,6 +680,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -678,6 +688,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -688,6 +699,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -695,6 +707,7 @@ [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -706,7 +719,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -715,7 +729,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -727,7 +742,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -736,7 +752,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -750,6 +767,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: @@ -760,6 +778,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: @@ -773,6 +792,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -780,6 +800,7 @@ [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -791,7 +812,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -800,7 +822,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -812,7 +835,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -821,7 +845,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [FAIL, TIMEOUT, NOTRUN] @@ -832,6 +857,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -839,6 +865,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -849,6 +876,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -856,6 +884,7 @@ [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -866,6 +895,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -873,6 +903,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -883,6 +914,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -890,6 +922,7 @@ [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "linux": [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: [PASS, TIMEOUT, NOTRUN] @@ -925,6 +958,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rg16uint"] expected: if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: @@ -934,6 +968,7 @@ [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba16uint"] expected: if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: @@ -951,7 +986,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rg8unorm"] expected: @@ -964,7 +1000,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=1;interleaveFormat="rgba8unorm"] expected: @@ -984,7 +1021,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rg8unorm"] expected: @@ -997,7 +1035,8 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";sampleCount=4;interleaveFormat="rgba8unorm"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxComputeWorkgroupsPerDimension/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxComputeWorkgroupsPerDimension/cts.https.html.ini index 6660c4fa1d72..5bbe219fc460 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxComputeWorkgroupsPerDimension/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxComputeWorkgroupsPerDimension/cts.https.html.ini @@ -316,13 +316,15 @@ expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";pipelineType="createComputePipeline";axis=2] expected: if os == "win": FAIL if os == "linux": [FAIL, TIMEOUT, NOTRUN] - if os == "mac": FAIL + if os == "mac" and debug: FAIL + if os == "mac" and not debug: [FAIL, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";pipelineType="createComputePipelineAsync";axis=0] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageBuffersPerShaderStage/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageBuffersPerShaderStage/cts.https.html.ini index 921b8dbd0c7b..408a016fe527 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageBuffersPerShaderStage/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageBuffersPerShaderStage/cts.https.html.ini @@ -942,14 +942,17 @@ [:limitTest="atDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="backward"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="forward"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="shiftByHalf"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="atLimit";visibility=6;type="storage";order="backward"] @@ -962,14 +965,17 @@ [:limitTest="atDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="backward"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="forward"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="shiftByHalf"] expected: if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="atDefault";testValueName="overLimit";visibility=1;type="read-only-storage";order="backward"] expected: @@ -1706,151 +1712,181 @@ expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=1;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=1;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=2;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=4;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=6;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";visibility=1;type="read-only-storage";order="backward"] expected: @@ -2126,451 +2162,541 @@ expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=1;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=1;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=2;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=3;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=4;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=5;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=6;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";visibility=7;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=1;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=1;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=1;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=2;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=3;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=3;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=3;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=4;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=5;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=5;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=5;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=6;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=7;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=7;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";visibility=7;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=1;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=1;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=1;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=2;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=3;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=3;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=3;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=4;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=5;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=5;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=5;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=6;type="storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="backward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="forward"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";visibility=7;type="read-only-storage";order="shiftByHalf"] expected: if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";visibility=1;type="read-only-storage";order="backward"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageTexturesPerShaderStage/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageTexturesPerShaderStage/cts.https.html.ini index c071be18531a..051c08b8a15e 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageTexturesPerShaderStage/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/api/validation/capability_checks/limits/maxStorageTexturesPerShaderStage/cts.https.html.ini @@ -785,10 +785,7 @@ [cts.https.html?q=webgpu:api,validation,capability_checks,limits,maxStorageTexturesPerShaderStage:createPipeline,at_over:*] implementation-status: backlog - expected: - if os == "win" and debug: [OK, TIMEOUT] - if os == "linux": [OK, TIMEOUT] - if os == "mac": [OK, TIMEOUT] + expected: [OK, TIMEOUT] [:limitTest="atDefault";testValueName="atLimit";async=false;bindingCombination="compute";access="read-only"] [:limitTest="atDefault";testValueName="atLimit";async=false;bindingCombination="compute";access="read-write"] @@ -867,450 +864,558 @@ [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="atMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux": [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="atLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="compute";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="fragment";access="write-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="overMaximum";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux": [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";async=false;bindingCombination="compute";access="read-only"] @@ -1336,6 +1441,8 @@ [:limitTest="underDefault";testValueName="atLimit";async=true;bindingCombination="compute";access="read-write"] [:limitTest="underDefault";testValueName="atLimit";async=true;bindingCombination="compute";access="write-only"] + expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="atLimit";async=true;bindingCombination="fragment";access="read-only"] @@ -1351,80 +1458,101 @@ [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and debug: FAIL if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-only"] + expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="fragment";access="read-write"] + expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and debug: FAIL if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="vertex";access="read-only"] + expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=false;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="compute";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="compute";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="compute";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and debug: FAIL if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="fragment";access="read-write"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="fragment";access="write-only"] expected: - if os == "win": FAIL + if os == "win" and debug: FAIL + if os == "win" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and debug: FAIL if os == "linux" and not debug: [FAIL, TIMEOUT, NOTRUN] if os == "mac": FAIL [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="vertex";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleFragmentStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] [:limitTest="underDefault";testValueName="overLimit";async=true;bindingCombination="vertexAndFragmentWithPossibleVertexStageOverflow";access="read-only"] expected: + if os == "win" and not debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleBias/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleBias/cts.https.html.ini index 2859765d78b2..f4d0d7a27512 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleBias/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleBias/cts.https.html.ini @@ -10438,30 +10438,18 @@ [:format="bc2-rgba-unorm";filt="linear";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm";filt="linear";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm";filt="linear";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm";filt="nearest";mode="c"] expected: @@ -10470,138 +10458,78 @@ [:format="bc2-rgba-unorm";filt="nearest";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm";filt="nearest";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="linear";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="linear";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="linear";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="nearest";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="nearest";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc2-rgba-unorm-srgb";filt="nearest";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="linear";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="linear";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="linear";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="nearest";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="nearest";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm";filt="nearest";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm-srgb";filt="linear";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm-srgb";filt="linear";mode="m"] expected: @@ -10610,39 +10538,23 @@ [:format="bc3-rgba-unorm-srgb";filt="linear";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm-srgb";filt="nearest";mode="c"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm-srgb";filt="nearest";mode="m"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc3-rgba-unorm-srgb";filt="nearest";mode="r"] expected: - if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "win" and not debug: FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="bc4-r-snorm";filt="linear";mode="c"] expected: diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleCompare/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleCompare/cts.https.html.ini index b1768b0d2149..c89a92cd3e66 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleCompare/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleCompare/cts.https.html.ini @@ -852,31 +852,33 @@ [:format="depth24plus";filt="nearest";modeU="c";modeV="m";offset=false] expected: - if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac": FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="depth24plus";filt="nearest";modeU="c";modeV="m";offset=true] expected: - if os == "win": FAIL + if os == "win" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "win" and not debug: FAIL if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and not debug: FAIL - if os == "mac": FAIL + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: FAIL [:format="depth24plus";filt="nearest";modeU="c";modeV="r";offset=false] expected: if os == "win": FAIL if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and not debug: FAIL - if os == "mac": FAIL + if os == "mac" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "mac" and not debug: FAIL [:format="depth24plus";filt="nearest";modeU="c";modeV="r";offset=true] expected: if os == "win": FAIL if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] if os == "linux" and not debug: FAIL - if os == "mac": FAIL + if os == "mac" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "mac" and not debug: FAIL [:format="depth24plus";filt="nearest";modeU="m";modeV="c";offset=false] expected: @@ -910,11 +912,8 @@ [:format="depth24plus";filt="nearest";modeU="r";modeV="c";offset=false] expected: - if os == "win": FAIL - if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "linux" and not debug: FAIL - if os == "mac" and debug: [FAIL, TIMEOUT, NOTRUN] - if os == "mac" and not debug: FAIL + if debug: [FAIL, TIMEOUT, NOTRUN] + if not debug: FAIL [:format="depth24plus";filt="nearest";modeU="r";modeV="c";offset=true] expected: @@ -1230,13 +1229,25 @@ if os == "mac" and not debug: FAIL [:format="depth32float";filt="linear";modeU="c";modeV="c";offset=false] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="c";modeV="c";offset=true] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="c";modeV="m";offset=false] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="c";modeV="m";offset=true] expected: @@ -1246,10 +1257,18 @@ if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="c";modeV="r";offset=false] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="c";modeV="r";offset=true] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="linear";modeU="m";modeV="c";offset=false] expected: @@ -1360,10 +1379,18 @@ expected: FAIL [:format="depth32float";filt="nearest";modeU="m";modeV="m";offset=false] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="nearest";modeU="m";modeV="m";offset=true] - expected: FAIL + expected: + if os == "win": FAIL + if os == "linux" and debug: [FAIL, TIMEOUT, NOTRUN] + if os == "linux" and not debug: FAIL + if os == "mac": FAIL [:format="depth32float";filt="nearest";modeU="m";modeV="r";offset=false] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleGrad/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleGrad/cts.https.html.ini index 50ac3590e09f..ac3d9b7ad769 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleGrad/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureSampleGrad/cts.https.html.ini @@ -25774,7 +25774,7 @@ tags: [webgpu, webgpu-long] implementation-status: backlog expected: - if os == "win" and debug: CRASH + if os == "win": CRASH if os == "linux" and debug: CRASH if os == "mac": CRASH [:stage="c";format="astc-10x10-unorm";filt="linear";modeU="c";modeV="c";offset=false] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureStore/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureStore/cts.https.html.ini index 06f8f77076fe..279bff16f5b8 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureStore/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/textureStore/cts.https.html.ini @@ -1,7 +1,5 @@ [cts.https.html?q=webgpu:shader,execution,expression,call,builtin,textureStore:bgra8unorm_swizzle:*] - implementation-status: backlog [:] - expected: FAIL [cts.https.html?q=webgpu:shader,execution,expression,call,builtin,textureStore:out_of_bounds:*] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/workgroupUniformLoad/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/workgroupUniformLoad/cts.https.html.ini index 1d6cf2b04897..72cd2043c54d 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/workgroupUniformLoad/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/expression/call/builtin/workgroupUniformLoad/cts.https.html.ini @@ -1,16 +1,26 @@ [cts.https.html?q=webgpu:shader,execution,expression,call,builtin,workgroupUniformLoad:types:*] - implementation-status: backlog + implementation-status: + if os == "win": backlog + if os == "mac": backlog [:type="ComplexStruct";wgsize=[1,128\]] - expected: FAIL + expected: + if os == "win": FAIL + if os == "mac": FAIL [:type="ComplexStruct";wgsize=[1,1\]] - expected: FAIL + expected: + if os == "win": FAIL + if os == "mac": FAIL [:type="ComplexStruct";wgsize=[16,16\]] - expected: FAIL + expected: + if os == "win": FAIL + if os == "mac": FAIL [:type="ComplexStruct";wgsize=[3,7\]] - expected: FAIL + expected: + if os == "win": FAIL + if os == "mac": FAIL [:type="SimpleStruct";wgsize=[1,128\]] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/zero_init/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/zero_init/cts.https.html.ini index 415e1e1e3300..322f2a723289 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/zero_init/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/execution/zero_init/cts.https.html.ini @@ -4,6 +4,7 @@ expected: if os == "win" and not debug: CRASH if os == "linux" and debug: [OK, CRASH] + if os == "linux" and not debug: CRASH [:addressSpace="function";workgroupSize=[1,1,1\];batch__=0] expected: if os == "win" and debug: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/array/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/array/cts.https.html.ini index 2aa9afcdb674..107b043f4fad 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/array/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/array/cts.https.html.ini @@ -20,17 +20,14 @@ expected: FAIL [:case="override_oob_neg"] - expected: FAIL [:case="override_oob_pos"] - expected: FAIL [:case="runtime_array_const_oob_neg"] [:case="runtime_array_override_oob_neg"] [:case="runtime_in_bounds"] - expected: FAIL [:case="runtime_oob_neg"] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/matrix/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/matrix/cts.https.html.ini index 4bac62d0db30..fc8c8fe5fea4 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/matrix/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/access/matrix/cts.https.html.ini @@ -20,17 +20,14 @@ expected: FAIL [:case="override_oob_neg"] - expected: FAIL [:case="override_oob_pos"] - expected: FAIL [:case="runtime_array_const_oob_neg"] [:case="runtime_array_override_oob_neg"] [:case="runtime_in_bounds"] - expected: FAIL [:case="runtime_oob_neg"] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/binary/short_circuiting_and_or/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/binary/short_circuiting_and_or/cts.https.html.ini index ee06d27c1bf6..61c360cd027f 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/binary/short_circuiting_and_or/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/expression/binary/short_circuiting_and_or/cts.https.html.ini @@ -111,7 +111,6 @@ expected: FAIL [:op="%26%26";rhs="overflow";short_circuit=false] - expected: FAIL [:op="%26%26";rhs="overflow";short_circuit=true] expected: FAIL @@ -132,7 +131,6 @@ expected: FAIL [:op="%7C%7C";rhs="overflow";short_circuit=false] - expected: FAIL [:op="%7C%7C";rhs="overflow";short_circuit=true] expected: FAIL @@ -156,7 +154,6 @@ expected: FAIL [:op="%26%26";rhs="overflow";short_circuit=false] - expected: FAIL [:op="%26%26";rhs="overflow";short_circuit=true] expected: FAIL @@ -177,7 +174,6 @@ expected: FAIL [:op="%7C%7C";rhs="overflow";short_circuit=false] - expected: FAIL [:op="%7C%7C";rhs="overflow";short_circuit=true] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/extension/readonly_and_readwrite_storage_textures/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/extension/readonly_and_readwrite_storage_textures/cts.https.html.ini index 24becc025f55..1e3caf761c63 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/extension/readonly_and_readwrite_storage_textures/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/extension/readonly_and_readwrite_storage_textures/cts.https.html.ini @@ -1,5 +1,7 @@ [cts.https.html?q=webgpu:shader,validation,extension,readonly_and_readwrite_storage_textures:textureBarrier:*] + implementation-status: backlog [:] + expected: FAIL [cts.https.html?q=webgpu:shader,validation,extension,readonly_and_readwrite_storage_textures:var_decl:*] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/parse/shadow_builtins/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/parse/shadow_builtins/cts.https.html.ini index de147ec41686..71df8a014c74 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/parse/shadow_builtins/cts.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/shader/validation/parse/shadow_builtins/cts.https.html.ini @@ -58,10 +58,8 @@ [:inject="module"] [:inject="none"] - expected: FAIL [:inject="sibling"] - expected: FAIL [cts.https.html?q=webgpu:shader,validation,parse,shadow_builtins:shadow_hides_builtin_f16:*] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/getCurrentTexture/dedicated.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/getCurrentTexture/dedicated.https.html.ini index df6a37c32dca..aa40e3acfeb0 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/getCurrentTexture/dedicated.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/getCurrentTexture/dedicated.https.html.ini @@ -11,7 +11,8 @@ expected: if os == "win" and debug: [OK, ERROR] if os == "win" and not debug: ERROR - if os == "linux": ERROR + if os == "linux" and debug: [OK, ERROR] + if os == "linux" and not debug: ERROR if os == "mac": ERROR [:canvasType="offscreen";prevFrameCallsite="requestAnimationFrame";getCurrentTextureAgain=false] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/dedicated.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/dedicated.https.html.ini index a03c5ac44915..bd204bdc8762 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/dedicated.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/dedicated.https.html.ini @@ -352,9 +352,7 @@ [dedicated.https.html?worker=dedicated&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_huge_size:*] - implementation-status: backlog [:] - expected: FAIL [dedicated.https.html?worker=dedicated&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_unconfigured_nonzero_size:*] @@ -369,7 +367,6 @@ [dedicated.https.html?worker=dedicated&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_zero_size:*] implementation-status: backlog [:configure=false] - expected: FAIL [:configure=true] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/shared.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/shared.https.html.ini index 734ede5d1b22..b83deeb4d5b0 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/shared.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/canvas/readbackFromWebGPUCanvas/shared.https.html.ini @@ -352,9 +352,7 @@ [shared.https.html?worker=shared&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_huge_size:*] - implementation-status: backlog [:] - expected: FAIL [shared.https.html?worker=shared&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_unconfigured_nonzero_size:*] @@ -369,7 +367,6 @@ [shared.https.html?worker=shared&q=webgpu:web_platform,canvas,readbackFromWebGPUCanvas:transferToImageBitmap_zero_size:*] implementation-status: backlog [:configure=false] - expected: FAIL [:configure=true] expected: FAIL diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/dedicated.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/dedicated.https.html.ini index 7692bc5b86f2..3d89ddf63c4b 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/dedicated.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/dedicated.https.html.ini @@ -796,6 +796,7 @@ [:alpha="none";orientation="none";colorSpaceConversion="none";srcFlipYInCopy=false;dstFormat="r16float";dstPremultiplied=false] expected: + if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] if os == "mac" and debug: [TIMEOUT, NOTRUN] @@ -962,6 +963,7 @@ [:alpha="none";orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba32float";dstPremultiplied=true] expected: if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:alpha="none";orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba8unorm";dstPremultiplied=false] @@ -2815,6 +2817,7 @@ [:orientation="none";colorSpaceConversion="none";srcFlipYInCopy=false;dstFormat="r16float";dstPremultiplied=false] expected: + if os == "win" and debug: [PASS, TIMEOUT, NOTRUN] if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] if os == "mac" and debug: [TIMEOUT, NOTRUN] @@ -2985,6 +2988,7 @@ [:orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba32float";dstPremultiplied=true] expected: if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba8unorm";dstPremultiplied=false] diff --git a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/shared.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/shared.https.html.ini index a106a23b6857..2691a91a08e1 100644 --- a/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/shared.https.html.ini +++ b/testing/web-platform/mozilla/meta/webgpu/cts/webgpu/web_platform/copyToTexture/ImageBitmap/shared.https.html.ini @@ -964,6 +964,7 @@ [:alpha="none";orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba32float";dstPremultiplied=true] expected: if os == "linux" and debug: [PASS, TIMEOUT, NOTRUN] + if os == "mac" and debug: [PASS, TIMEOUT, NOTRUN] [:alpha="none";orientation="none";colorSpaceConversion="none";srcFlipYInCopy=true;dstFormat="rgba8unorm";dstPremultiplied=false] @@ -1379,7 +1380,8 @@ if os == "win": [TIMEOUT, NOTRUN] if os == "linux" and debug: [TIMEOUT, NOTRUN] if os == "linux" and not debug: [PASS, TIMEOUT, NOTRUN] - if os == "mac": [TIMEOUT, NOTRUN] + if os == "mac" and debug: [TIMEOUT, NOTRUN] + if os == "mac" and not debug: [PASS, TIMEOUT, NOTRUN] [:alpha="premultiply";orientation="none";colorSpaceConversion="default";srcFlipYInCopy=false;dstFormat="bgra8unorm";dstPremultiplied=false] expected: diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json index 57b63b2dab68..a1d0f4e9c47e 100644 --- a/third_party/rust/naga/.cargo-checksum.json +++ b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"e60105d413f857e37dae165f819c47491d0a595183d3c9146b259d811b98b14f","Cargo.toml":"93aaec4148e1d97a84fcf1bcfd57a2331daf2cbc28f8bde3640c3e5faad22d10","README.md":"00a6070ebadb15a9488f117b286f50e4838a7dd0a28d41c9fcff4781c6b49171","build.rs":"a08840f5b18ab09f453e1fc3a09dd16df83caa7798b6ecb7e7ac2f8addab276b","src/arena/handle.rs":"1bf2edcca03d7cb466e1f8bd4bf1c966b805505ea2ee3641c39aa04811413478","src/arena/handle_set.rs":"cf73f190c066257dca6e92444d10a5e75cc1b5383c7dfe920c6c188f9dbfedf0","src/arena/handlevec.rs":"dfc9249478eb6980c13587c740d91234214bc7e0eef90e6f40b3d99decf70a58","src/arena/mod.rs":"1482d793968eece2e877347a8708c478c1c50888db198b5a9e6492af33ee2849","src/arena/range.rs":"88683c36b137499ab537cf906505c2bd0871e0b9177e3a4e55da9db4e86df6a2","src/arena/unique_arena.rs":"83c8ee1185281f7198725e40a281216b95412f908e8495aebda7c13395d16c9f","src/back/continue_forward.rs":"a00eac975fd2f1d23ebb579f1abc24ed1a30055df313033f969ed0f388b56b41","src/back/dot/mod.rs":"f16d29109ac5e09148a0636f08890e7b05a4c92fb1c3f2cd58af44f2226afe8d","src/back/glsl/features.rs":"c8da15759d4efbf9b4d72d12aea9791af94ff700723cb9da653f3365930b6c96","src/back/glsl/keywords.rs":"b8883e5ee8a3d400fa44fef2baffe2853e72ff91e832499c128454d325ceccd9","src/back/glsl/mod.rs":"42d7a9d79f7bfcb4689a3b812911b078457d6a1948508c5bec6832eea2811316","src/back/hlsl/conv.rs":"05db8a8e982b66a0eae60818799f28952ddcc121cca93a80ae761c84bde86324","src/back/hlsl/help.rs":"386a5f55b7388eeeb8899e6843ead64db720e7cbcf440065d9ca2970b2efe848","src/back/hlsl/keywords.rs":"2db780c1e13b1d1af5a51d7124b0a449a072b308f295fd778c3d2faac7ee937d","src/back/hlsl/mod.rs":"51558d154114370eb2166661ed300abc10dd0171f86182452346ab99d7adb837","src/back/hlsl/ray.rs":"d929fbdd8c7c191e4b8973a5347f8d785ae89bf047841bdd15d62c60a7a46af5","src/back/hlsl/storage.rs":"0023cf02eca4b61adf6c30ca289ada5545629d2e1a60f31145a4b22f5efb41e6","src/back/hlsl/writer.rs":"359714a5714ccc837ebb25061c22b8ab9d5bdb0a6b4255918b963acbf721c509","src/back/mod.rs":"5265adc192b91397770bfab4bdc91995face3e731bc618953bc129e587d56fcc","src/back/msl/keywords.rs":"4cfcf429cc15fb35d811ee7f80a2664b98b4aeaf96e26f1e7720aa4f74a11bbd","src/back/msl/mod.rs":"d593419db8b7e0b73f2b5793fef167bf2d854048967f62ef49a02ac4c01cbe0c","src/back/msl/sampler.rs":"9b01d68669e12ff7123243284b85e1a9d2c4d49140bd74ca32dedc007cbf15af","src/back/msl/writer.rs":"fb4fbed0dfa02121a7330909b1d6bc68397e4bd8141ed411e5526fcbdbc76431","src/back/pipeline_constants.rs":"c5345824944332babc361eae459e58ca44f29b8bd6668286440127dafb25b5a6","src/back/spv/block.rs":"722da1c5181a3c47a44151f61d80df86648ccb3e34107892f8a55373a86898e7","src/back/spv/helpers.rs":"0ba90760dd2dbc6ad461454d33d6b4a75a603326e8ba7e3c2538c6360da9b445","src/back/spv/image.rs":"771c716548efab1943798f1876b58b44e4ab4f154f252e442890093f1d494be1","src/back/spv/index.rs":"4845ad1f5e7abbd6b7ea24b3e0cfa4a04c6653656d70f522055737e72c9d562a","src/back/spv/instructions.rs":"45c749e11272c77218fd80ed9d309d47dd09a8eb977e4fe3b3fc787240f9b1b7","src/back/spv/layout.rs":"164899d72e73afea08433c70484d0baa2492ebbfc26351e8decad5bcb90a794c","src/back/spv/mod.rs":"b51158e4c7d7ab7d7935f58a3fd0dab62e4056059ef619fec0a8fd78dc68e9ff","src/back/spv/ray.rs":"70bb459a109af7c61f6a7389f398af8a7b766b8027b128ff712a12cd5402a848","src/back/spv/recyclable.rs":"aea0e8054f8d9a5c8bd36019673af1a46adb6c89d40defdda2f6ac3df98773cd","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/subgroup.rs":"6fc3e390b1c19c0f3ca5f232efd8af939fe23320e456d77e955a9c05ac606256","src/back/spv/writer.rs":"56744bd46d057e1bb41f8754e6955075566a6d256ec27aacb7479e0f01be27ac","src/back/wgsl/mod.rs":"70a108f4d297ce0581067500e0c6a579bcbc2ae63f4ed0afbd2da8f0199c435e","src/back/wgsl/polyfill/inverse/inverse_2x2_f16.wgsl":"9e7635d04724822931c805a8b35e76d6d294d447e4ea8d57b308ce45609bf736","src/back/wgsl/polyfill/inverse/inverse_2x2_f32.wgsl":"340d491abde07f93996391796db65a5f88402663eaf6b9d2d894d11cb8cf8b6d","src/back/wgsl/polyfill/inverse/inverse_3x3_f16.wgsl":"4f13a1a4b3e1b51f0f992d13c55cf854a80917554a4d13c997819fa1fe776ba4","src/back/wgsl/polyfill/inverse/inverse_3x3_f32.wgsl":"9b16d2f4b9e433c8e03a0cb46ab48508f3bf7e185ce1b4e26106c47e81a677cb","src/back/wgsl/polyfill/inverse/inverse_4x4_f16.wgsl":"86d39d1db5d03995b404950279db7f1698ad9622982aa319fdedb7532673235b","src/back/wgsl/polyfill/inverse/inverse_4x4_f32.wgsl":"dc510525ac2dce66389a8c4bf8b2f31f0dedd9e6debdbe4ffd939a0a7fc533d3","src/back/wgsl/polyfill/mod.rs":"f4ab3c9b9cdc36d16dab00d0f7f07d6e6beda0e27a36053e9b5ffeeb7ca18edc","src/back/wgsl/writer.rs":"5caee232f9c8642764eaab1ae023a8ddba79df4f3a80d9078ae30de6b314cd16","src/block.rs":"e447f7e041fd67052b23d1139cf0574eea93220a818af71691d960bdf026d45f","src/common/mod.rs":"0adff0748e365649b0a80d81b5f2e04814c692967f6de95c49989a1596a7b2b8","src/common/wgsl.rs":"f629cae3cf175001b74b9393331e71b579db210e155eec55fe3b16661c31ce2a","src/compact/expressions.rs":"4d040d2c7b7eb40ef5fb22c1b23a2d9cc86ec79ae499b09602adce43b572de14","src/compact/functions.rs":"8e3d336c988b0c72e4f5ba20c881539a2878a8e273f710d62b84261af7dc1bad","src/compact/handle_set_map.rs":"748de9563f0ff897c113ba665f3e59ab3a023050e2206eb7d566a31f61fc32e5","src/compact/mod.rs":"32382e818918a791cb05c93b772189f5e473470ecd6960c19ab8d23dad09f122","src/compact/statements.rs":"7f98b7ec132c9efda40586617c217506d596908415df4111b849b6e63c6856df","src/compact/types.rs":"026bd27fef115fb8546efc03baa54552495d23ceebbbae342679bde32c48ce2e","src/diagnostic_filter.rs":"1afa6eb4627b404474b7c69f028b47434efb14ec42adee10bb61232ecd3140e7","src/error.rs":"ca7b251c0d09e4cc46a79a3c249c6849a85b5a6c6745b35ae613166fc30b50ba","src/front/atomic_upgrade.rs":"9c7e1cdfc1218c9d11b8c99339c050ae98fd628f030cab2da0ebc1d7b1fbe17d","src/front/glsl/ast.rs":"79d7178631f1c1ebe29af1b8cbab5c7b08a3cfb61fe6f2208b6b796e5cb15e2e","src/front/glsl/builtins.rs":"c4bcdf6e5ed6333baa638d35f448d4c128ccd6b11b1699b10ee641abf18fec7e","src/front/glsl/context.rs":"d054644a076bbca5de0a03413fa37f8bd33862b6559a38e90c549bcb057a8898","src/front/glsl/error.rs":"b91af75612c224eeb51a2205ada2bc5d0808d3cd94d1f0a8842f475ee6396f82","src/front/glsl/functions.rs":"5ea6742833a54a32c9f435496eae6f7a8a363da2ed83f707bc0e7cd663cd03e3","src/front/glsl/lex.rs":"a6b545da840ee8102596c4290e77dae26da08b072e9eeea70d9cdbbce1d6e8c7","src/front/glsl/mod.rs":"bf97bf1710d5d1f8facb77913cb82868697920914a96ed309adf0f19154a2ab4","src/front/glsl/offset.rs":"78816d52527131d774c4a7fc21146d1450bdca777e2c91df226da460f81a5530","src/front/glsl/parser.rs":"98b937cda012c1a77d27846da40cc482112014ad1c7bcb8f953cc99370ed8b85","src/front/glsl/parser/declarations.rs":"b6c1348c4954c78cc3781e7e91df04e58a1e133842a7cfb9aa32ba4a40aee8ac","src/front/glsl/parser/expressions.rs":"c18eb3ca46dcba89f9c8a9ed00d5b824138398905737fb4457b4ac02e7097c47","src/front/glsl/parser/functions.rs":"f13347c2644f20bf0e775a1b460f618e3d1d2ddaebb810e6f4882a0fa147550d","src/front/glsl/parser/types.rs":"e3cca02746b21f7d1c293a319deea4d4654b64ab92409620911381a91378aef2","src/front/glsl/parser_tests.rs":"c44ed3252096c83a0ce1ea9be8d2b867784cdc1c11aa4501aee1a85d86c62511","src/front/glsl/token.rs":"c25c489b152ee2d445ace3c2046473abe64d558b8d27fa08709110e58718b6ac","src/front/glsl/types.rs":"651c3692768493adf26b3cdb394fd2ce45f9803f9561619c16d9d00af4bbddac","src/front/glsl/variables.rs":"4b95ce4e6dd76bcf8eec5e54f4be85ead6062a59e1235cfdbbfc8cf3f1671a83","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"ba984fc9b933a844fa8dadf05dea70f308911054ad3f10448d652706e158b4bd","src/front/spv/convert.rs":"c2ec1288cb565c7c7cb1fadc6a677b41bd14857b3b55ab7fafe7b856204a5179","src/front/spv/error.rs":"6835a4fd90f675a90b39eb2af52c689d0339668d89f2fe5ba9a0afa5b7f0a561","src/front/spv/function.rs":"04682910667fd70f752b8660c6574b4c95bb43b2737700a85acaff6674a9e155","src/front/spv/image.rs":"676f7c71a2c12d2ce75ca96d7a79dea2a3db1f1f665a0c10e3d6d658791ce2ef","src/front/spv/mod.rs":"50b63c5dcf9dcff11dcb860624a8e9262ec9b1fd27ec5112b8bf5eb479b4c68b","src/front/spv/null.rs":"a8ff44e97ffe42a4773d89b88fdb3a8ef8fba58bf6645c73b7a66470234ccf10","src/front/type_gen.rs":"4fef73f32ffa7a88242f187646bada4ea10b94721b4e1cae57da3b1335086dfe","src/front/wgsl/error.rs":"2f23dcbf990f2b2d863ce841cce076a9b7744108cdf9119ac408612851fbc439","src/front/wgsl/index.rs":"caf16ac352824d580a5073253ec13a284cb66d6dbe7b9ac08262fc722e31292a","src/front/wgsl/lower/construction.rs":"5facd234f4e251a323dc21a9ba40f308a1a0d08de8f979978f9bacf9e332949d","src/front/wgsl/lower/conversion.rs":"b78708892a66f095f147c8dd28d55fc43367ccac4eb0757ee357370d5d05f253","src/front/wgsl/lower/mod.rs":"bb1966a17770994c00860fb04960ca74916c3dc6742f20f3c0f7b42ca58c9e73","src/front/wgsl/mod.rs":"89acb71816d78e553cdbbd43b16a0beb2ea573ff17afb96171c9a02b63abfb80","src/front/wgsl/parse/ast.rs":"842f9c5c5a4d0fc2af8dfcc4746474e4119899dce882e8696a537e2e497527e3","src/front/wgsl/parse/conv.rs":"95942e5b0423943bb88903d2eb69ce21debd4bae7b1ff12ac317b8ca4e98c7d1","src/front/wgsl/parse/directive.rs":"3beee2d7d0dd2e5fa2cc91adf41b99b182f790dd5758ef8cd0421934e32df888","src/front/wgsl/parse/directive/enable_extension.rs":"3e2c6b21603b3d52bddf3c3ef872fa1027a74e11c0a8ded7a3b507b775a5b6ce","src/front/wgsl/parse/directive/language_extension.rs":"b769f340f4f89410734d0d0fa3bc8530eb10ddb05bbd175da7bf61b062334cc0","src/front/wgsl/parse/lexer.rs":"234636e07df580ee5e7b7557dd1f16643227bedc5dde11659c852c8c81896f27","src/front/wgsl/parse/mod.rs":"3b026907950bf702d8923edc88056080185a31092bf6550e9151f65f731337d5","src/front/wgsl/parse/number.rs":"4828ee57a87da95f42060100f71c7b54e414793431e50d35bd9c3ea967af81ba","src/front/wgsl/tests.rs":"73fd17ae675200ec075562f39c2cbd493c7be3dbda5730e4008f38c98f13fb2e","src/front/wgsl/to_wgsl.rs":"6927884d7562d80687bf8207fc5c8b71cd146e6f366c97fa82abef5a0738b39f","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"c648ac44241ad55c8c8bad3d8f1bab973d11ddb9c380dcca369b735ed3975309","src/lib.rs":"b6671c3d0d7ffbdb04e1c9b2b2527526bebbe2760425d4a6fcf00fcb5c6567a1","src/non_max_u32.rs":"3f4aafc8e2775982187507d49e7aa58befffdaba71c9287be42afdfde28bcb66","src/proc/constant_evaluator.rs":"8cafff7395b3e21c430dd22a16c99d080577062de18d59eeb26994493e970506","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"6214182b9484078d46fa066265d4554d3dc40d646295c2623d9888240ea1d45e","src/proc/layouter.rs":"e95fd9defa08e0c610d22d7cd795a6af787610d1ff0d4ed27798b4ffd2098cf1","src/proc/mod.rs":"7001168c3f659c733627b7e26c9a19d8d71b8165c6b1df75c570466c9e6de1c7","src/proc/namer.rs":"7328fac41e40890c64c7ee2fa985a4395424f18b08d30f30ca2583fdabd2fd35","src/proc/terminator.rs":"66b0082dce3b29d6d20e9a891c66524d756c8e567ac844d61355248ac4623b07","src/proc/type_methods.rs":"9345f2e3e6c09b3ab14d3c166ea903ec63b5cb634b88f6837c7463f76e21ea41","src/proc/typifier.rs":"01820d774e34dbd66937e87fdc3e9b2ebb7f1442480ae03d08b8f65d9f084376","src/span.rs":"7dc912e50c62ab8088c21f7a63752f29e58e0c3c0de377c9e116062492ecc6ec","src/valid/analyzer.rs":"c67e47a158e134f6f140faf7c7025a7c9c41c8f8708b452797215b18052d1a4d","src/valid/compose.rs":"83e4c09c39f853cf085b83b87e48b3db571da619132960d3ec954ebdfb0a74f2","src/valid/expression.rs":"6f97f07374fa46515c23d56ec8b72afb3e0e04b27e0a9ed8f9ab3b56c9db34fd","src/valid/function.rs":"e9340b0cfce8625888535c784c433fdcd8b794c7a610b67a0884c669d10d507a","src/valid/handles.rs":"98babae4dfbbc6cf832352b2d2e159697dcd69165e64288f4fa96eb69ad5a60e","src/valid/interface.rs":"5683a477212cb0d88a063843d23e8092e5b6df817f12f6ada938ad72a9a908a3","src/valid/mod.rs":"8318c1ecb71361e49f0a98342957dfc25d3b08ba3b07a492ce7b63c5765edf48","src/valid/type.rs":"b93d203ed9d51c1e2cbb76b382f00c8edf0ec5b2da5be23d27ce70ac919371b6"},"package":null} \ No newline at end of file +{"files":{".cargo/config.toml":"d7389d2a0c08ec72b79e83a3c76980903e3f9123625c32e69c798721193e2e74","CHANGELOG.md":"e60105d413f857e37dae165f819c47491d0a595183d3c9146b259d811b98b14f","Cargo.toml":"00ca156a4882d62106663bb1e83f562f9b1604b955fa14a1a2e2c648e15e1651","README.md":"9550cbc1a518ad0f624aabe12c342c72f670705cb4a6878c0c87d172f1dacea0","build.rs":"a08840f5b18ab09f453e1fc3a09dd16df83caa7798b6ecb7e7ac2f8addab276b","src/arena/handle.rs":"897b2b0eebe0d9ae6a65bf2e8c210c8391924da06ef4c9e2a1225ad622400b6c","src/arena/handle_set.rs":"271f89abb20927eb9f45f552ad2365c4976885cb3dc50078950795f8741b402e","src/arena/handlevec.rs":"999de9d55d01213789072a63ad4ae9b4635e6653984d38db8b308d42bb1e7be3","src/arena/mod.rs":"c5f01ef55278337f7b96068b5e52e307cb9281b311230b5bec6dd1ea700d905e","src/arena/range.rs":"b783969dfe32b4937593d871aa5190d561bdd79b6f615da53cb54346e300b9e2","src/arena/unique_arena.rs":"031bba0907a0eccf7d652a22f88d0e27289072ac72b123743a9602d6cf68b587","src/back/continue_forward.rs":"f962e445f0618cf817c2d26e2dbc066c5992eca6e5dd50024cb3ecf7d1d243e6","src/back/dot/mod.rs":"345a6ef4fa0e9f19ec1c87d436f4c0df13f5e3094e45f470cf8ceb5bc4641c58","src/back/glsl/features.rs":"3fc385fb0b793c963fbab0f07a8a6d4412b68762074372c72facbbc5dad51138","src/back/glsl/keywords.rs":"b8883e5ee8a3d400fa44fef2baffe2853e72ff91e832499c128454d325ceccd9","src/back/glsl/mod.rs":"846bd077834b78760cf5759bdda4e521613abffb1f51787ceda654463819a029","src/back/hlsl/conv.rs":"c586d5f44104c4d8cbbd83872d5f943b00463568c82e6cd915b2f30bb4b308fd","src/back/hlsl/help.rs":"bf2a9d05c4545b53f72e167674849c48c0062424095b2dd0baa467cde1f50069","src/back/hlsl/keywords.rs":"2db780c1e13b1d1af5a51d7124b0a449a072b308f295fd778c3d2faac7ee937d","src/back/hlsl/mod.rs":"d6fb5db5c14f0e1700adb9ac7d70e3e0d3f05e31ba6133e0b01f6606780a9ced","src/back/hlsl/ray.rs":"259db3bc8fd5b8ec343fb8620c7cef50048cbea2b9db1f17dc8813ff848269df","src/back/hlsl/storage.rs":"7443cea2abb6ce8d0c0c9bfe805b37b5600bd28618de44ba1ebd8e4e38eac92f","src/back/hlsl/writer.rs":"86283f5feb14ee8acb9bba461e1a5f0ebd694e955fd3ebb98b7775d51bfdb8ae","src/back/mod.rs":"70888dd341313f6c5857359944a7dd32b518e37e3dd0474b0ab760ad5ffbaf3c","src/back/msl/keywords.rs":"4cfcf429cc15fb35d811ee7f80a2664b98b4aeaf96e26f1e7720aa4f74a11bbd","src/back/msl/mod.rs":"dadb12468b17c765489facc8ffecc99ea55cb714ca85cbf906b146879376e86e","src/back/msl/sampler.rs":"9be8805063258b0ff6b6db2e6856d59326caa18f6f64eaf413c5abfcbd1ad341","src/back/msl/writer.rs":"314cc0daf12ca28c94ebc40db33c188a5bb96b6a8147dfd4105913759f4b10e0","src/back/pipeline_constants.rs":"7660e72057534ca205c8300cfee7307c9f753e2944604731a368e19ee0bb3d8c","src/back/spv/block.rs":"5884a668c56bee3afa996a6033d05b1e59812102a9b802243106ba3579d9e1a1","src/back/spv/helpers.rs":"37ef7388b1e97edb2682b93f1f0eceb71039ecd54923d91346d974b29322077c","src/back/spv/image.rs":"4677d14047e1172ea9dd05fd83d5116b5a5e6e30e6818ac2475fc123258001b3","src/back/spv/index.rs":"64b1afa6fe8a51305bdf5c5d6bf370fa0e2a419effa37fbdb124efc8fbc634b6","src/back/spv/instructions.rs":"9bc909a1441ae72193c044cb9c6c24cd402fafaaecfebb46dd8eff631181504e","src/back/spv/layout.rs":"52b965e9efd572dac72e0ee51041256fcc666eb4b2eadebe786e8ff39f6e031a","src/back/spv/mod.rs":"cebb1eb3bb28e6f40366ceab7a369027aac9c27cce37fd4a1b3e4d16617553bd","src/back/spv/ray.rs":"b4ac7b61765f42cb474bbd19da30626fcebf6144712282f2226b302095a77988","src/back/spv/recyclable.rs":"8ea397d4d8d3f2cd5fbc8e0be94d136c2d6e0f0e8a4b5eb567dcc1be104c9ae5","src/back/spv/selection.rs":"aea4bb4da7c0fa4e907b8f1e185433a48f2f0eb7ded97fdd3225beb3f6c1f249","src/back/spv/subgroup.rs":"6fc3e390b1c19c0f3ca5f232efd8af939fe23320e456d77e955a9c05ac606256","src/back/spv/writer.rs":"2525ae0ce5305104f0633983fc853a8b97164a1df21a96f48682a8a220450fd8","src/back/wgsl/mod.rs":"1b04d66e8dba609513d43431d1f0ee9a209fbfd8453862d6e8a7aa41f8910997","src/back/wgsl/polyfill/inverse/inverse_2x2_f16.wgsl":"9e7635d04724822931c805a8b35e76d6d294d447e4ea8d57b308ce45609bf736","src/back/wgsl/polyfill/inverse/inverse_2x2_f32.wgsl":"340d491abde07f93996391796db65a5f88402663eaf6b9d2d894d11cb8cf8b6d","src/back/wgsl/polyfill/inverse/inverse_3x3_f16.wgsl":"4f13a1a4b3e1b51f0f992d13c55cf854a80917554a4d13c997819fa1fe776ba4","src/back/wgsl/polyfill/inverse/inverse_3x3_f32.wgsl":"9b16d2f4b9e433c8e03a0cb46ab48508f3bf7e185ce1b4e26106c47e81a677cb","src/back/wgsl/polyfill/inverse/inverse_4x4_f16.wgsl":"86d39d1db5d03995b404950279db7f1698ad9622982aa319fdedb7532673235b","src/back/wgsl/polyfill/inverse/inverse_4x4_f32.wgsl":"dc510525ac2dce66389a8c4bf8b2f31f0dedd9e6debdbe4ffd939a0a7fc533d3","src/back/wgsl/polyfill/mod.rs":"f4ab3c9b9cdc36d16dab00d0f7f07d6e6beda0e27a36053e9b5ffeeb7ca18edc","src/back/wgsl/writer.rs":"5b4308a2c699b76c0ae5665503f1c13ed553e337c6ba14bbe0fc47ccf3ddb4ad","src/block.rs":"1c59138385fe197a4e96574c792010bcd216cfb0edb3ee4f3ad546dabb803778","src/common/mod.rs":"dd29d3abd51cd1bdd84f35b39e665d6d3f87d98627f14a361e8e72db41152aeb","src/common/wgsl.rs":"e6795e107deeed10a97db38d74874138a75be7b8df69526a3b04b2d71d29663d","src/compact/expressions.rs":"7e3987aeb7c99eafb9904cbc46149ab08762522dc3c04f2295cae4c815a11547","src/compact/functions.rs":"9618539e9d3641d85c11573447d9773e7376cad23b1fd868ed5565b5eb93e05f","src/compact/handle_set_map.rs":"c190919a19f1f6b8d064459114937fdd1eaeb057963e4eab8f05a5219759cf34","src/compact/mod.rs":"099158376c7cbe86740a846fa62ed8beb78ba664fadd4fd141413670a4b910cd","src/compact/statements.rs":"9d877ff561e2d5d45fef9a8f5e0147ad55bcbaca73898949b689b41e683fdb60","src/compact/types.rs":"d5b3491cf87d7a500d5ea2dba66c000fd7e6f67b75c901105ad64c1161f7823f","src/diagnostic_filter.rs":"7478de8ed51cca0ef57e29c8a0f981f2876f8ae6805bd244fc3846efea9cb3cc","src/error.rs":"3157d57126886c9db0d3c5871a569eaf0b79d8f27292808300fe4f3e50732b1d","src/front/atomic_upgrade.rs":"86ce9f9628d92a1a09802cb534bb4310236b83f2799c921b81c687f009c589be","src/front/glsl/ast.rs":"c4e283a3f2c37b0ef68338644c978eefda2a7b993aceae2ef36bc28c2bb99dce","src/front/glsl/builtins.rs":"e394efbd0a70e11592468dc79fcc8402871229e522fa582f190f9ae9e5c48853","src/front/glsl/context.rs":"11a7c1013d223db3ce5caff29ce538731b0a04f1fc27a8e85d850c778de1de82","src/front/glsl/error.rs":"18536d8aa9ce9379309abb371876de061eef0efb18c31476bba4b061b8892848","src/front/glsl/functions.rs":"9ff43889f04921b16b248d1d3db387041f1ae56cfdaa8c9be1013914fc9eb580","src/front/glsl/lex.rs":"24706628b600b5ce435cef464c84196ac5d58013122a97e7b59d509cc25f85a2","src/front/glsl/mod.rs":"f4f1cce6911935b305c415afe3c15f84c7824a3bb828a5d15e6f9ae4b0316df0","src/front/glsl/offset.rs":"7e7d29e5f6c4ea65c13ad07f2f20bc3a1ff305276dd3cfad8e4fbe60dd2a4acb","src/front/glsl/parser.rs":"6a13b4737f53b09d5bbc0add01f8fc1b2633b7957f0318374edfe0b903939912","src/front/glsl/parser/declarations.rs":"9949649fba43636d03eaf7f7560d3bb3743b19c7204fb95859283ee84b5dd239","src/front/glsl/parser/expressions.rs":"e056fbdde3bc7c8473acbd485aecd14120d3dbefbabd813ddbc5cfedaf605889","src/front/glsl/parser/functions.rs":"302e24e06190aff555131c33f9a80b15df6a0390d6c776f888a44d5ef7df697e","src/front/glsl/parser/types.rs":"69297706c27b556c61974ea58029ebe1e6db01d8d9f4803d4ac1d9832e5fe584","src/front/glsl/parser_tests.rs":"6834f0d595f4077266054e5da43e4f1b60e5c6780611ab0f530d9964cc62fad3","src/front/glsl/token.rs":"83780c0c1954ef216896c9d8a48e412b357783e00ccd4909a7a249935c742629","src/front/glsl/types.rs":"24e08a8c64373cf301c12c5968107f1c83517ea7bf29a43d49ace30bc20aba6d","src/front/glsl/variables.rs":"66cb49fccf53e9f91301e72f6365d80e3f083a7ed109c2e55730f12a92fa6d73","src/front/interpolator.rs":"9b6ca498d5fbd9bc1515510a04e303a00b324121d7285da3c955cfe18eb4224c","src/front/mod.rs":"e78e91bf1f17409c5e25fd360415e999bb69b159750d2c1673a3db9973f586e0","src/front/spv/convert.rs":"16b8281fc1ae75dc62a02893db2c5b6d8994166e78b3b6b8cac7a01e0da4eae2","src/front/spv/error.rs":"8e09837ab8f03898cbdacda52ff66830bb948a9684b3264a7e9546119c5adb42","src/front/spv/function.rs":"6da0d7dec521039a3c81669ff171c7f15673bb3e93402f2a0f1c8e6f92d7f004","src/front/spv/image.rs":"f920749cb923416e6079297fa54efe68267c00093d990a59cc907edbbbfcdbad","src/front/spv/mod.rs":"95d2212c5098d5e3d78e882a1ce36c43e88fb6aae2a9a4bc01e8c4f0874fdff3","src/front/spv/null.rs":"ee20287365e025e8bcc91f29df930ff8b63cb6d7f26db0b1789d54de614a7353","src/front/type_gen.rs":"4dfaeefc671b8b5a882d3dcbb1b32895eaa5b05ecd9380f30e652164b0aac58c","src/front/wgsl/error.rs":"6f61c8e7d7cee868b131e0eaf2d2c035904555f59286a2a42a21e929dd0bf173","src/front/wgsl/index.rs":"0feb3e21921a8f68ffc3418610dd9b7b6eb6c4e9b45045f2498b4f2f77674283","src/front/wgsl/lower/construction.rs":"ab368fedfb724867a4c4dcd299f6a1e3ac40b81e34bdfea100367cce72d1d1c4","src/front/wgsl/lower/conversion.rs":"63b53a497dcc2649083213d7082503a128a5612297b92ca9ab7579e41c3f34be","src/front/wgsl/lower/mod.rs":"6b24c1c920f82110b3f0c172d46e1bf4c0a12477a6d0a680bebfdba6b2fcb2e4","src/front/wgsl/mod.rs":"73c27e64f9fa3314a61764b581e7395743e802738f78d158d488900bacd6a32a","src/front/wgsl/parse/ast.rs":"e029f193ff551c670a5143c795e7678215529441cbf81c7aefc13d08dec9feb8","src/front/wgsl/parse/conv.rs":"95942e5b0423943bb88903d2eb69ce21debd4bae7b1ff12ac317b8ca4e98c7d1","src/front/wgsl/parse/directive.rs":"f371a1222196f678b6c266352fd2a3298f5a0b7bb6c22895db1e19eb755761e0","src/front/wgsl/parse/directive/enable_extension.rs":"f92356be89f8418320ab627f1270192f17644ddf8837d478757387e0ef29f01d","src/front/wgsl/parse/directive/language_extension.rs":"b769f340f4f89410734d0d0fa3bc8530eb10ddb05bbd175da7bf61b062334cc0","src/front/wgsl/parse/lexer.rs":"2e857f2f40d52df2a08fbb8368f6eb925b239dfb8e17ccf19fd8dda3536ed209","src/front/wgsl/parse/mod.rs":"2c88b099b9a9d43ec6eb4a09ceb3ae5ec3196bdfe4a7ba3797d793ffe046d5c9","src/front/wgsl/parse/number.rs":"05f2e73fa12810b195e4eb1cb4f4ef83d254380c68248b3a2dd5581eb20c7aeb","src/front/wgsl/tests.rs":"2d572786959ed879b3f5120708fdf80970ba0712fdf86caa732376915112a7da","src/front/wgsl/to_wgsl.rs":"ed5b11c7ecfe787ea5c37f0dd853ea3243707ecdcbb03a907fbe0fa4a3a27907","src/keywords/mod.rs":"47a6fde012bf7d1e70f0fac7762f6a8e7dca6b9bbb99e2cada773c61527cfbfe","src/keywords/wgsl.rs":"c648ac44241ad55c8c8bad3d8f1bab973d11ddb9c380dcca369b735ed3975309","src/lib.rs":"aa46c85635d904e990f2a325b53aa00359de4013e821d369d583b6e9d9518011","src/non_max_u32.rs":"01c87cc4244da9585e7ea404d3916aaa0005ae5d9d16ca9f33f33ef525c7a7df","src/proc/constant_evaluator.rs":"455b9f091a8bfc5ed3192d1f12d937dcbfacdaae56438fd36578985a8200d0b2","src/proc/emitter.rs":"39ac886c651e2ad33c06a676a7e4826a0e93de0af660c01e8e4b1f7406742f88","src/proc/index.rs":"6214182b9484078d46fa066265d4554d3dc40d646295c2623d9888240ea1d45e","src/proc/layouter.rs":"bf50fed8cf4b15400218fa1cf897f04925795939b09c9ce658eb8bc7559a5705","src/proc/mod.rs":"de0d75194bc349a4ff5a9b99bc33102cb09c9e93505389b3d235b7602c1d0bd6","src/proc/namer.rs":"abcad4c4f63e2316f528c5aa9957e0371b0df078dfecc6dd1db18506fe0cbca7","src/proc/terminator.rs":"66b0082dce3b29d6d20e9a891c66524d756c8e567ac844d61355248ac4623b07","src/proc/type_methods.rs":"1aba860b3beaa81c0ba2c99a39761e4c85ef68f4e921978442c8cd96ff61d6d1","src/proc/typifier.rs":"2e54c6fbe1b9afdd4875555d04905460ab6932d712c1a977c4cb4c5c7a2f43cb","src/span.rs":"e4ebe5d7bc6b03c158881ae0bf90ed398777fd904fb9c1f9774821fbd43fa1f1","src/valid/analyzer.rs":"d7683f470f50546bdc5e29e9a64b67dbdc3121bda79a97532c8e30bfe5b8804a","src/valid/compose.rs":"f27a6bc13180fcd1ecbbab698faab5e25ecf0115676fda6f367fb3e8fb72a6b0","src/valid/expression.rs":"4d73813a5d829733434a5d33e1ac4e7df4f23b2cc2af216b195e61382e6389a3","src/valid/function.rs":"eb847de29dc39513a1a685ecf7e88304911e0b886024ba9716132e01d217e9a7","src/valid/handles.rs":"864ed0fe0b158119c8beaf5abe864bf3093960c75639dbeae1ce3a9739262d78","src/valid/interface.rs":"331a20e8a313f5b1f65537c27a0c89457511e05d3d932119d61d4e11fc442f74","src/valid/mod.rs":"5a79165fff6eb0b5525edd8a66e6d0c43c973ff8c4a2bb6890adae83c00b218e","src/valid/type.rs":"9c62a650d2b71c71a4134c2734d5b5f97b225624b332dd1460e3b35768fd046a"},"package":null} \ No newline at end of file diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml index 8e9c9abc359f..364340b50124 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.76" +rust-version = "1.82.0" name = "naga" version = "24.0.0" authors = ["gfx-rs developers"] @@ -104,7 +104,7 @@ version = "0.8" default-features = false [dependencies.bitflags] -version = "2.7" +version = "2.9" [dependencies.codespan-reporting] version = "0.11.0" @@ -211,3 +211,8 @@ version = "2" [build-dependencies.cfg_aliases] version = "0.2.1" + +[lints.clippy] +alloc_instead_of_core = "warn" +std_instead_of_alloc = "warn" +std_instead_of_core = "warn" diff --git a/third_party/rust/naga/README.md b/third_party/rust/naga/README.md index b5e98bb7273c..254ec4f8265e 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.76+-blue.svg) +![MSRV](https://img.shields.io/badge/rustc-1.82-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/arena/handle.rs b/third_party/rust/naga/src/arena/handle.rs index d486d6e054c4..5c67383c1d3e 100644 --- a/third_party/rust/naga/src/arena/handle.rs +++ b/third_party/rust/naga/src/arena/handle.rs @@ -5,7 +5,7 @@ //! [`Arena`]: super::Arena //! [`UniqueArena`]: super::UniqueArena -use std::{cmp::Ordering, fmt, hash, marker::PhantomData}; +use core::{cmp::Ordering, fmt, hash, marker::PhantomData}; /// An unique index in the arena array that a handle points to. /// The "non-max" part ensures that an `Option>` has @@ -22,7 +22,7 @@ pub struct BadHandle { impl BadHandle { pub fn new(handle: Handle) -> Self { Self { - kind: std::any::type_name::(), + kind: core::any::type_name::(), index: handle.index(), } } diff --git a/third_party/rust/naga/src/arena/handle_set.rs b/third_party/rust/naga/src/arena/handle_set.rs index f2ce058d12fc..239dc429346f 100644 --- a/third_party/rust/naga/src/arena/handle_set.rs +++ b/third_party/rust/naga/src/arena/handle_set.rs @@ -12,7 +12,7 @@ pub struct HandleSet { members: bit_set::BitSet, /// This type is indexed by values of type `T`. - as_keys: std::marker::PhantomData, + as_keys: core::marker::PhantomData, } impl HandleSet { @@ -21,7 +21,7 @@ impl HandleSet { Self { len: 0, members: bit_set::BitSet::new(), - as_keys: std::marker::PhantomData, + as_keys: core::marker::PhantomData, } } @@ -35,7 +35,7 @@ impl HandleSet { Self { len, members: bit_set::BitSet::with_capacity(len), - as_keys: std::marker::PhantomData, + as_keys: core::marker::PhantomData, } } @@ -103,7 +103,7 @@ impl ArenaType for Arena { } } -impl ArenaType for UniqueArena { +impl ArenaType for UniqueArena { fn len(&self) -> usize { self.len() } diff --git a/third_party/rust/naga/src/arena/handlevec.rs b/third_party/rust/naga/src/arena/handlevec.rs index 2ddb65c9a460..ba3b3c0aa891 100644 --- a/third_party/rust/naga/src/arena/handlevec.rs +++ b/third_party/rust/naga/src/arena/handlevec.rs @@ -1,9 +1,10 @@ //! The [`HandleVec`] type and associated definitions. use super::handle::Handle; +use alloc::{vec, vec::Vec}; -use std::marker::PhantomData; -use std::ops; +use core::marker::PhantomData; +use core::ops; /// A [`Vec`] indexed by [`Handle`]s. /// @@ -17,7 +18,7 @@ use std::ops; /// current length; otherwise, the insertion will panic. /// /// [`insert`]: HandleVec::insert -/// [`HashMap::insert`]: std::collections::HashMap::insert +/// [`HashMap::insert`]: hashbrown::HashMap::insert #[derive(Debug)] pub(crate) struct HandleVec { inner: Vec, @@ -59,7 +60,7 @@ impl HandleVec { /// the end, like [`Vec::push`]. So the index of `handle` must equal /// [`self.len()`]. /// - /// [`HashMap`]: std::collections::HashMap + /// [`HashMap`]: hashbrown::HashMap /// [`self.len()`]: HandleVec::len pub(crate) fn insert(&mut self, handle: Handle, value: U) { assert_eq!(handle.index(), self.inner.len()); diff --git a/third_party/rust/naga/src/arena/mod.rs b/third_party/rust/naga/src/arena/mod.rs index 014c5167c695..fa78332cf7b4 100644 --- a/third_party/rust/naga/src/arena/mod.rs +++ b/third_party/rust/naga/src/arena/mod.rs @@ -31,12 +31,13 @@ pub(crate) use handlevec::HandleVec; pub use range::{BadRangeError, Range}; pub use unique_arena::UniqueArena; +use alloc::vec::Vec; +use core::{fmt, ops}; + use crate::Span; use handle::Index; -use std::{fmt, ops}; - /// An arena holding some kind of component (e.g., type, constant, /// instruction, etc.) that can be referenced. /// @@ -103,7 +104,7 @@ impl Arena { /// Drains the arena, returning an iterator over the items stored. pub fn drain(&mut self) -> impl DoubleEndedIterator, T, Span)> { - let arena = std::mem::take(self); + let arena = core::mem::take(self); arena .data .into_iter() @@ -258,7 +259,7 @@ where D: serde::Deserializer<'de>, { let data = Vec::deserialize(deserializer)?; - let span_info = std::iter::repeat(Span::default()) + let span_info = core::iter::repeat(Span::default()) .take(data.len()) .collect(); diff --git a/third_party/rust/naga/src/arena/range.rs b/third_party/rust/naga/src/arena/range.rs index b448f83c8c6f..b2bf143bfebd 100644 --- a/third_party/rust/naga/src/arena/range.rs +++ b/third_party/rust/naga/src/arena/range.rs @@ -5,13 +5,13 @@ //! //! [`Arena`]: super::Arena +use core::{fmt, marker::PhantomData, ops}; + use super::{ handle::{Handle, Index}, Arena, }; -use std::{fmt, marker::PhantomData, ops}; - /// A strongly typed range of handles. #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] @@ -51,7 +51,7 @@ pub struct BadRangeError { impl BadRangeError { pub fn new(range: Range) -> Self { Self { - kind: std::any::type_name::(), + kind: core::any::type_name::(), range: range.erase_type(), } } diff --git a/third_party/rust/naga/src/arena/unique_arena.rs b/third_party/rust/naga/src/arena/unique_arena.rs index 9f5e26df1110..cdf2426801f4 100644 --- a/third_party/rust/naga/src/arena/unique_arena.rs +++ b/third_party/rust/naga/src/arena/unique_arena.rs @@ -1,10 +1,10 @@ //! The [`UniqueArena`] type and supporting definitions. -use crate::{FastIndexSet, Span}; +use alloc::vec::Vec; +use core::{fmt, hash, ops}; use super::handle::{BadHandle, Handle, Index}; - -use std::{fmt, hash, ops}; +use crate::{FastIndexSet, Span}; /// An arena whose elements are guaranteed to be unique. /// @@ -84,7 +84,7 @@ impl UniqueArena { #[cfg(feature = "compact")] pub struct UniqueArenaDrain<'a, T> { inner_elts: indexmap::set::Drain<'a, T>, - inner_spans: std::vec::Drain<'a, Span>, + inner_spans: alloc::vec::Drain<'a, Span>, index: Index, } @@ -224,7 +224,9 @@ where D: serde::Deserializer<'de>, { let set = FastIndexSet::deserialize(deserializer)?; - let span_info = std::iter::repeat(Span::default()).take(set.len()).collect(); + let span_info = core::iter::repeat(Span::default()) + .take(set.len()) + .collect(); Ok(Self { set, span_info }) } diff --git a/third_party/rust/naga/src/back/continue_forward.rs b/third_party/rust/naga/src/back/continue_forward.rs index b880c175733b..41e35b81fa73 100644 --- a/third_party/rust/naga/src/back/continue_forward.rs +++ b/third_party/rust/naga/src/back/continue_forward.rs @@ -59,8 +59,9 @@ //! [`Switch`]: crate::Statement::Switch //! [`SwitchCase`]: crate::SwitchCase +use alloc::{rc::Rc, string::String, vec::Vec}; + use crate::proc::Namer; -use std::rc::Rc; /// A summary of the code surrounding a statement. enum Nesting { diff --git a/third_party/rust/naga/src/back/dot/mod.rs b/third_party/rust/naga/src/back/dot/mod.rs index 67b1b9dc92e6..dd8246f90d1a 100644 --- a/third_party/rust/naga/src/back/dot/mod.rs +++ b/third_party/rust/naga/src/back/dot/mod.rs @@ -7,16 +7,19 @@ of IR inspection and debugging. [dot]: https://graphviz.org/doc/info/lang.html */ +use alloc::{ + borrow::Cow, + format, + string::{String, ToString}, + vec::Vec, +}; +use core::fmt::{Error as FmtError, Write as _}; + use crate::{ arena::Handle, valid::{FunctionInfo, ModuleInfo}, }; -use std::{ - borrow::Cow, - fmt::{Error as FmtError, Write as _}, -}; - /// Configuration options for the dot backend #[derive(Clone, Default)] pub struct Options { @@ -412,26 +415,26 @@ const COLORS: &[&str] = &[ struct Prefixed(Handle); -impl std::fmt::Display for Prefixed { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for Prefixed { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "e") } } -impl std::fmt::Display for Prefixed { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for Prefixed { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "l") } } -impl std::fmt::Display for Prefixed { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for Prefixed { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "g") } } -impl std::fmt::Display for Prefixed { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for Prefixed { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "f") } } @@ -724,6 +727,11 @@ fn write_function_expressions( } E::SubgroupBallotResult => ("SubgroupBallotResult".into(), 4), E::SubgroupOperationResult { .. } => ("SubgroupOperationResult".into(), 4), + E::RayQueryVertexPositions { query, committed } => { + edges.insert("", query); + let ty = if committed { "Committed" } else { "Candidate" }; + (format!("get{}HitVertexPositions", ty).into(), 4) + } }; // give uniform expressions an outline @@ -793,7 +801,7 @@ pub fn write( mod_info: Option<&ModuleInfo>, options: Options, ) -> Result { - use std::fmt::Write as _; + use core::fmt::Write as _; let mut output = String::new(); output += "digraph Module {\n"; diff --git a/third_party/rust/naga/src/back/glsl/features.rs b/third_party/rust/naga/src/back/glsl/features.rs index bef54bd4f800..eded4b688fcb 100644 --- a/third_party/rust/naga/src/back/glsl/features.rs +++ b/third_party/rust/naga/src/back/glsl/features.rs @@ -1,10 +1,11 @@ +use core::fmt::Write; + use super::{BackendResult, Error, Version, Writer}; use crate::{ back::glsl::{Options, WriterFlags}, AddressSpace, Binding, Expression, Handle, ImageClass, ImageDimension, Interpolation, SampleLevel, Sampling, Scalar, ScalarKind, ShaderStage, StorageFormat, Type, TypeInner, }; -use std::fmt::Write; bitflags::bitflags! { /// Structure used to encode additions to GLSL that aren't supported by all versions. @@ -462,7 +463,7 @@ impl Writer<'_, W> { .functions .iter() .map(|(h, f)| (&f.expressions, &info[h])) - .chain(std::iter::once(( + .chain(core::iter::once(( &entry_point.function.expressions, info.get_entry_point(entry_point_idx as usize), ))) @@ -559,7 +560,7 @@ impl Writer<'_, W> { .functions .iter() .map(|(_, f)| &f.body) - .chain(std::iter::once(&entry_point.function.body)) + .chain(core::iter::once(&entry_point.function.body)) { for (stmt, _) in blocks.span_iter() { match *stmt { diff --git a/third_party/rust/naga/src/back/glsl/mod.rs b/third_party/rust/naga/src/back/glsl/mod.rs index 3458ca156113..4c672c11b72a 100644 --- a/third_party/rust/naga/src/back/glsl/mod.rs +++ b/third_party/rust/naga/src/back/glsl/mod.rs @@ -45,20 +45,30 @@ to output a [`Module`](crate::Module) into glsl pub use features::Features; -use crate::{ - back::{self, Baked}, - proc::{self, ExpressionKindTracker, NameKey}, - valid, Handle, ShaderStage, TypeInner, +use alloc::{ + borrow::ToOwned, + format, + string::{String, ToString}, + vec, + vec::Vec, }; -use features::FeaturesManager; -use hashbrown::hash_map; -use std::{ +use core::{ cmp::Ordering, fmt::{self, Error as FmtError, Write}, mem, }; + +use hashbrown::hash_map; use thiserror::Error; +use crate::{ + back::{self, Baked}, + common, + proc::{self, ExpressionKindTracker, NameKey}, + valid, Handle, ShaderStage, TypeInner, +}; +use features::FeaturesManager; + /// Contains the features related code and the features querying method mod features; /// Contains a constant with a slice of all the reserved keywords RESERVED_KEYWORDS @@ -102,7 +112,7 @@ where } /// Mapping between resources and bindings. -pub type BindingMap = std::collections::BTreeMap; +pub type BindingMap = alloc::collections::BTreeMap; impl crate::AtomicFunction { const fn to_glsl(self) -> &'static str { @@ -320,7 +330,7 @@ pub struct PipelineOptions { /// If no entry point that matches is found while creating a [`Writer`], a error will be thrown. pub entry_point: String, /// How many views to render to, if doing multiview rendering. - pub multiview: Option, + pub multiview: Option, } #[derive(Debug)] @@ -582,7 +592,7 @@ pub struct Writer<'a, W> { /// transformed to `do {} while(false);` loops. continue_ctx: back::continue_forward::ContinueCtx, /// How many views to render to, if doing multiview rendering. - multiview: Option, + multiview: Option, /// Mapping of varying variables to their location. Needed for reflections. varying: crate::FastHashMap, } @@ -1073,8 +1083,8 @@ impl<'a, W: Write> Writer<'a, W> { | TypeInner::Struct { .. } | TypeInner::Image { .. } | TypeInner::Sampler { .. } - | TypeInner::AccelerationStructure - | TypeInner::RayQuery + | TypeInner::AccelerationStructure { .. } + | TypeInner::RayQuery { .. } | TypeInner::BindingArray { .. } => { return Err(Error::Custom(format!("Unable to write type {inner:?}"))) } @@ -2203,8 +2213,7 @@ impl<'a, W: Write> Writer<'a, W> { self.write_stmt(sta, ctx, l2.next())?; } - if !case.fall_through - && case.body.last().map_or(true, |s| !s.is_terminator()) + if !case.fall_through && case.body.last().is_none_or(|s| !s.is_terminator()) { writeln!(self.out, "{}break;", l2.next())?; } @@ -3438,7 +3447,7 @@ impl<'a, W: Write> Writer<'a, W> { TypeInner::Vector { size, .. } => write!( self.out, ", vec{}(0.0), vec{0}(1.0)", - back::vector_size_str(size) + common::vector_size_str(size) )?, _ => write!(self.out, ", 0.0, 1.0")?, } @@ -3585,7 +3594,7 @@ impl<'a, W: Write> Writer<'a, W> { Mf::CountTrailingZeros => { match *ctx.resolve_type(arg, &self.module.types) { TypeInner::Vector { size, scalar, .. } => { - let s = back::vector_size_str(size); + let s = common::vector_size_str(size); if let crate::ScalarKind::Uint = scalar.kind { write!(self.out, "min(uvec{s}(findLSB(")?; self.write_expr(arg, ctx)?; @@ -3615,7 +3624,7 @@ impl<'a, W: Write> Writer<'a, W> { if self.options.version.supports_integer_functions() { match *ctx.resolve_type(arg, &self.module.types) { TypeInner::Vector { size, scalar } => { - let s = back::vector_size_str(size); + let s = common::vector_size_str(size); if let crate::ScalarKind::Uint = scalar.kind { write!(self.out, "uvec{s}(ivec{s}(31) - findMSB(")?; @@ -3646,7 +3655,7 @@ impl<'a, W: Write> Writer<'a, W> { } else { match *ctx.resolve_type(arg, &self.module.types) { TypeInner::Vector { size, scalar } => { - let s = back::vector_size_str(size); + let s = common::vector_size_str(size); if let crate::ScalarKind::Uint = scalar.kind { write!(self.out, "uvec{s}(")?; @@ -4009,7 +4018,8 @@ impl<'a, W: Write> Writer<'a, W> { write!(self.out, ".length())")? } // not supported yet - Expression::RayQueryGetIntersection { .. } => unreachable!(), + Expression::RayQueryGetIntersection { .. } + | Expression::RayQueryVertexPositions { .. } => unreachable!(), } Ok(()) @@ -4629,6 +4639,9 @@ impl<'a, W: Write> Writer<'a, W> { if flags.contains(crate::Barrier::SUB_GROUP) { writeln!(self.out, "{level}subgroupMemoryBarrier();")?; } + if flags.contains(crate::Barrier::TEXTURE) { + writeln!(self.out, "{level}memoryBarrierImage();")?; + } writeln!(self.out, "{level}barrier();")?; Ok(()) } diff --git a/third_party/rust/naga/src/back/hlsl/conv.rs b/third_party/rust/naga/src/back/hlsl/conv.rs index a4c6c1941d14..6553745ac2d6 100644 --- a/third_party/rust/naga/src/back/hlsl/conv.rs +++ b/third_party/rust/naga/src/back/hlsl/conv.rs @@ -1,8 +1,9 @@ -use std::borrow::Cow; +use crate::common; -use crate::proc::Alignment; +use alloc::{borrow::Cow, format, string::String}; use super::Error; +use crate::proc::Alignment; impl crate::ScalarKind { pub(super) fn to_hlsl_cast(self) -> &'static str { @@ -89,7 +90,7 @@ impl crate::TypeInner { crate::TypeInner::Vector { size, scalar } => Cow::Owned(format!( "{}{}", scalar.to_hlsl_str()?, - crate::back::vector_size_str(size) + common::vector_size_str(size) )), crate::TypeInner::Matrix { columns, @@ -98,8 +99,8 @@ impl crate::TypeInner { } => Cow::Owned(format!( "{}{}x{}", scalar.to_hlsl_str()?, - crate::back::vector_size_str(columns), - crate::back::vector_size_str(rows), + common::vector_size_str(columns), + common::vector_size_str(rows), )), crate::TypeInner::Array { base, diff --git a/third_party/rust/naga/src/back/hlsl/help.rs b/third_party/rust/naga/src/back/hlsl/help.rs index 6a69f84b2d9c..f0bfcfc5740c 100644 --- a/third_party/rust/naga/src/back/hlsl/help.rs +++ b/third_party/rust/naga/src/back/hlsl/help.rs @@ -26,16 +26,18 @@ int dim_1d = NagaDimensions1D(image_1d); ``` */ +use alloc::format; +use core::fmt::Write; + use super::{ super::FunctionCtx, writer::{ ABS_FUNCTION, DIV_FUNCTION, EXTRACT_BITS_FUNCTION, INSERT_BITS_FUNCTION, MOD_FUNCTION, NEG_FUNCTION, }, - BackendResult, + BackendResult, WrappedType, }; use crate::{arena::Handle, proc::NameKey, ScalarKind}; -use std::fmt::Write; #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] pub(super) struct WrappedArrayLength { @@ -937,7 +939,7 @@ impl super::Writer<'_, W> { match module.types[ty].inner { crate::TypeInner::Struct { .. } | crate::TypeInner::Array { .. } => { let constructor = WrappedConstructor { ty }; - if self.wrapped.constructors.insert(constructor) { + if self.wrapped.insert(WrappedType::Constructor(constructor)) { self.write_wrapped_constructor_function(module, constructor)?; } } @@ -953,7 +955,7 @@ impl super::Writer<'_, W> { } => { if format.single_component() { let scalar: crate::Scalar = format.into(); - if self.wrapped.image_load_scalars.insert(scalar) { + if self.wrapped.insert(WrappedType::ImageLoadScalar(scalar)) { self.write_loaded_scalar_to_storage_loaded_value(scalar)?; } } @@ -989,7 +991,7 @@ impl super::Writer<'_, W> { for (handle, _) in expressions.iter() { if let crate::Expression::ZeroValue(ty) = expressions[handle] { let zero_value = WrappedZeroValue { ty }; - if self.wrapped.zero_values.insert(zero_value) { + if self.wrapped.insert(WrappedType::ZeroValue(zero_value)) { self.write_wrapped_zero_value_function(module, zero_value)?; } } @@ -1036,7 +1038,7 @@ impl super::Writer<'_, W> { components, }; - if !self.wrapped.math.insert(wrapped) { + if !self.wrapped.insert(WrappedType::Math(wrapped)) { continue; } @@ -1078,7 +1080,7 @@ impl super::Writer<'_, W> { components, }; - if !self.wrapped.math.insert(wrapped) { + if !self.wrapped.insert(WrappedType::Math(wrapped)) { continue; } @@ -1147,7 +1149,7 @@ impl super::Writer<'_, W> { components, }; - if !self.wrapped.math.insert(wrapped) { + if !self.wrapped.insert(WrappedType::Math(wrapped)) { continue; } @@ -1198,7 +1200,7 @@ impl super::Writer<'_, W> { // find another solution for different bit-widths. match (op, scalar) { (crate::UnaryOperator::Negate, crate::Scalar::I32) => { - if !self.wrapped.unary_op.insert(wrapped) { + if !self.wrapped.insert(WrappedType::UnaryOp(wrapped)) { continue; } @@ -1259,7 +1261,7 @@ impl super::Writer<'_, W> { left_ty: left_wrapped_ty, right_ty: right_wrapped_ty, }; - if !self.wrapped.binary_op.insert(wrapped) { + if !self.wrapped.insert(WrappedType::BinaryOp(wrapped)) { continue; } @@ -1315,7 +1317,7 @@ impl super::Writer<'_, W> { left_ty: left_wrapped_ty, right_ty: right_wrapped_ty, }; - if !self.wrapped.binary_op.insert(wrapped) { + if !self.wrapped.insert(WrappedType::BinaryOp(wrapped)) { continue; } @@ -1391,7 +1393,7 @@ impl super::Writer<'_, W> { writable: storage_access.contains(crate::StorageAccess::STORE), }; - if self.wrapped.array_lengths.insert(wal) { + if self.wrapped.insert(WrappedType::ArrayLength(wal)) { self.write_wrapped_array_length_function(wal)?; } } @@ -1410,7 +1412,7 @@ impl super::Writer<'_, W> { _ => unreachable!("we only query images"), }; - if self.wrapped.image_queries.insert(wiq) { + if self.wrapped.insert(WrappedType::ImageQuery(wiq)) { self.write_wrapped_image_query_function(module, wiq, handle, func_ctx)?; } } @@ -1439,7 +1441,7 @@ impl super::Writer<'_, W> { } let constructor = WrappedConstructor { ty }; - if writer.wrapped.constructors.insert(constructor) { + if writer.wrapped.insert(WrappedType::Constructor(constructor)) { writer .write_wrapped_constructor_function(module, constructor)?; } @@ -1448,7 +1450,7 @@ impl super::Writer<'_, W> { write_wrapped_constructor(writer, base, module)?; let constructor = WrappedConstructor { ty }; - if writer.wrapped.constructors.insert(constructor) { + if writer.wrapped.insert(WrappedType::Constructor(constructor)) { writer .write_wrapped_constructor_function(module, constructor)?; } @@ -1484,7 +1486,7 @@ impl super::Writer<'_, W> { let ty = base_ty_handle.unwrap(); let access = WrappedStructMatrixAccess { ty, index }; - if self.wrapped.struct_matrix_access.insert(access) { + if self.wrapped.insert(WrappedType::StructMatrixAccess(access)) { self.write_wrapped_struct_matrix_get_function(module, access)?; self.write_wrapped_struct_matrix_set_function(module, access)?; self.write_wrapped_struct_matrix_set_vec_function( @@ -1713,7 +1715,7 @@ impl super::Writer<'_, W> { }) = super::writer::get_inner_matrix_data(module, global.ty) { let entry = WrappedMatCx2 { columns }; - if self.wrapped.mat_cx2s.insert(entry) { + if self.wrapped.insert(WrappedType::MatCx2(entry)) { self.write_mat_cx2_typedef_and_functions(entry)?; } } @@ -1731,7 +1733,7 @@ impl super::Writer<'_, W> { }) = super::writer::get_inner_matrix_data(module, member.ty) { let entry = WrappedMatCx2 { columns }; - if self.wrapped.mat_cx2s.insert(entry) { + if self.wrapped.insert(WrappedType::MatCx2(entry)) { self.write_mat_cx2_typedef_and_functions(entry)?; } } diff --git a/third_party/rust/naga/src/back/hlsl/mod.rs b/third_party/rust/naga/src/back/hlsl/mod.rs index ceebad56a3e6..c3d292e16b1a 100644 --- a/third_party/rust/naga/src/back/hlsl/mod.rs +++ b/third_party/rust/naga/src/back/hlsl/mod.rs @@ -114,7 +114,9 @@ mod ray; mod storage; mod writer; -use std::fmt::Error as FmtError; +use alloc::{string::String, vec::Vec}; +use core::fmt::Error as FmtError; + use thiserror::Error; use crate::{back, proc}; @@ -172,7 +174,7 @@ where } // Using `BTreeMap` instead of `HashMap` so that we can hash itself. -pub type BindingMap = std::collections::BTreeMap; +pub type BindingMap = alloc::collections::BTreeMap; /// A HLSL shader model version. #[allow(non_snake_case, non_camel_case_types)] @@ -296,7 +298,7 @@ where // We use a BTreeMap here so that we can hash it. pub type SamplerIndexBufferBindingMap = - std::collections::BTreeMap; + alloc::collections::BTreeMap; #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] @@ -322,7 +324,7 @@ where Ok(map) } -pub type DynamicStorageBufferOffsetsTargets = std::collections::BTreeMap; +pub type DynamicStorageBufferOffsetsTargets = alloc::collections::BTreeMap; /// Shorthand result used internally by the backend type BackendResult = Result<(), Error>; @@ -387,9 +389,9 @@ impl Default for Options { fake_missing_bindings: true, special_constants_binding: None, sampler_heap_target: SamplerHeapBindTargets::default(), - sampler_buffer_binding_map: std::collections::BTreeMap::default(), + sampler_buffer_binding_map: alloc::collections::BTreeMap::default(), push_constants_target: None, - dynamic_storage_buffer_offsets_targets: std::collections::BTreeMap::new(), + dynamic_storage_buffer_offsets_targets: alloc::collections::BTreeMap::new(), zero_initialize_workgroup_memory: true, restrict_indexing: true, force_loop_bounding: true, @@ -442,18 +444,23 @@ pub enum Error { Override, } +#[derive(PartialEq, Eq, Hash)] +enum WrappedType { + ZeroValue(help::WrappedZeroValue), + ArrayLength(help::WrappedArrayLength), + ImageQuery(help::WrappedImageQuery), + ImageLoadScalar(crate::Scalar), + Constructor(help::WrappedConstructor), + StructMatrixAccess(help::WrappedStructMatrixAccess), + MatCx2(help::WrappedMatCx2), + Math(help::WrappedMath), + UnaryOp(help::WrappedUnaryOp), + BinaryOp(help::WrappedBinaryOp), +} + #[derive(Default)] struct Wrapped { - zero_values: crate::FastHashSet, - array_lengths: crate::FastHashSet, - image_queries: crate::FastHashSet, - image_load_scalars: crate::FastHashSet, - constructors: crate::FastHashSet, - struct_matrix_access: crate::FastHashSet, - mat_cx2s: crate::FastHashSet, - math: crate::FastHashSet, - unary_op: crate::FastHashSet, - binary_op: crate::FastHashSet, + types: crate::FastHashSet, /// If true, the sampler heaps have been written out. sampler_heaps: bool, // Mapping from SamplerIndexBufferKey to the name the namer returned. @@ -461,15 +468,12 @@ struct Wrapped { } impl Wrapped { + fn insert(&mut self, r#type: WrappedType) -> bool { + self.types.insert(r#type) + } + fn clear(&mut self) { - self.array_lengths.clear(); - self.image_queries.clear(); - self.constructors.clear(); - self.struct_matrix_access.clear(); - self.mat_cx2s.clear(); - self.math.clear(); - self.unary_op.clear(); - self.binary_op.clear(); + self.types.clear(); } } diff --git a/third_party/rust/naga/src/back/hlsl/ray.rs b/third_party/rust/naga/src/back/hlsl/ray.rs index 6f797c7eb46a..24eae4b573fd 100644 --- a/third_party/rust/naga/src/back/hlsl/ray.rs +++ b/third_party/rust/naga/src/back/hlsl/ray.rs @@ -1,6 +1,7 @@ +use core::fmt::Write; + use crate::back::hlsl::BackendResult; use crate::{RayQueryIntersection, TypeInner}; -use std::fmt::Write; impl super::Writer<'_, W> { // constructs hlsl RayDesc from wgsl RayDesc @@ -27,7 +28,12 @@ impl super::Writer<'_, W> { ) -> BackendResult { self.write_type(module, module.special_types.ray_intersection.unwrap())?; write!(self.out, " GetCommittedIntersection(")?; - self.write_value_type(module, &TypeInner::RayQuery)?; + self.write_value_type( + module, + &TypeInner::RayQuery { + vertex_return: false, + }, + )?; writeln!(self.out, " rq) {{")?; write!(self.out, " ")?; self.write_type(module, module.special_types.ray_intersection.unwrap())?; @@ -93,7 +99,12 @@ impl super::Writer<'_, W> { ) -> BackendResult { self.write_type(module, module.special_types.ray_intersection.unwrap())?; write!(self.out, " GetCandidateIntersection(")?; - self.write_value_type(module, &TypeInner::RayQuery)?; + self.write_value_type( + module, + &TypeInner::RayQuery { + vertex_return: false, + }, + )?; writeln!(self.out, " rq) {{")?; write!(self.out, " ")?; self.write_type(module, module.special_types.ray_intersection.unwrap())?; diff --git a/third_party/rust/naga/src/back/hlsl/storage.rs b/third_party/rust/naga/src/back/hlsl/storage.rs index 4576a3ace61b..9f92d866398b 100644 --- a/third_party/rust/naga/src/back/hlsl/storage.rs +++ b/third_party/rust/naga/src/back/hlsl/storage.rs @@ -55,14 +55,15 @@ correct type if necessary. [`Load` and `Store`]: https://github.com/microsoft/DirectXShaderCompiler/wiki/ByteAddressBuffer-Load-Store-Additions */ +use alloc::format; +use core::{fmt, mem}; + use super::{super::FunctionCtx, BackendResult, Error}; use crate::{ proc::{Alignment, NameKey, TypeResolution}, Handle, }; -use std::{fmt, mem}; - const STORE_TEMP_NAME: &str = "_value"; /// One step in accessing a [`Storage`] global's component or element. diff --git a/third_party/rust/naga/src/back/hlsl/writer.rs b/third_party/rust/naga/src/back/hlsl/writer.rs index 96e237013066..02b8e9aaf3ed 100644 --- a/third_party/rust/naga/src/back/hlsl/writer.rs +++ b/third_party/rust/naga/src/back/hlsl/writer.rs @@ -1,3 +1,10 @@ +use alloc::{ + format, + string::{String, ToString}, + vec::Vec, +}; +use core::{fmt, mem}; + use super::{ help, help::{ @@ -9,10 +16,10 @@ use super::{ }; use crate::{ back::{self, Baked}, + common, proc::{self, index, ExpressionKindTracker, NameKey}, valid, Handle, Module, RayQueryFunction, Scalar, ScalarKind, ShaderStage, TypeInner, }; -use std::{fmt, mem}; const LOCATION_SEMANTIC: &str = "LOC"; const SPECIAL_CBUF_TYPE: &str = "NagaConstants"; @@ -1315,7 +1322,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { self.out, "{}{}", scalar.to_hlsl_str()?, - back::vector_size_str(size) + common::vector_size_str(size) )?; } TypeInner::Matrix { @@ -1331,8 +1338,8 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { self.out, "{}{}x{}", scalar.to_hlsl_str()?, - back::vector_size_str(columns), - back::vector_size_str(rows), + common::vector_size_str(columns), + common::vector_size_str(rows), )?; } TypeInner::Image { @@ -1356,10 +1363,10 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { TypeInner::Array { base, size, .. } | TypeInner::BindingArray { base, size } => { self.write_array_size(module, base, size)?; } - TypeInner::AccelerationStructure => { + TypeInner::AccelerationStructure { .. } => { write!(self.out, "RaytracingAccelerationStructure")?; } - TypeInner::RayQuery => { + TypeInner::RayQuery { .. } => { // these are constant flags, there are dynamic flags also but constant flags are not supported by naga write!(self.out, "RayQuery")?; } @@ -1534,7 +1541,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { match module.types[local.ty].inner { // from https://microsoft.github.io/DirectX-Specs/d3d/Raytracing.html#tracerayinline-example-1 it seems that ray queries shouldn't be zeroed - TypeInner::RayQuery => {} + TypeInner::RayQuery { .. } => {} _ => { write!(self.out, " = ")?; // Write the local initializer if needed @@ -1715,14 +1722,14 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } let last_case = &cases[end_case_idx]; - if last_case.body.last().map_or(true, |s| !s.is_terminator()) { + if last_case.body.last().is_none_or(|s| !s.is_terminator()) { writeln!(self.out, "{indent_level_2}break;")?; } } else { for sta in case.body.iter() { self.write_stmt(module, sta, func_ctx, indent_level_2)?; } - if !case.fall_through && case.body.last().map_or(true, |s| !s.is_terminator()) { + if !case.fall_through && case.body.last().is_none_or(|s| !s.is_terminator()) { writeln!(self.out, "{indent_level_2}break;")?; } } @@ -3334,7 +3341,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { self.out, "{}{}(", scalar.to_hlsl_str()?, - back::vector_size_str(size) + common::vector_size_str(size) )?; } TypeInner::Scalar(_) => { @@ -3345,8 +3352,8 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { self.out, "{}{}x{}(", scalar.to_hlsl_str()?, - back::vector_size_str(columns), - back::vector_size_str(rows) + common::vector_size_str(columns), + common::vector_size_str(rows) )?; } _ => { @@ -3947,6 +3954,8 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, ")")?; } } + // Not supported yet + Expression::RayQueryVertexPositions { .. } => unreachable!(), // Nothing to do here, since call expression already cached Expression::CallResult(_) | Expression::AtomicResult { .. } @@ -4130,6 +4139,9 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { if barrier.contains(crate::Barrier::SUB_GROUP) { // Does not exist in DirectX } + if barrier.contains(crate::Barrier::TEXTURE) { + writeln!(self.out, "{level}DeviceMemoryBarrierWithGroupSync();")?; + } Ok(()) } } diff --git a/third_party/rust/naga/src/back/mod.rs b/third_party/rust/naga/src/back/mod.rs index 7e6ca85d49f4..0f293ba925db 100644 --- a/third_party/rust/naga/src/back/mod.rs +++ b/third_party/rust/naga/src/back/mod.rs @@ -3,6 +3,8 @@ Backend functions that export shader [`Module`](super::Module)s into binary and */ #![allow(dead_code)] // can be dead if none of the enabled backends need it +use alloc::string::String; + use crate::proc::ExpressionKindTracker; #[cfg(dot_out)] @@ -35,15 +37,15 @@ pub type NeedBakeExpressions = crate::FastHashSet); -impl std::fmt::Display for Baked { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for Baked { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "_e") } } @@ -67,8 +69,8 @@ impl Level { } } -impl std::fmt::Display for Level { - fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { +impl core::fmt::Display for Level { + fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { (0..self.0).try_for_each(|_| formatter.write_str(INDENT)) } } @@ -248,22 +250,13 @@ pub const fn binary_operation_str(op: crate::BinaryOperator) -> &'static str { } } -/// Helper function that returns the string corresponding to the [`VectorSize`](crate::VectorSize) -const fn vector_size_str(size: crate::VectorSize) -> &'static str { - match size { - crate::VectorSize::Bi => "2", - crate::VectorSize::Tri => "3", - crate::VectorSize::Quad => "4", - } -} - impl crate::TypeInner { /// Returns true if this is a handle to a type rather than the type directly. pub const fn is_handle(&self) -> bool { match *self { crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure => true, + | crate::TypeInner::AccelerationStructure { .. } => true, _ => false, } } diff --git a/third_party/rust/naga/src/back/msl/mod.rs b/third_party/rust/naga/src/back/msl/mod.rs index b9e24454e94b..86dcd58eb7b4 100644 --- a/third_party/rust/naga/src/back/msl/mod.rs +++ b/third_party/rust/naga/src/back/msl/mod.rs @@ -31,8 +31,14 @@ holding the result. */ +use alloc::{ + format, + string::{String, ToString}, + vec::Vec, +}; +use core::fmt::{Error as FmtError, Write}; + use crate::{arena::Handle, proc::index, valid::ModuleInfo}; -use std::fmt::{Error as FmtError, Write}; mod keywords; pub mod sampler; @@ -85,7 +91,7 @@ where } // Using `BTreeMap` instead of `HashMap` so that we can hash itself. -pub type BindingMap = std::collections::BTreeMap; +pub type BindingMap = alloc::collections::BTreeMap; #[derive(Clone, Debug, Default, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] @@ -106,7 +112,7 @@ pub struct EntryPointResources { pub sizes_buffer: Option, } -pub type EntryPointResourceMap = std::collections::BTreeMap; +pub type EntryPointResourceMap = alloc::collections::BTreeMap; enum ResolvedBinding { BuiltIn(crate::BuiltIn), @@ -723,6 +729,5 @@ pub fn write_string( #[test] fn test_error_size() { - use std::mem::size_of; assert_eq!(size_of::(), 32); } diff --git a/third_party/rust/naga/src/back/msl/sampler.rs b/third_party/rust/naga/src/back/msl/sampler.rs index 0bf987076d2a..e075f8cc21a9 100644 --- a/third_party/rust/naga/src/back/msl/sampler.rs +++ b/third_party/rust/naga/src/back/msl/sampler.rs @@ -1,8 +1,9 @@ +use core::{num::NonZeroU32, ops::Range}; + #[cfg(feature = "deserialize")] use serde::Deserialize; #[cfg(feature = "serialize")] use serde::Serialize; -use std::{num::NonZeroU32, ops::Range}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize))] @@ -158,8 +159,8 @@ impl Eq for InlineSampler {} #[allow(renamed_and_removed_lints)] #[allow(clippy::derive_hash_xor_eq)] -impl std::hash::Hash for InlineSampler { - fn hash(&self, hasher: &mut H) { +impl core::hash::Hash for InlineSampler { + fn hash(&self, hasher: &mut H) { self.coord.hash(hasher); self.address.hash(hasher); self.border_color.hash(hasher); diff --git a/third_party/rust/naga/src/back/msl/writer.rs b/third_party/rust/naga/src/back/msl/writer.rs index bc77a7f6d0c9..bd90b96b6b6b 100644 --- a/third_party/rust/naga/src/back/msl/writer.rs +++ b/third_party/rust/naga/src/back/msl/writer.rs @@ -1,16 +1,25 @@ +use alloc::{ + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::{ + fmt::{Display, Error as FmtError, Formatter, Write}, + iter, +}; + use super::{sampler as sm, Error, LocationMode, Options, PipelineOptions, TranslationInfo}; use crate::{ arena::{Handle, HandleSet}, back::{self, Baked}, + common, proc::{self, index, ExpressionKindTracker, NameKey, TypeResolution}, valid, FastHashMap, FastHashSet, }; + #[cfg(test)] -use std::ptr; -use std::{ - fmt::{Display, Error as FmtError, Formatter, Write}, - iter, -}; +use core::ptr; /// Shorthand result used internally by the backend type BackendResult = Result<(), Error>; @@ -72,7 +81,7 @@ fn put_numeric_type( "{}::{}{}", NAMESPACE, scalar.to_msl_name(), - back::vector_size_str(rows) + common::vector_size_str(rows) ) } (scalar, &[rows, columns]) => { @@ -81,8 +90,8 @@ fn put_numeric_type( "{}::{}{}x{}", NAMESPACE, scalar.to_msl_name(), - back::vector_size_str(columns), - back::vector_size_str(rows) + common::vector_size_str(columns), + common::vector_size_str(rows) ) } (_, _) => Ok(()), // not meaningful @@ -102,13 +111,13 @@ const CLAMPED_LOD_LOAD_PREFIX: &str = "clamped_lod_e"; /// Wrapper for identifier names for clamped level-of-detail values /// -/// Values of this type implement [`std::fmt::Display`], formatting as +/// Values of this type implement [`core::fmt::Display`], formatting as /// the name of the variable used to hold the cached clamped /// level-of-detail value for an `ImageLoad` expression. struct ClampedLod(Handle); impl Display for ClampedLod { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, CLAMPED_LOD_LOAD_PREFIX) } } @@ -123,14 +132,14 @@ impl Display for ClampedLod { /// /// If `global` is a [`Handle`] for a [`GlobalVariable`] that contains a /// runtime-sized array, then the value `ArraySize(global)` implements -/// [`std::fmt::Display`], formatting as the name of the struct member carrying +/// [`core::fmt::Display`], formatting as the name of the struct member carrying /// the number of elements in that runtime-sized array. /// /// [`GlobalVariable`]: crate::GlobalVariable struct ArraySizeMember(Handle); impl Display for ArraySizeMember { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { self.0.write_prefixed(f, "size") } } @@ -281,10 +290,16 @@ impl Display for TypeContext<'_> { crate::TypeInner::Sampler { comparison: _ } => { write!(out, "{NAMESPACE}::sampler") } - crate::TypeInner::AccelerationStructure => { + crate::TypeInner::AccelerationStructure { vertex_return } => { + if vertex_return { + unimplemented!("metal does not support vertex ray hit return") + } write!(out, "{RT_NAMESPACE}::instance_acceleration_structure") } - crate::TypeInner::RayQuery => { + crate::TypeInner::RayQuery { vertex_return } => { + if vertex_return { + unimplemented!("metal does not support vertex ray hit return") + } write!(out, "{RAY_QUERY_TYPE}") } crate::TypeInner::BindingArray { base, .. } => { @@ -561,8 +576,8 @@ impl crate::Type { // handle types may be different, depending on the global var access, so we always inline them Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } | Ti::BindingArray { .. } => false, } } @@ -1394,7 +1409,7 @@ impl Writer { .to_msl_name(); match context.resolve_type(arg) { &crate::TypeInner::Vector { size, .. } => { - let size = back::vector_size_str(size); + let size = common::vector_size_str(size); write!(self.out, "{scalar}{size}(-1), {scalar}{size}(1)")?; } _ => { @@ -2119,7 +2134,7 @@ impl Writer { // or metal will complain that select is ambiguous match *inner { crate::TypeInner::Vector { size, scalar } => { - let size = back::vector_size_str(size); + let size = common::vector_size_str(size); let name = scalar.to_msl_name(); write!(self.out, "{name}{size}")?; } @@ -2247,7 +2262,7 @@ impl Writer { crate::TypeInner::Vector { size, .. } => write!( self.out, "{NAMESPACE}::float{size}({NAMESPACE}::half{size}(", - size = back::vector_size_str(size), + size = common::vector_size_str(size), )?, _ => unreachable!( "Correct TypeInner for QuantizeToF16 should be already validated" @@ -2350,6 +2365,9 @@ impl Writer { write!(self.out, ")")?; } } + crate::Expression::RayQueryVertexPositions { .. } => { + unimplemented!() + } crate::Expression::RayQueryGetIntersection { query, committed: _, @@ -3223,8 +3241,7 @@ impl Writer { } self.put_block(lcase.next(), &case.body, context)?; - if !case.fall_through - && case.body.last().map_or(true, |s| !s.is_terminator()) + if !case.fall_through && case.body.last().is_none_or(|s| !s.is_terminator()) { writeln!(self.out, "{}break;", lcase.next())?; } @@ -3808,12 +3825,12 @@ impl Writer { let mut uses_ray_query = false; for (_, ty) in module.types.iter() { match ty.inner { - crate::TypeInner::AccelerationStructure => { + crate::TypeInner::AccelerationStructure { .. } => { if options.lang_version < (2, 4) { return Err(Error::UnsupportedRayTracing); } } - crate::TypeInner::RayQuery => { + crate::TypeInner::RayQuery { .. } => { if options.lang_version < (2, 4) { return Err(Error::UnsupportedRayTracing); } @@ -6514,6 +6531,12 @@ template "{level}{NAMESPACE}::simdgroup_barrier({NAMESPACE}::mem_flags::mem_threadgroup);", )?; } + if flags.contains(crate::Barrier::TEXTURE) { + writeln!( + self.out, + "{level}{NAMESPACE}::threadgroup_barrier({NAMESPACE}::mem_flags::mem_texture);", + )?; + } Ok(()) } } diff --git a/third_party/rust/naga/src/back/pipeline_constants.rs b/third_party/rust/naga/src/back/pipeline_constants.rs index 930813db43cb..4a54da5b1519 100644 --- a/third_party/rust/naga/src/back/pipeline_constants.rs +++ b/third_party/rust/naga/src/back/pipeline_constants.rs @@ -1,3 +1,12 @@ +use alloc::{ + borrow::Cow, + string::{String, ToString}, +}; +use core::mem; + +use hashbrown::HashSet; +use thiserror::Error; + use super::PipelineConstants; use crate::{ arena::HandleVec, @@ -6,9 +15,6 @@ use crate::{ Arena, Block, Constant, Expression, Function, Handle, Literal, Module, Override, Range, Scalar, Span, Statement, TypeInner, WithSpan, }; -use hashbrown::HashSet; -use std::{borrow::Cow, mem}; -use thiserror::Error; #[derive(Error, Debug, Clone)] #[cfg_attr(test, derive(PartialEq))] @@ -243,7 +249,7 @@ fn process_pending( ), )) } else { - Ok(std::num::NonZeroU32::new(n).unwrap()) + Ok(core::num::NonZeroU32::new(n).unwrap()) } }) .map_err(|_| { @@ -632,6 +638,12 @@ fn adjust_expr(new_pos: &HandleVec>, expr: &mut E | Expression::WorkGroupUniformLoadResult { ty: _ } | Expression::SubgroupBallotResult | Expression::SubgroupOperationResult { .. } => {} + Expression::RayQueryVertexPositions { + ref mut query, + committed: _, + } => { + adjust(query); + } } } diff --git a/third_party/rust/naga/src/back/spv/block.rs b/third_party/rust/naga/src/back/spv/block.rs index 4f07dea3e265..006ab310e32a 100644 --- a/third_party/rust/naga/src/back/spv/block.rs +++ b/third_party/rust/naga/src/back/spv/block.rs @@ -2,13 +2,16 @@ Implementations for `BlockContext` methods. */ +use alloc::vec::Vec; + +use spirv::Word; + use super::{ index::BoundsCheckResult, selection::Selection, Block, BlockContext, Dimension, Error, Instruction, LocalType, LookupType, NumericType, ResultMember, WrappedFunction, Writer, WriterFlags, }; use crate::{arena::Handle, proc::index::GuardedIndex, Statement}; -use spirv::Word; fn get_dimension(type_inner: &crate::TypeInner) -> Dimension { match *type_inner { @@ -1579,7 +1582,7 @@ impl BlockContext<'_> { const VEC_LENGTH: u8 = 4; let parts: [_; VEC_LENGTH as usize] = - std::array::from_fn(|_| self.gen_id()); + core::array::from_fn(|_| self.gen_id()); for (i, part_id) in parts.into_iter().enumerate() { let index = self .writer @@ -1927,6 +1930,13 @@ impl BlockContext<'_> { )); id } + crate::Expression::RayQueryVertexPositions { query, committed } => { + self.writer.require_any( + "RayQueryVertexPositions", + &[spirv::Capability::RayQueryPositionFetchKHR], + )?; + self.write_ray_query_return_vertex_position(query, block, committed) + } }; self.cached[expr_handle] = id; @@ -2230,26 +2240,60 @@ impl BlockContext<'_> { } fn spill_to_internal_variable(&mut self, base: Handle, block: &mut Block) { - // Generate an internal variable of the appropriate type for `base`. - let variable_id = self.writer.id_gen.next(); - let pointer_type_id = self - .writer - .get_resolution_pointer_id(&self.fun_info[base].ty, spirv::StorageClass::Function); - let variable = super::LocalVariable { - id: variable_id, - instruction: Instruction::variable( - pointer_type_id, - variable_id, - spirv::StorageClass::Function, - None, - ), + use indexmap::map::Entry; + + // Make sure we have an internal variable to spill `base` to. + let spill_variable_id = match self.function.spilled_composites.entry(base) { + Entry::Occupied(preexisting) => preexisting.get().id, + Entry::Vacant(vacant) => { + // Generate a new internal variable of the appropriate + // type for `base`. + let pointer_type_id = self.writer.get_resolution_pointer_id( + &self.fun_info[base].ty, + spirv::StorageClass::Function, + ); + let id = self.writer.id_gen.next(); + vacant.insert(super::LocalVariable { + id, + instruction: Instruction::variable( + pointer_type_id, + id, + spirv::StorageClass::Function, + None, + ), + }); + id + } }; + // Perform the store even if we already had a spill variable for `base`. + // Consider this code: + // + // var x = ...; + // var y = ...; + // var z = ...; + // for (i = 0; i<2; i++) { + // let a = array(i, i, i); + // if (i == 0) { + // x += a[y]; + // } else [ + // x += a[z]; + // } + // } + // + // The value of `a` needs to be spilled so we can subscript it with `y` and `z`. + // + // When we generate SPIR-V for `a[y]`, we will create the spill + // variable, and store `a`'s value in it. + // + // When we generate SPIR-V for `a[z]`, we will notice that the spill + // variable for `a` has already been declared, but it is still essential + // that we store `a` into it, so that `a[z]` sees this iteration's value + // of `a`. let base_id = self.cached[base]; block .body - .push(Instruction::store(variable.id, base_id, None)); - self.function.spilled_composites.insert(base, variable); + .push(Instruction::store(spill_variable_id, base_id, None)); } /// Generate an access to a spilled temporary, if necessary. diff --git a/third_party/rust/naga/src/back/spv/helpers.rs b/third_party/rust/naga/src/back/spv/helpers.rs index 63144abc028a..7938791bae09 100644 --- a/third_party/rust/naga/src/back/spv/helpers.rs +++ b/third_party/rust/naga/src/back/spv/helpers.rs @@ -1,6 +1,9 @@ -use crate::{Handle, UniqueArena}; +use alloc::{vec, vec::Vec}; + use spirv::Word; +use crate::{Handle, UniqueArena}; + pub(super) fn bytes_to_words(bytes: &[u8]) -> Vec { bytes .chunks(4) diff --git a/third_party/rust/naga/src/back/spv/image.rs b/third_party/rust/naga/src/back/spv/image.rs index fe4001060e68..816dd727a613 100644 --- a/third_party/rust/naga/src/back/spv/image.rs +++ b/third_party/rust/naga/src/back/spv/image.rs @@ -2,12 +2,13 @@ Generating SPIR-V for image operations. */ +use spirv::Word; + use super::{ selection::{MergeTuple, Selection}, Block, BlockContext, Error, IdGenerator, Instruction, LocalType, LookupType, NumericType, }; use crate::arena::Handle; -use spirv::Word; /// Information about a vector of coordinates. /// diff --git a/third_party/rust/naga/src/back/spv/index.rs b/third_party/rust/naga/src/back/spv/index.rs index 15e5df3f1012..053dd31e9fbf 100644 --- a/third_party/rust/naga/src/back/spv/index.rs +++ b/third_party/rust/naga/src/back/spv/index.rs @@ -351,7 +351,7 @@ impl BlockContext<'_> { // If both are known, we can compute the index to be used // right now. if let (GuardedIndex::Known(index), MaybeKnown::Known(max_index)) = (index, max_index) { - let restricted = std::cmp::min(index, max_index); + let restricted = core::cmp::min(index, max_index); return Ok(BoundsCheckResult::KnownInBounds(restricted)); } diff --git a/third_party/rust/naga/src/back/spv/instructions.rs b/third_party/rust/naga/src/back/spv/instructions.rs index 57bfb4e9f31f..db3934cb44da 100644 --- a/third_party/rust/naga/src/back/spv/instructions.rs +++ b/third_party/rust/naga/src/back/spv/instructions.rs @@ -1,6 +1,9 @@ -use super::{block::DebugInfoInner, helpers}; +use alloc::{vec, vec::Vec}; + use spirv::{Op, Word}; +use super::{block::DebugInfoInner, helpers}; + pub(super) enum Signedness { Unsigned = 0, Signed = 1, @@ -792,6 +795,20 @@ impl super::Instruction { instruction } + pub(super) fn ray_query_return_vertex_position( + result_type_id: Word, + id: Word, + query: Word, + intersection: Word, + ) -> Self { + let mut instruction = Self::new(Op::RayQueryGetIntersectionTriangleVertexPositionsKHR); + instruction.set_type(result_type_id); + instruction.set_result(id); + instruction.add_operand(query); + instruction.add_operand(intersection); + instruction + } + pub(super) fn ray_query_get_intersection( op: Op, result_type_id: Word, diff --git a/third_party/rust/naga/src/back/spv/layout.rs b/third_party/rust/naga/src/back/spv/layout.rs index d8b0ef0247cb..177996741d9a 100644 --- a/third_party/rust/naga/src/back/spv/layout.rs +++ b/third_party/rust/naga/src/back/spv/layout.rs @@ -1,6 +1,12 @@ -use super::{Instruction, LogicalLayout, PhysicalLayout}; +use alloc::{vec, vec::Vec}; +use core::iter; + use spirv::{Op, Word, MAGIC_NUMBER}; -use std::iter; + +use super::{Instruction, LogicalLayout, PhysicalLayout}; + +#[cfg(test)] +use alloc::format; // https://github.com/KhronosGroup/SPIRV-Headers/pull/195 const GENERATOR: Word = 28; diff --git a/third_party/rust/naga/src/back/spv/mod.rs b/third_party/rust/naga/src/back/spv/mod.rs index bb2757766c75..bd12b2fbce8a 100644 --- a/third_party/rust/naga/src/back/spv/mod.rs +++ b/third_party/rust/naga/src/back/spv/mod.rs @@ -18,13 +18,15 @@ mod writer; pub use spirv::{Capability, SourceLanguage}; -use crate::arena::{Handle, HandleVec}; -use crate::proc::{BoundsCheckPolicies, TypeResolution}; +use alloc::{string::String, vec::Vec}; +use core::ops; use spirv::Word; -use std::ops; use thiserror::Error; +use crate::arena::{Handle, HandleVec}; +use crate::proc::{BoundsCheckPolicies, TypeResolution}; + #[derive(Clone)] struct PhysicalLayout { magic_number: Word, @@ -147,12 +149,17 @@ struct Function { /// List of local variables used as a counters to ensure that all loops are bounded. force_loop_bounding_vars: Vec, - /// A map taking an expression that yields a composite value (array, matrix) - /// to the temporary variables we have spilled it to, if any. Spilling - /// allows us to render an arbitrary chain of [`Access`] and [`AccessIndex`] - /// expressions as an `OpAccessChain` and an `OpLoad` (plus bounds checks). - /// This supports dynamic indexing of by-value arrays and matrices, which - /// SPIR-V does not. + /// A map from a Naga expression to the temporary SPIR-V variable we have + /// spilled its value to, if any. + /// + /// Naga IR lets us apply [`Access`] expressions to expressions whose value + /// is an array or matrix---not a pointer to such---but SPIR-V doesn't have + /// instructions that can do the same. So when we encounter such code, we + /// spill the expression's value to a generated temporary variable. That, we + /// can obtain a pointer to, and then use an `OpAccessChain` instruction to + /// do whatever series of [`Access`] and [`AccessIndex`] operations we need + /// (with bounds checks). Finally, we generate an `OpLoad` to get the final + /// value. /// /// [`Access`]: crate::Expression::Access /// [`AccessIndex`]: crate::Expression::AccessIndex @@ -481,8 +488,8 @@ impl LocalType { class, } => LocalType::Image(LocalImageType::from_inner(dim, arrayed, class)), crate::TypeInner::Sampler { comparison: _ } => LocalType::Sampler, - crate::TypeInner::AccelerationStructure => LocalType::AccelerationStructure, - crate::TypeInner::RayQuery => LocalType::RayQuery, + crate::TypeInner::AccelerationStructure { .. } => LocalType::AccelerationStructure, + crate::TypeInner::RayQuery { .. } => LocalType::RayQuery, crate::TypeInner::Array { .. } | crate::TypeInner::Struct { .. } | crate::TypeInner::BindingArray { .. } => return None, @@ -852,7 +859,7 @@ pub struct BindingInfo { } // Using `BTreeMap` instead of `HashMap` so that we can hash itself. -pub type BindingMap = std::collections::BTreeMap; +pub type BindingMap = alloc::collections::BTreeMap; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ZeroInitializeWorkgroupMemoryMode { diff --git a/third_party/rust/naga/src/back/spv/ray.rs b/third_party/rust/naga/src/back/spv/ray.rs index 4a1768173a00..41f50bf61bc9 100644 --- a/third_party/rust/naga/src/back/spv/ray.rs +++ b/third_party/rust/naga/src/back/spv/ray.rs @@ -2,6 +2,8 @@ Generating SPIR-V for ray query operations. */ +use alloc::vec; + use super::{ Block, BlockContext, Function, FunctionArgument, Instruction, LocalType, LookupFunctionType, LookupType, NumericType, Writer, @@ -114,17 +116,8 @@ impl Writer { class: spirv::StorageClass::Function, })); - let rq_ty = ir_module - .types - .get(&Type { - name: None, - inner: TypeInner::RayQuery, - }) - .expect("ray_query type should have been populated by the variable passed into this!"); - let argument_type_id = self.get_type_id(LookupType::Local(LocalType::Pointer { - base: rq_ty, - class: spirv::StorageClass::Function, - })); + let argument_type_id = self.get_ray_query_pointer_id(ir_module); + let func_ty = self.get_function_type(LookupFunctionType { parameter_type_ids: vec![argument_type_id], return_type_id: intersection_type_id, @@ -624,4 +617,39 @@ impl BlockContext<'_> { crate::RayQueryFunction::Terminate => {} } } + + pub(super) fn write_ray_query_return_vertex_position( + &mut self, + query: Handle, + block: &mut Block, + is_committed: bool, + ) -> spirv::Word { + let query_id = self.cached[query]; + let id = self.gen_id(); + let result = self + .ir_module + .special_types + .ray_vertex_return + .expect("type should have been populated"); + let intersection_id = + self.writer + .get_constant_scalar(crate::Literal::U32(if is_committed { + spirv::RayQueryIntersection::RayQueryCommittedIntersectionKHR + } else { + spirv::RayQueryIntersection::RayQueryCandidateIntersectionKHR + } as _)); + block + .body + .push(Instruction::ray_query_return_vertex_position( + *self + .writer + .lookup_type + .get(&LookupType::Handle(result)) + .expect("type should have been populated"), + id, + query_id, + intersection_id, + )); + id + } } diff --git a/third_party/rust/naga/src/back/spv/recyclable.rs b/third_party/rust/naga/src/back/spv/recyclable.rs index 8ccc7406e2c3..4a84ce3bdedb 100644 --- a/third_party/rust/naga/src/back/spv/recyclable.rs +++ b/third_party/rust/naga/src/back/spv/recyclable.rs @@ -2,6 +2,8 @@ Reusing collections' previous allocations. */ +use alloc::vec::Vec; + /// A value that can be reset to its initial state, retaining its current allocations. /// /// Naga attempts to lower the cost of SPIR-V generation by allowing clients to @@ -59,7 +61,7 @@ impl Recyclable for indexmap::IndexSet { } } -impl Recyclable for std::collections::BTreeMap { +impl Recyclable for alloc::collections::BTreeMap { fn recycle(mut self) -> Self { self.clear(); self diff --git a/third_party/rust/naga/src/back/spv/selection.rs b/third_party/rust/naga/src/back/spv/selection.rs index 788b1f10ab81..38cf470db592 100644 --- a/third_party/rust/naga/src/back/spv/selection.rs +++ b/third_party/rust/naga/src/back/spv/selection.rs @@ -57,9 +57,12 @@ pointer for the duration of its lifetime. To obtain the block for generating code in the selection's body, call the `Selection::block` method. */ -use super::{Block, BlockContext, Instruction}; +use alloc::{vec, vec::Vec}; + use spirv::Word; +use super::{Block, BlockContext, Instruction}; + /// A private struct recording what we know about the selection construct so far. pub(super) struct Selection<'b, M: MergeTuple> { /// The block pointer we're emitting code into. @@ -125,7 +128,7 @@ impl<'b, M: MergeTuple> Selection<'b, M> { let merge_label = self.make_merge_label(ctx); let next_label = ctx.gen_id(); ctx.function.consume( - std::mem::replace(self.block, Block::new(next_label)), + core::mem::replace(self.block, Block::new(next_label)), Instruction::branch_conditional(cond, next_label, merge_label), ); } @@ -160,7 +163,7 @@ impl<'b, M: MergeTuple> Selection<'b, M> { // Emit the final branch and transition to the merge block. values.push((final_values, block.label_id)); ctx.function.consume( - std::mem::replace(block, Block::new(merge_label)), + core::mem::replace(block, Block::new(merge_label)), Instruction::branch(merge_label), ); diff --git a/third_party/rust/naga/src/back/spv/writer.rs b/third_party/rust/naga/src/back/spv/writer.rs index f1ba07a386e9..93756737db43 100644 --- a/third_party/rust/naga/src/back/spv/writer.rs +++ b/third_party/rust/naga/src/back/spv/writer.rs @@ -1,3 +1,12 @@ +use alloc::{ + string::{String, ToString}, + vec, + vec::Vec, +}; + +use hashbrown::hash_map::Entry; +use spirv::Word; + use super::{ block::DebugInfoInner, helpers::{contains_builtin, global_needs_wrapper, map_storage_class}, @@ -12,8 +21,6 @@ use crate::{ proc::{Alignment, TypeResolution}, valid::{FunctionInfo, ModuleInfo}, }; -use hashbrown::hash_map::Entry; -use spirv::Word; struct FunctionInterface<'a> { varying_ids: &'a mut Vec, @@ -97,12 +104,12 @@ impl Writer { /// `Recyclable::recycle` requires ownership of the value, not just /// `&mut`; see the trait documentation. But we need to use this method /// from functions like `Writer::write`, which only have `&mut Writer`. - /// Workarounds include unsafe code (`std::ptr::read`, then `write`, ugh) + /// Workarounds include unsafe code (`core::ptr::read`, then `write`, ugh) /// or something like a `Default` impl that returns an oddly-initialized /// `Writer`, which is worse. fn reset(&mut self) { use super::recyclable::Recyclable; - use std::mem::take; + use core::mem::take; let mut id_gen = IdGenerator::default(); let gl450_ext_inst_id = id_gen.next(); @@ -244,6 +251,30 @@ impl Writer { })) } + pub(super) fn get_ray_query_pointer_id(&mut self, module: &crate::Module) -> Word { + let rq_ty = module + .types + .get(&crate::Type { + name: None, + inner: crate::TypeInner::RayQuery { + vertex_return: false, + }, + }) + .or_else(|| { + module.types.get(&crate::Type { + name: None, + inner: crate::TypeInner::RayQuery { + vertex_return: true, + }, + }) + }) + .expect("ray_query type should have been populated by the variable passed into this!"); + self.get_type_id(LookupType::Local(LocalType::Pointer { + base: rq_ty, + class: spirv::StorageClass::Function, + })) + } + /// Return a SPIR-V type for a pointer to `resolution`. /// /// The given `resolution` must be one that we can represent @@ -867,10 +898,10 @@ impl Writer { fun_info: info, function: &mut function, // Re-use the cached expression table from prior functions. - cached: std::mem::take(&mut self.saved_cached), + cached: core::mem::take(&mut self.saved_cached), // Steal the Writer's temp list for a bit. - temp_list: std::mem::take(&mut self.temp_list), + temp_list: core::mem::take(&mut self.temp_list), force_loop_bounding: self.force_loop_bounding, writer: self, expression_constness: super::ExpressionConstnessTracker::from_arena( @@ -906,7 +937,7 @@ impl Writer { id, spirv::StorageClass::Function, init_word.or_else(|| match ir_module.types[variable.ty].inner { - crate::TypeInner::RayQuery => None, + crate::TypeInner::RayQuery { .. } => None, _ => { let type_id = context.get_type_id(LookupType::Handle(variable.ty)); Some(context.writer.write_constant_null(type_id)) @@ -1131,10 +1162,10 @@ impl Writer { _ => {} } } - crate::TypeInner::AccelerationStructure => { + crate::TypeInner::AccelerationStructure { .. } => { self.require_any("Acceleration Structure", &[spirv::Capability::RayQueryKHR])?; } - crate::TypeInner::RayQuery => { + crate::TypeInner::RayQuery { .. } => { self.require_any("Ray Query", &[spirv::Capability::RayQueryKHR])?; } crate::TypeInner::Atomic(crate::Scalar { width: 8, kind: _ }) => { @@ -1317,8 +1348,8 @@ impl Writer { | crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure - | crate::TypeInner::RayQuery => unreachable!(), + | crate::TypeInner::AccelerationStructure { .. } + | crate::TypeInner::RayQuery { .. } => unreachable!(), }; instruction.to_words(&mut self.logical_layout.declarations); @@ -1571,6 +1602,10 @@ impl Writer { spirv::MemorySemantics::WORKGROUP_MEMORY, flags.contains(crate::Barrier::WORK_GROUP), ); + semantics.set( + spirv::MemorySemantics::IMAGE_MEMORY, + flags.contains(crate::Barrier::TEXTURE), + ); let exec_scope_id = if flags.contains(crate::Barrier::SUB_GROUP) { self.get_index_constant(spirv::Scope::Subgroup as u32) } else { @@ -2188,9 +2223,13 @@ impl Writer { .any(|arg| has_view_index_check(ir_module, arg.binding.as_ref(), arg.ty)); let mut has_ray_query = ir_module.special_types.ray_desc.is_some() | ir_module.special_types.ray_intersection.is_some(); + let has_vertex_return = ir_module.special_types.ray_vertex_return.is_some(); for (_, &crate::Type { ref inner, .. }) in ir_module.types.iter() { - if let &crate::TypeInner::AccelerationStructure | &crate::TypeInner::RayQuery = inner { + // spirv does not know whether these have vertex return - that is done by us + if let &crate::TypeInner::AccelerationStructure { .. } + | &crate::TypeInner::RayQuery { .. } = inner + { has_ray_query = true } } @@ -2208,6 +2247,10 @@ impl Writer { Instruction::extension("SPV_KHR_ray_query") .to_words(&mut self.logical_layout.extensions) } + if has_vertex_return { + Instruction::extension("SPV_KHR_ray_tracing_position_fetch") + .to_words(&mut self.logical_layout.extensions); + } Instruction::type_void(self.void_type).to_words(&mut self.logical_layout.declarations); Instruction::ext_inst_import(self.gl450_ext_inst_id, "GLSL.std.450") .to_words(&mut self.logical_layout.ext_inst_imports); diff --git a/third_party/rust/naga/src/back/wgsl/mod.rs b/third_party/rust/naga/src/back/wgsl/mod.rs index ecf59698a8c7..9430460dad9d 100644 --- a/third_party/rust/naga/src/back/wgsl/mod.rs +++ b/third_party/rust/naga/src/back/wgsl/mod.rs @@ -7,22 +7,59 @@ Backend for [WGSL][wgsl] (WebGPU Shading Language). mod polyfill; mod writer; +use alloc::format; +use alloc::string::String; + use thiserror::Error; pub use writer::{Writer, WriterFlags}; +use crate::common::wgsl; + #[derive(Error, Debug)] pub enum Error { #[error(transparent)] - FmtError(#[from] std::fmt::Error), + FmtError(#[from] core::fmt::Error), #[error("{0}")] Custom(String), #[error("{0}")] Unimplemented(String), // TODO: Error used only during development - #[error("Unsupported math function: {0:?}")] - UnsupportedMathFunction(crate::MathFunction), #[error("Unsupported relational function: {0:?}")] UnsupportedRelationalFunction(crate::RelationalFunction), + #[error("Unsupported {kind}: {value}")] + Unsupported { + /// What kind of unsupported thing this is: interpolation, builtin, etc. + kind: &'static str, + + /// The debug form of the Naga IR value that this backend can't express. + value: String, + }, +} + +impl Error { + /// Produce an [`Unsupported`] error for `value`. + /// + /// [`Unsupported`]: Error::Unsupported + fn unsupported(kind: &'static str, value: T) -> Error { + Error::Unsupported { + kind, + value: format!("{value:?}"), + } + } +} + +trait ToWgslIfImplemented { + fn to_wgsl_if_implemented(self) -> Result<&'static str, Error>; +} + +impl ToWgslIfImplemented for T +where + T: wgsl::TryToWgsl + core::fmt::Debug + Copy, +{ + fn to_wgsl_if_implemented(self) -> Result<&'static str, Error> { + self.try_to_wgsl() + .ok_or_else(|| Error::unsupported(T::DESCRIPTION, self)) + } } pub fn write_string( diff --git a/third_party/rust/naga/src/back/wgsl/writer.rs b/third_party/rust/naga/src/back/wgsl/writer.rs index a7cd8f95c9bc..7e049b0ba450 100644 --- a/third_party/rust/naga/src/back/wgsl/writer.rs +++ b/third_party/rust/naga/src/back/wgsl/writer.rs @@ -1,11 +1,23 @@ +use alloc::{ + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::fmt::Write; + use super::Error; +use super::ToWgslIfImplemented as _; use crate::back::wgsl::polyfill::InversePolyfill; use crate::{ back::{self, Baked}, + common::{ + self, + wgsl::{address_space_str, ToWgsl, TryToWgsl}, + }, proc::{self, ExpressionKindTracker, NameKey}, valid, Handle, Module, ShaderStage, TypeInner, }; -use std::fmt::Write; /// Shorthand result used internally by the backend type BackendResult = Result<(), Error>; @@ -68,7 +80,6 @@ pub struct Writer { names: crate::FastHashMap, namer: proc::Namer, named_expressions: crate::NamedExpressions, - ep_results: Vec<(ShaderStage, Handle)>, required_polyfills: crate::FastIndexSet, } @@ -80,7 +91,6 @@ impl Writer { names: crate::FastHashMap::default(), namer: proc::Namer::default(), named_expressions: crate::NamedExpressions::default(), - ep_results: vec![], required_polyfills: crate::FastIndexSet::default(), } } @@ -97,7 +107,6 @@ impl Writer { &mut self.names, ); self.named_expressions.clear(); - self.ep_results.clear(); self.required_polyfills.clear(); } @@ -118,13 +127,6 @@ impl Writer { self.reset(module); - // Save all ep result types - for ep in &module.entry_points { - if let Some(ref result) = ep.function.result { - self.ep_results.push((ep.stage, result.ty)); - } - } - // Write all structs for (handle, ty) in module.types.iter() { if let TypeInner::Struct { ref members, .. } = ty.inner { @@ -217,29 +219,6 @@ impl Writer { Ok(()) } - /// Helper method used to write struct name - /// - /// # Notes - /// Adds no trailing or leading whitespace - fn write_struct_name(&mut self, module: &Module, handle: Handle) -> BackendResult { - if module.types[handle].name.is_none() { - if let Some(&(stage, _)) = self.ep_results.iter().find(|&&(_, ty)| ty == handle) { - let name = match stage { - ShaderStage::Compute => "ComputeOutput", - ShaderStage::Fragment => "FragmentOutput", - ShaderStage::Vertex => "VertexOutput", - }; - - write!(self.out, "{name}")?; - return Ok(()); - } - } - - write!(self.out, "{}", self.names[&NameKey::Type(handle)])?; - - Ok(()) - } - /// Helper method used to write /// [functions](https://gpuweb.github.io/gpuweb/wgsl/#functions) /// @@ -342,7 +321,7 @@ impl Writer { Attribute::Location(id) => write!(self.out, "@location({id}) ")?, Attribute::SecondBlendSource => write!(self.out, "@second_blend_source ")?, Attribute::BuiltIn(builtin_attrib) => { - let builtin = builtin_str(builtin_attrib)?; + let builtin = builtin_attrib.to_wgsl_if_implemented()?; write!(self.out, "@builtin({builtin}) ")?; } Attribute::Stage(shader_stage) => { @@ -365,24 +344,18 @@ impl Writer { Attribute::Invariant => write!(self.out, "@invariant ")?, Attribute::Interpolate(interpolation, sampling) => { if sampling.is_some() && sampling != Some(crate::Sampling::Center) { - write!( - self.out, - "@interpolate({}, {}) ", - interpolation_str( - interpolation.unwrap_or(crate::Interpolation::Perspective) - ), - sampling_str(sampling.unwrap_or(crate::Sampling::Center)) - )?; + let interpolation = interpolation + .unwrap_or(crate::Interpolation::Perspective) + .to_wgsl(); + let sampling = sampling.unwrap_or(crate::Sampling::Center).to_wgsl(); + write!(self.out, "@interpolate({interpolation}, {sampling}) ")?; } else if interpolation.is_some() && interpolation != Some(crate::Interpolation::Perspective) { - write!( - self.out, - "@interpolate({}) ", - interpolation_str( - interpolation.unwrap_or(crate::Interpolation::Perspective) - ) - )?; + let interpolation = interpolation + .unwrap_or(crate::Interpolation::Perspective) + .to_wgsl(); + write!(self.out, "@interpolate({interpolation}) ")?; } } }; @@ -400,8 +373,7 @@ impl Writer { handle: Handle, members: &[crate::StructMember], ) -> BackendResult { - write!(self.out, "struct ")?; - self.write_struct_name(module, handle)?; + write!(self.out, "struct {}", self.names[&NameKey::Type(handle)])?; write!(self.out, " {{")?; writeln!(self.out)?; for (index, member) in members.iter().enumerate() { @@ -432,7 +404,9 @@ impl Writer { fn write_type(&mut self, module: &Module, ty: Handle) -> BackendResult { let inner = &module.types[ty].inner; match *inner { - TypeInner::Struct { .. } => self.write_struct_name(module, ty)?, + TypeInner::Struct { .. } => { + write!(self.out, "{}", self.names[&NameKey::Type(ty)])?; + } ref other => self.write_value_type(module, other)?, } @@ -448,8 +422,8 @@ impl Writer { TypeInner::Vector { size, scalar } => write!( self.out, "vec{}<{}>", - back::vector_size_str(size), - scalar_kind_str(scalar), + common::vector_size_str(size), + scalar.to_wgsl_if_implemented()?, )?, TypeInner::Sampler { comparison: false } => { write!(self.out, "sampler")?; @@ -465,13 +439,13 @@ impl Writer { // More about texture types: https://gpuweb.github.io/gpuweb/wgsl/#sampled-texture-type use crate::ImageClass as Ic; - let dim_str = image_dimension_str(dim); + let dim_str = dim.to_wgsl(); let arrayed_str = if arrayed { "_array" } else { "" }; let (class_str, multisampled_str, format_str, storage_str) = match class { Ic::Sampled { kind, multi } => ( "", if multi { "multisampled_" } else { "" }, - scalar_kind_str(crate::Scalar { kind, width: 4 }), + crate::Scalar { kind, width: 4 }.to_wgsl_if_implemented()?, "", ), Ic::Depth { multi } => { @@ -480,7 +454,7 @@ impl Writer { Ic::Storage { format, access } => ( "storage_", "", - storage_format_str(format), + format.to_wgsl(), if access.contains(crate::StorageAccess::ATOMIC) { ",atomic" } else if access @@ -504,10 +478,10 @@ impl Writer { } } TypeInner::Scalar(scalar) => { - write!(self.out, "{}", scalar_kind_str(scalar))?; + write!(self.out, "{}", scalar.to_wgsl_if_implemented()?)?; } TypeInner::Atomic(scalar) => { - write!(self.out, "atomic<{}>", scalar_kind_str(scalar))?; + write!(self.out, "atomic<{}>", scalar.to_wgsl_if_implemented()?)?; } TypeInner::Array { base, @@ -557,9 +531,9 @@ impl Writer { write!( self.out, "mat{}x{}<{}>", - back::vector_size_str(columns), - back::vector_size_str(rows), - scalar_kind_str(scalar) + common::vector_size_str(columns), + common::vector_size_str(rows), + scalar.to_wgsl_if_implemented()? )?; } TypeInner::Pointer { base, space } => { @@ -585,7 +559,12 @@ impl Writer { } => { let (address, maybe_access) = address_space_str(space); if let Some(space) = address { - write!(self.out, "ptr<{}, {}", space, scalar_kind_str(scalar))?; + write!( + self.out, + "ptr<{}, {}", + space, + scalar.to_wgsl_if_implemented()? + )?; if let Some(access) = maybe_access { write!(self.out, ", {access}")?; } @@ -607,8 +586,8 @@ impl Writer { self.out, "ptr<{}, vec{}<{}>", space, - back::vector_size_str(size), - scalar_kind_str(scalar) + common::vector_size_str(size), + scalar.to_wgsl_if_implemented()? )?; if let Some(access) = maybe_access { write!(self.out, ", {access}")?; @@ -621,7 +600,10 @@ impl Writer { } write!(self.out, ">")?; } - TypeInner::AccelerationStructure => write!(self.out, "acceleration_structure")?, + TypeInner::AccelerationStructure { vertex_return } => { + let caps = if vertex_return { "" } else { "" }; + write!(self.out, "acceleration_structure{}", caps)? + } _ => { return Err(Error::Unimplemented(format!("write_value_type {inner:?}"))); } @@ -973,6 +955,10 @@ impl Writer { if barrier.contains(crate::Barrier::SUB_GROUP) { writeln!(self.out, "{level}subgroupBarrier();")?; } + + if barrier.contains(crate::Barrier::TEXTURE) { + writeln!(self.out, "{level}textureBarrier();")?; + } } Statement::RayQuery { .. } => unreachable!(), Statement::SubgroupBallot { result, predicate } => { @@ -1317,7 +1303,7 @@ impl Writer { write!(self.out, ")")? } Expression::Splat { size, value } => { - let size = back::vector_size_str(size); + let size = common::vector_size_str(size); write!(self.out, "vec{size}(")?; write_expression(self, value)?; write!(self.out, ")")?; @@ -1609,12 +1595,12 @@ impl Writer { kind, width: convert.unwrap_or(scalar.width), }; - let scalar_kind_str = scalar_kind_str(scalar); + let scalar_kind_str = scalar.to_wgsl_if_implemented()?; write!( self.out, "mat{}x{}<{}>", - back::vector_size_str(columns), - back::vector_size_str(rows), + common::vector_size_str(columns), + common::vector_size_str(rows), scalar_kind_str )?; } @@ -1626,8 +1612,8 @@ impl Writer { kind, width: convert.unwrap_or(width), }; - let vector_size_str = back::vector_size_str(size); - let scalar_kind_str = scalar_kind_str(scalar); + let vector_size_str = common::vector_size_str(size); + let scalar_kind_str = scalar.to_wgsl_if_implemented()?; if convert.is_some() { write!(self.out, "vec{vector_size_str}<{scalar_kind_str}>")?; } else { @@ -1639,7 +1625,7 @@ impl Writer { kind, width: convert.unwrap_or(width), }; - let scalar_kind_str = scalar_kind_str(scalar); + let scalar_kind_str = scalar.to_wgsl_if_implemented()?; if convert.is_some() { write!(self.out, "{scalar_kind_str}")? } else { @@ -1697,98 +1683,19 @@ impl Writer { InversePolyfill(InversePolyfill), } - let function = match fun { - Mf::Abs => Function::Regular("abs"), - Mf::Min => Function::Regular("min"), - Mf::Max => Function::Regular("max"), - Mf::Clamp => Function::Regular("clamp"), - Mf::Saturate => Function::Regular("saturate"), - // trigonometry - Mf::Cos => Function::Regular("cos"), - Mf::Cosh => Function::Regular("cosh"), - Mf::Sin => Function::Regular("sin"), - Mf::Sinh => Function::Regular("sinh"), - Mf::Tan => Function::Regular("tan"), - Mf::Tanh => Function::Regular("tanh"), - Mf::Acos => Function::Regular("acos"), - Mf::Asin => Function::Regular("asin"), - Mf::Atan => Function::Regular("atan"), - Mf::Atan2 => Function::Regular("atan2"), - Mf::Asinh => Function::Regular("asinh"), - Mf::Acosh => Function::Regular("acosh"), - Mf::Atanh => Function::Regular("atanh"), - Mf::Radians => Function::Regular("radians"), - Mf::Degrees => Function::Regular("degrees"), - // decomposition - Mf::Ceil => Function::Regular("ceil"), - Mf::Floor => Function::Regular("floor"), - Mf::Round => Function::Regular("round"), - Mf::Fract => Function::Regular("fract"), - Mf::Trunc => Function::Regular("trunc"), - Mf::Modf => Function::Regular("modf"), - Mf::Frexp => Function::Regular("frexp"), - Mf::Ldexp => Function::Regular("ldexp"), - // exponent - Mf::Exp => Function::Regular("exp"), - Mf::Exp2 => Function::Regular("exp2"), - Mf::Log => Function::Regular("log"), - Mf::Log2 => Function::Regular("log2"), - Mf::Pow => Function::Regular("pow"), - // geometry - Mf::Dot => Function::Regular("dot"), - Mf::Cross => Function::Regular("cross"), - Mf::Distance => Function::Regular("distance"), - Mf::Length => Function::Regular("length"), - Mf::Normalize => Function::Regular("normalize"), - Mf::FaceForward => Function::Regular("faceForward"), - Mf::Reflect => Function::Regular("reflect"), - Mf::Refract => Function::Regular("refract"), - // computational - Mf::Sign => Function::Regular("sign"), - Mf::Fma => Function::Regular("fma"), - Mf::Mix => Function::Regular("mix"), - Mf::Step => Function::Regular("step"), - Mf::SmoothStep => Function::Regular("smoothstep"), - Mf::Sqrt => Function::Regular("sqrt"), - Mf::InverseSqrt => Function::Regular("inverseSqrt"), - Mf::Transpose => Function::Regular("transpose"), - Mf::Determinant => Function::Regular("determinant"), - Mf::QuantizeToF16 => Function::Regular("quantizeToF16"), - // bits - Mf::CountTrailingZeros => Function::Regular("countTrailingZeros"), - Mf::CountLeadingZeros => Function::Regular("countLeadingZeros"), - Mf::CountOneBits => Function::Regular("countOneBits"), - Mf::ReverseBits => Function::Regular("reverseBits"), - Mf::ExtractBits => Function::Regular("extractBits"), - Mf::InsertBits => Function::Regular("insertBits"), - Mf::FirstTrailingBit => Function::Regular("firstTrailingBit"), - Mf::FirstLeadingBit => Function::Regular("firstLeadingBit"), - // data packing - Mf::Pack4x8snorm => Function::Regular("pack4x8snorm"), - Mf::Pack4x8unorm => Function::Regular("pack4x8unorm"), - Mf::Pack2x16snorm => Function::Regular("pack2x16snorm"), - Mf::Pack2x16unorm => Function::Regular("pack2x16unorm"), - Mf::Pack2x16float => Function::Regular("pack2x16float"), - Mf::Pack4xI8 => Function::Regular("pack4xI8"), - Mf::Pack4xU8 => Function::Regular("pack4xU8"), - // data unpacking - Mf::Unpack4x8snorm => Function::Regular("unpack4x8snorm"), - Mf::Unpack4x8unorm => Function::Regular("unpack4x8unorm"), - Mf::Unpack2x16snorm => Function::Regular("unpack2x16snorm"), - Mf::Unpack2x16unorm => Function::Regular("unpack2x16unorm"), - Mf::Unpack2x16float => Function::Regular("unpack2x16float"), - Mf::Unpack4xI8 => Function::Regular("unpack4xI8"), - Mf::Unpack4xU8 => Function::Regular("unpack4xU8"), - Mf::Inverse => { - let typ = func_ctx.resolve_type(arg, &module.types); + let function = match fun.try_to_wgsl() { + Some(name) => Function::Regular(name), + None => match fun { + Mf::Inverse => { + let ty = func_ctx.resolve_type(arg, &module.types); + let Some(overload) = InversePolyfill::find_overload(ty) else { + return Err(Error::unsupported("math function", fun)); + }; - let Some(overload) = InversePolyfill::find_overload(typ) else { - return Err(Error::UnsupportedMathFunction(fun)); - }; - - Function::InversePolyfill(overload) - } - Mf::Outer => return Err(Error::UnsupportedMathFunction(fun)), + Function::InversePolyfill(overload) + } + _ => return Err(Error::unsupported("math function", fun)), + }, }; match function { @@ -1879,7 +1786,8 @@ impl Writer { write!(self.out, ")")? } // Not supported yet - Expression::RayQueryGetIntersection { .. } => unreachable!(), + Expression::RayQueryGetIntersection { .. } + | Expression::RayQueryVertexPositions { .. } => unreachable!(), // Nothing to do here, since call expression already cached Expression::CallResult(_) | Expression::AtomicResult { .. } @@ -1969,186 +1877,6 @@ impl Writer { } } -fn builtin_str(built_in: crate::BuiltIn) -> Result<&'static str, Error> { - use crate::BuiltIn as Bi; - - Ok(match built_in { - Bi::VertexIndex => "vertex_index", - Bi::InstanceIndex => "instance_index", - Bi::Position { .. } => "position", - Bi::FrontFacing => "front_facing", - Bi::FragDepth => "frag_depth", - Bi::LocalInvocationId => "local_invocation_id", - Bi::LocalInvocationIndex => "local_invocation_index", - Bi::GlobalInvocationId => "global_invocation_id", - Bi::WorkGroupId => "workgroup_id", - Bi::NumWorkGroups => "num_workgroups", - Bi::SampleIndex => "sample_index", - Bi::SampleMask => "sample_mask", - Bi::PrimitiveIndex => "primitive_index", - Bi::ViewIndex => "view_index", - Bi::NumSubgroups => "num_subgroups", - Bi::SubgroupId => "subgroup_id", - Bi::SubgroupSize => "subgroup_size", - Bi::SubgroupInvocationId => "subgroup_invocation_id", - Bi::BaseInstance - | Bi::BaseVertex - | Bi::ClipDistance - | Bi::CullDistance - | Bi::PointSize - | Bi::PointCoord - | Bi::WorkGroupSize - | Bi::DrawID => return Err(Error::Custom(format!("Unsupported builtin {built_in:?}"))), - }) -} - -const fn image_dimension_str(dim: crate::ImageDimension) -> &'static str { - use crate::ImageDimension as IDim; - - match dim { - IDim::D1 => "1d", - IDim::D2 => "2d", - IDim::D3 => "3d", - IDim::Cube => "cube", - } -} - -const fn scalar_kind_str(scalar: crate::Scalar) -> &'static str { - use crate::Scalar; - use crate::ScalarKind as Sk; - - match scalar { - Scalar { - kind: Sk::Float, - width: 8, - } => "f64", - Scalar { - kind: Sk::Float, - width: 4, - } => "f32", - Scalar { - kind: Sk::Sint, - width: 4, - } => "i32", - Scalar { - kind: Sk::Uint, - width: 4, - } => "u32", - Scalar { - kind: Sk::Sint, - width: 8, - } => "i64", - Scalar { - kind: Sk::Uint, - width: 8, - } => "u64", - Scalar { - kind: Sk::Bool, - width: 1, - } => "bool", - _ => unreachable!(), - } -} - -const fn storage_format_str(format: crate::StorageFormat) -> &'static str { - use crate::StorageFormat as Sf; - - match format { - Sf::R8Unorm => "r8unorm", - Sf::R8Snorm => "r8snorm", - Sf::R8Uint => "r8uint", - Sf::R8Sint => "r8sint", - Sf::R16Uint => "r16uint", - Sf::R16Sint => "r16sint", - Sf::R16Float => "r16float", - Sf::Rg8Unorm => "rg8unorm", - Sf::Rg8Snorm => "rg8snorm", - Sf::Rg8Uint => "rg8uint", - Sf::Rg8Sint => "rg8sint", - Sf::R32Uint => "r32uint", - Sf::R32Sint => "r32sint", - Sf::R32Float => "r32float", - Sf::Rg16Uint => "rg16uint", - Sf::Rg16Sint => "rg16sint", - Sf::Rg16Float => "rg16float", - Sf::Rgba8Unorm => "rgba8unorm", - Sf::Rgba8Snorm => "rgba8snorm", - Sf::Rgba8Uint => "rgba8uint", - Sf::Rgba8Sint => "rgba8sint", - Sf::Bgra8Unorm => "bgra8unorm", - Sf::Rgb10a2Uint => "rgb10a2uint", - Sf::Rgb10a2Unorm => "rgb10a2unorm", - Sf::Rg11b10Ufloat => "rg11b10float", - Sf::R64Uint => "r64uint", - Sf::Rg32Uint => "rg32uint", - Sf::Rg32Sint => "rg32sint", - Sf::Rg32Float => "rg32float", - Sf::Rgba16Uint => "rgba16uint", - Sf::Rgba16Sint => "rgba16sint", - Sf::Rgba16Float => "rgba16float", - Sf::Rgba32Uint => "rgba32uint", - Sf::Rgba32Sint => "rgba32sint", - Sf::Rgba32Float => "rgba32float", - Sf::R16Unorm => "r16unorm", - Sf::R16Snorm => "r16snorm", - Sf::Rg16Unorm => "rg16unorm", - Sf::Rg16Snorm => "rg16snorm", - Sf::Rgba16Unorm => "rgba16unorm", - Sf::Rgba16Snorm => "rgba16snorm", - } -} - -/// Helper function that returns the string corresponding to the WGSL interpolation qualifier -const fn interpolation_str(interpolation: crate::Interpolation) -> &'static str { - use crate::Interpolation as I; - - match interpolation { - I::Perspective => "perspective", - I::Linear => "linear", - I::Flat => "flat", - } -} - -/// Return the WGSL auxiliary qualifier for the given sampling value. -const fn sampling_str(sampling: crate::Sampling) -> &'static str { - use crate::Sampling as S; - - match sampling { - S::Center => "", - S::Centroid => "centroid", - S::Sample => "sample", - S::First => "first", - S::Either => "either", - } -} - -const fn address_space_str( - space: crate::AddressSpace, -) -> (Option<&'static str>, Option<&'static str>) { - use crate::AddressSpace as As; - - ( - Some(match space { - As::Private => "private", - As::Uniform => "uniform", - As::Storage { access } => { - if access.contains(crate::StorageAccess::ATOMIC) { - return (Some("storage"), Some("atomic")); - } else if access.contains(crate::StorageAccess::STORE) { - return (Some("storage"), Some("read_write")); - } else { - "storage" - } - } - As::PushConstant => "push_constant", - As::WorkGroup => "workgroup", - As::Handle => return (None, None), - As::Function => "function", - }), - None, - ) -} - fn map_binding_to_attribute(binding: &crate::Binding) -> Vec { match *binding { crate::Binding::BuiltIn(built_in) => { diff --git a/third_party/rust/naga/src/block.rs b/third_party/rust/naga/src/block.rs index 2e86a928f11f..fde2961c89ff 100644 --- a/third_party/rust/naga/src/block.rs +++ b/third_party/rust/naga/src/block.rs @@ -1,5 +1,7 @@ +use alloc::vec::Vec; +use core::ops::{Deref, DerefMut, RangeBounds}; + use crate::{Span, Statement}; -use std::ops::{Deref, DerefMut, RangeBounds}; /// A code block is a vector of statements, with maybe a vector of spans. #[derive(Debug, Clone, Default)] @@ -21,7 +23,7 @@ impl Block { } pub fn from_vec(body: Vec) -> Self { - let span_info = std::iter::repeat(Span::default()) + let span_info = core::iter::repeat(Span::default()) .take(body.len()) .collect(); Self { body, span_info } @@ -105,9 +107,9 @@ impl DerefMut for Block { impl<'a> IntoIterator for &'a Block { type Item = &'a Statement; - type IntoIter = std::slice::Iter<'a, Statement>; + type IntoIter = core::slice::Iter<'a, Statement>; - fn into_iter(self) -> std::slice::Iter<'a, Statement> { + fn into_iter(self) -> core::slice::Iter<'a, Statement> { self.iter() } } diff --git a/third_party/rust/naga/src/common/mod.rs b/third_party/rust/naga/src/common/mod.rs index b603904ee0a8..8ed0396952cc 100644 --- a/third_party/rust/naga/src/common/mod.rs +++ b/third_party/rust/naga/src/common/mod.rs @@ -1,3 +1,12 @@ //! Code common to the front and backends for specific languages. pub mod wgsl; + +/// Helper function that returns the string corresponding to the [`VectorSize`](crate::VectorSize) +pub const fn vector_size_str(size: crate::VectorSize) -> &'static str { + match size { + crate::VectorSize::Bi => "2", + crate::VectorSize::Tri => "3", + crate::VectorSize::Quad => "4", + } +} diff --git a/third_party/rust/naga/src/common/wgsl.rs b/third_party/rust/naga/src/common/wgsl.rs index 07459d7f345b..8a9c6b5b7a62 100644 --- a/third_party/rust/naga/src/common/wgsl.rs +++ b/third_party/rust/naga/src/common/wgsl.rs @@ -1,6 +1,6 @@ //! Code shared between the WGSL front and back ends. -use std::fmt::{self, Display, Formatter}; +use core::fmt::{self, Display, Formatter}; use crate::diagnostic_filter::{ FilterableTriggeringRule, Severity, StandardFilterableTriggeringRule, @@ -67,3 +67,318 @@ impl StandardFilterableTriggeringRule { } } } + +/// Types that can return the WGSL source representation of their +/// values as a `'static` string. +/// +/// This trait is specifically for types whose WGSL forms are simple +/// enough that they can always be returned as a static string. +/// +/// - If only some values have a WGSL representation, consider +/// implementing [`TryToWgsl`] instead. +/// +/// - If a type's WGSL form requires dynamic formatting, so that +/// returning a `&'static str` isn't feasible, consider implementing +/// [`std::fmt::Display`] on some wrapper type instead. +pub trait ToWgsl: Sized { + /// Return WGSL source code representation of `self`. + fn to_wgsl(self) -> &'static str; +} + +/// Types that may be able to return the WGSL source representation +/// for their values as a `'static' string. +/// +/// This trait is specifically for types whose values are either +/// simple enough that their WGSL form can be represented a static +/// string, or aren't representable in WGSL at all. +/// +/// - If all values in the type have `&'static str` representations in +/// WGSL, consider implementing [`ToWgsl`] instead. +/// +/// - If a type's WGSL form requires dynamic formatting, so that +/// returning a `&'static str` isn't feasible, consider implementing +/// [`std::fmt::Display`] on some wrapper type instead. +pub trait TryToWgsl: Sized { + /// Return the WGSL form of `self` as a `'static` string. + /// + /// If `self` doesn't have a representation in WGSL (standard or + /// as extended by Naga), then return `None`. + fn try_to_wgsl(self) -> Option<&'static str>; + + /// What kind of WGSL thing `Self` represents. + const DESCRIPTION: &'static str; +} + +impl TryToWgsl for crate::MathFunction { + const DESCRIPTION: &'static str = "math function"; + + fn try_to_wgsl(self) -> Option<&'static str> { + use crate::MathFunction as Mf; + + Some(match self { + Mf::Abs => "abs", + Mf::Min => "min", + Mf::Max => "max", + Mf::Clamp => "clamp", + Mf::Saturate => "saturate", + Mf::Cos => "cos", + Mf::Cosh => "cosh", + Mf::Sin => "sin", + Mf::Sinh => "sinh", + Mf::Tan => "tan", + Mf::Tanh => "tanh", + Mf::Acos => "acos", + Mf::Asin => "asin", + Mf::Atan => "atan", + Mf::Atan2 => "atan2", + Mf::Asinh => "asinh", + Mf::Acosh => "acosh", + Mf::Atanh => "atanh", + Mf::Radians => "radians", + Mf::Degrees => "degrees", + Mf::Ceil => "ceil", + Mf::Floor => "floor", + Mf::Round => "round", + Mf::Fract => "fract", + Mf::Trunc => "trunc", + Mf::Modf => "modf", + Mf::Frexp => "frexp", + Mf::Ldexp => "ldexp", + Mf::Exp => "exp", + Mf::Exp2 => "exp2", + Mf::Log => "log", + Mf::Log2 => "log2", + Mf::Pow => "pow", + Mf::Dot => "dot", + Mf::Cross => "cross", + Mf::Distance => "distance", + Mf::Length => "length", + Mf::Normalize => "normalize", + Mf::FaceForward => "faceForward", + Mf::Reflect => "reflect", + Mf::Refract => "refract", + Mf::Sign => "sign", + Mf::Fma => "fma", + Mf::Mix => "mix", + Mf::Step => "step", + Mf::SmoothStep => "smoothstep", + Mf::Sqrt => "sqrt", + Mf::InverseSqrt => "inverseSqrt", + Mf::Transpose => "transpose", + Mf::Determinant => "determinant", + Mf::QuantizeToF16 => "quantizeToF16", + Mf::CountTrailingZeros => "countTrailingZeros", + Mf::CountLeadingZeros => "countLeadingZeros", + Mf::CountOneBits => "countOneBits", + Mf::ReverseBits => "reverseBits", + Mf::ExtractBits => "extractBits", + Mf::InsertBits => "insertBits", + Mf::FirstTrailingBit => "firstTrailingBit", + Mf::FirstLeadingBit => "firstLeadingBit", + Mf::Pack4x8snorm => "pack4x8snorm", + Mf::Pack4x8unorm => "pack4x8unorm", + Mf::Pack2x16snorm => "pack2x16snorm", + Mf::Pack2x16unorm => "pack2x16unorm", + Mf::Pack2x16float => "pack2x16float", + Mf::Pack4xI8 => "pack4xI8", + Mf::Pack4xU8 => "pack4xU8", + Mf::Unpack4x8snorm => "unpack4x8snorm", + Mf::Unpack4x8unorm => "unpack4x8unorm", + Mf::Unpack2x16snorm => "unpack2x16snorm", + Mf::Unpack2x16unorm => "unpack2x16unorm", + Mf::Unpack2x16float => "unpack2x16float", + Mf::Unpack4xI8 => "unpack4xI8", + Mf::Unpack4xU8 => "unpack4xU8", + + // Non-standard math functions. + Mf::Inverse | Mf::Outer => return None, + }) + } +} + +impl TryToWgsl for crate::BuiltIn { + const DESCRIPTION: &'static str = "builtin value"; + + fn try_to_wgsl(self) -> Option<&'static str> { + use crate::BuiltIn as Bi; + Some(match self { + Bi::Position { .. } => "position", + Bi::ViewIndex => "view_index", + Bi::InstanceIndex => "instance_index", + Bi::VertexIndex => "vertex_index", + Bi::FragDepth => "frag_depth", + Bi::FrontFacing => "front_facing", + Bi::PrimitiveIndex => "primitive_index", + Bi::SampleIndex => "sample_index", + Bi::SampleMask => "sample_mask", + Bi::GlobalInvocationId => "global_invocation_id", + Bi::LocalInvocationId => "local_invocation_id", + Bi::LocalInvocationIndex => "local_invocation_index", + Bi::WorkGroupId => "workgroup_id", + Bi::NumWorkGroups => "num_workgroups", + Bi::NumSubgroups => "num_subgroups", + Bi::SubgroupId => "subgroup_id", + Bi::SubgroupSize => "subgroup_size", + Bi::SubgroupInvocationId => "subgroup_invocation_id", + + // Non-standard built-ins. + Bi::BaseInstance + | Bi::BaseVertex + | Bi::ClipDistance + | Bi::CullDistance + | Bi::PointSize + | Bi::DrawID + | Bi::PointCoord + | Bi::WorkGroupSize => return None, + }) + } +} + +impl ToWgsl for crate::Interpolation { + fn to_wgsl(self) -> &'static str { + match self { + crate::Interpolation::Perspective => "perspective", + crate::Interpolation::Linear => "linear", + crate::Interpolation::Flat => "flat", + } + } +} + +impl ToWgsl for crate::Sampling { + fn to_wgsl(self) -> &'static str { + match self { + crate::Sampling::Center => "center", + crate::Sampling::Centroid => "centroid", + crate::Sampling::Sample => "sample", + crate::Sampling::First => "first", + crate::Sampling::Either => "either", + } + } +} + +impl ToWgsl for crate::StorageFormat { + fn to_wgsl(self) -> &'static str { + use crate::StorageFormat as Sf; + + match self { + Sf::R8Unorm => "r8unorm", + Sf::R8Snorm => "r8snorm", + Sf::R8Uint => "r8uint", + Sf::R8Sint => "r8sint", + Sf::R16Uint => "r16uint", + Sf::R16Sint => "r16sint", + Sf::R16Float => "r16float", + Sf::Rg8Unorm => "rg8unorm", + Sf::Rg8Snorm => "rg8snorm", + Sf::Rg8Uint => "rg8uint", + Sf::Rg8Sint => "rg8sint", + Sf::R32Uint => "r32uint", + Sf::R32Sint => "r32sint", + Sf::R32Float => "r32float", + Sf::Rg16Uint => "rg16uint", + Sf::Rg16Sint => "rg16sint", + Sf::Rg16Float => "rg16float", + Sf::Rgba8Unorm => "rgba8unorm", + Sf::Rgba8Snorm => "rgba8snorm", + Sf::Rgba8Uint => "rgba8uint", + Sf::Rgba8Sint => "rgba8sint", + Sf::Bgra8Unorm => "bgra8unorm", + Sf::Rgb10a2Uint => "rgb10a2uint", + Sf::Rgb10a2Unorm => "rgb10a2unorm", + Sf::Rg11b10Ufloat => "rg11b10float", + Sf::R64Uint => "r64uint", + Sf::Rg32Uint => "rg32uint", + Sf::Rg32Sint => "rg32sint", + Sf::Rg32Float => "rg32float", + Sf::Rgba16Uint => "rgba16uint", + Sf::Rgba16Sint => "rgba16sint", + Sf::Rgba16Float => "rgba16float", + Sf::Rgba32Uint => "rgba32uint", + Sf::Rgba32Sint => "rgba32sint", + Sf::Rgba32Float => "rgba32float", + Sf::R16Unorm => "r16unorm", + Sf::R16Snorm => "r16snorm", + Sf::Rg16Unorm => "rg16unorm", + Sf::Rg16Snorm => "rg16snorm", + Sf::Rgba16Unorm => "rgba16unorm", + Sf::Rgba16Snorm => "rgba16snorm", + } + } +} + +impl TryToWgsl for crate::Scalar { + const DESCRIPTION: &'static str = "scalar type"; + + fn try_to_wgsl(self) -> Option<&'static str> { + use crate::Scalar; + + Some(match self { + Scalar::F64 => "f64", + Scalar::F32 => "f32", + Scalar::I32 => "i32", + Scalar::U32 => "u32", + Scalar::I64 => "i64", + Scalar::U64 => "u64", + Scalar::BOOL => "bool", + _ => return None, + }) + } +} + +impl ToWgsl for crate::ImageDimension { + fn to_wgsl(self) -> &'static str { + use crate::ImageDimension as IDim; + + match self { + IDim::D1 => "1d", + IDim::D2 => "2d", + IDim::D3 => "3d", + IDim::Cube => "cube", + } + } +} + +/// Return the WGSL address space and access mode strings for `space`. +/// +/// Why don't we implement [`ToWgsl`] for [`AddressSpace`]? +/// +/// In WGSL, the full form of a pointer type is `ptr`, where: +/// - `AS` is the address space, +/// - `T` is the store type, and +/// - `AM` is the access mode. +/// +/// Since the type `T` intervenes between the address space and the +/// access mode, there isn't really any individual WGSL grammar +/// production that corresponds to an [`AddressSpace`], so [`ToWgsl`] +/// is too simple-minded for this case. +/// +/// Furthermore, we want to write `var` for most address +/// spaces, but we want to just write `var foo: T` for handle types. +/// +/// [`AddressSpace`]: crate::AddressSpace +pub const fn address_space_str( + space: crate::AddressSpace, +) -> (Option<&'static str>, Option<&'static str>) { + use crate::AddressSpace as As; + + ( + Some(match space { + As::Private => "private", + As::Uniform => "uniform", + As::Storage { access } => { + if access.contains(crate::StorageAccess::ATOMIC) { + return (Some("storage"), Some("atomic")); + } else if access.contains(crate::StorageAccess::STORE) { + return (Some("storage"), Some("read_write")); + } else { + "storage" + } + } + As::PushConstant => "push_constant", + As::WorkGroup => "workgroup", + As::Handle => return (None, None), + As::Function => "function", + }), + None, + ) +} diff --git a/third_party/rust/naga/src/compact/expressions.rs b/third_party/rust/naga/src/compact/expressions.rs index 7ddb46619e42..d1b800a93f77 100644 --- a/third_party/rust/naga/src/compact/expressions.rs +++ b/third_party/rust/naga/src/compact/expressions.rs @@ -185,6 +185,12 @@ impl ExpressionTracer<'_> { Iq::NumLevels | Iq::NumLayers | Iq::NumSamples => {} } } + Ex::RayQueryVertexPositions { + query, + committed: _, + } => { + self.expressions_used.insert(query); + } Ex::Unary { op: _, expr } => { self.expressions_used.insert(expr); } @@ -402,6 +408,10 @@ impl ModuleMap { ref mut query, committed: _, } => adjust(query), + Ex::RayQueryVertexPositions { + ref mut query, + committed: _, + } => adjust(query), } } diff --git a/third_party/rust/naga/src/compact/functions.rs b/third_party/rust/naga/src/compact/functions.rs index b37edd727139..57f6f104f21b 100644 --- a/third_party/rust/naga/src/compact/functions.rs +++ b/third_party/rust/naga/src/compact/functions.rs @@ -101,7 +101,7 @@ impl FunctionMap { self.expressions.adjust(&mut handle); reuse.insert(handle, name); } - std::mem::swap(&mut function.named_expressions, reuse); + core::mem::swap(&mut function.named_expressions, reuse); assert!(reuse.is_empty()); // Adjust statements. diff --git a/third_party/rust/naga/src/compact/handle_set_map.rs b/third_party/rust/naga/src/compact/handle_set_map.rs index 29ae89e909d8..5e80b954f1b9 100644 --- a/third_party/rust/naga/src/compact/handle_set_map.rs +++ b/third_party/rust/naga/src/compact/handle_set_map.rs @@ -1,3 +1,5 @@ +use alloc::vec::Vec; + use crate::arena::{Arena, Handle, HandleSet, Range}; type Index = crate::non_max_u32::NonMaxU32; @@ -12,7 +14,7 @@ pub struct HandleMap { new_index: Vec>, /// This type is indexed by values of type `T`. - as_keys: std::marker::PhantomData, + as_keys: core::marker::PhantomData, } impl HandleMap { @@ -34,7 +36,7 @@ impl HandleMap { } }) .collect(), - as_keys: std::marker::PhantomData, + as_keys: core::marker::PhantomData, } } @@ -50,7 +52,7 @@ impl HandleMap { pub fn try_adjust(&self, old: Handle) -> Option> { log::trace!( "adjusting {} handle [{}] -> [{:?}]", - std::any::type_name::(), + core::any::type_name::(), old.index(), self.new_index[old.index()] ); diff --git a/third_party/rust/naga/src/compact/mod.rs b/third_party/rust/naga/src/compact/mod.rs index f889a8e1b9d2..ee3d5d3f6055 100644 --- a/third_party/rust/naga/src/compact/mod.rs +++ b/third_party/rust/naga/src/compact/mod.rs @@ -4,10 +4,15 @@ mod handle_set_map; mod statements; mod types; +use alloc::vec::Vec; + use crate::arena::HandleSet; use crate::{arena, compact::functions::FunctionTracer}; use handle_set_map::HandleMap; +#[cfg(test)] +use alloc::{format, string::ToString}; + /// Remove unused types, expressions, and constants from `module`. /// /// Assume that the following are used by definition: @@ -312,6 +317,7 @@ impl<'module> ModuleTracer<'module> { let crate::SpecialTypes { ref ray_desc, ref ray_intersection, + ref ray_vertex_return, ref predeclared_types, } = *special_types; @@ -321,6 +327,9 @@ impl<'module> ModuleTracer<'module> { if let Some(ray_intersection) = *ray_intersection { self.types_used.insert(ray_intersection); } + if let Some(ray_vertex_return) = *ray_vertex_return { + self.types_used.insert(ray_vertex_return); + } for (_, &handle) in predeclared_types { self.types_used.insert(handle); } @@ -344,7 +353,7 @@ impl<'module> ModuleTracer<'module> { let mut max_dep = Vec::with_capacity(self.module.types.len()); let mut previous = None; for (_handle, ty) in self.module.types.iter() { - previous = std::cmp::max( + previous = core::cmp::max( previous, match ty.inner { crate::TypeInner::Array { size, .. } @@ -457,6 +466,7 @@ impl ModuleMap { let crate::SpecialTypes { ref mut ray_desc, ref mut ray_intersection, + ref mut ray_vertex_return, ref mut predeclared_types, } = *special; @@ -467,6 +477,10 @@ impl ModuleMap { self.types.adjust(ray_intersection); } + if let Some(ref mut ray_vertex_return) = *ray_vertex_return { + self.types.adjust(ray_vertex_return); + } + for handle in predeclared_types.values_mut() { self.types.adjust(handle); } diff --git a/third_party/rust/naga/src/compact/statements.rs b/third_party/rust/naga/src/compact/statements.rs index 08b1ea9757ad..32a8130fd32d 100644 --- a/third_party/rust/naga/src/compact/statements.rs +++ b/third_party/rust/naga/src/compact/statements.rs @@ -1,3 +1,5 @@ +use alloc::{vec, vec::Vec}; + use super::functions::FunctionTracer; use super::FunctionMap; use crate::arena::Handle; diff --git a/third_party/rust/naga/src/compact/types.rs b/third_party/rust/naga/src/compact/types.rs index cde1352d396d..293256826804 100644 --- a/third_party/rust/naga/src/compact/types.rs +++ b/third_party/rust/naga/src/compact/types.rs @@ -20,8 +20,8 @@ impl TypeTracer<'_> { | Ti::ValuePointer { .. } | Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery => {} + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } => {} // Types that do contain handles. Ti::Array { @@ -75,8 +75,8 @@ impl ModuleMap { | Ti::ValuePointer { .. } | Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery => {} + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } => {} // Types that do contain handles. Ti::Pointer { diff --git a/third_party/rust/naga/src/diagnostic_filter.rs b/third_party/rust/naga/src/diagnostic_filter.rs index 2fa5464cdfb9..37fb9261213a 100644 --- a/third_party/rust/naga/src/diagnostic_filter.rs +++ b/third_party/rust/naga/src/diagnostic_filter.rs @@ -1,8 +1,11 @@ //! [`DiagnosticFilter`]s and supporting functionality. +use alloc::boxed::Box; + +use crate::{Arena, Handle}; + #[cfg(feature = "wgsl-in")] use crate::Span; -use crate::{Arena, Handle}; #[cfg(feature = "arbitrary")] use arbitrary::Arbitrary; #[cfg(feature = "wgsl-in")] diff --git a/third_party/rust/naga/src/error.rs b/third_party/rust/naga/src/error.rs index 21c1a13d3c4a..dbc99651ff9a 100644 --- a/third_party/rust/naga/src/error.rs +++ b/third_party/rust/naga/src/error.rs @@ -1,4 +1,5 @@ -use std::{error::Error, fmt}; +use alloc::{boxed::Box, string::String, vec::Vec}; +use core::{error::Error, fmt}; #[derive(Clone, Debug)] pub struct ShaderError { diff --git a/third_party/rust/naga/src/front/atomic_upgrade.rs b/third_party/rust/naga/src/front/atomic_upgrade.rs index 529883ae4108..549fcf69abd5 100644 --- a/third_party/rust/naga/src/front/atomic_upgrade.rs +++ b/third_party/rust/naga/src/front/atomic_upgrade.rs @@ -30,7 +30,9 @@ //! [`Struct`]: TypeInner::Struct //! [`Load`]: crate::Expression::Load //! [`Store`]: crate::Statement::Store -use std::sync::{atomic::AtomicUsize, Arc}; + +use alloc::{format, sync::Arc}; +use core::sync::atomic::AtomicUsize; use crate::{GlobalVariable, Handle, Module, Type, TypeInner}; @@ -51,9 +53,9 @@ pub enum Error { #[derive(Clone, Default)] struct Padding(Arc); -impl std::fmt::Display for Padding { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - for _ in 0..self.0.load(std::sync::atomic::Ordering::Relaxed) { +impl core::fmt::Display for Padding { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + for _ in 0..self.0.load(core::sync::atomic::Ordering::Relaxed) { f.write_str(" ")?; } Ok(()) @@ -62,25 +64,25 @@ impl std::fmt::Display for Padding { impl Drop for Padding { fn drop(&mut self) { - let _ = self.0.fetch_sub(1, std::sync::atomic::Ordering::Relaxed); + let _ = self.0.fetch_sub(1, core::sync::atomic::Ordering::Relaxed); } } impl Padding { - fn trace(&self, msg: impl std::fmt::Display, t: impl std::fmt::Debug) { + fn trace(&self, msg: impl core::fmt::Display, t: impl core::fmt::Debug) { format!("{msg} {t:#?}") .split('\n') .for_each(|ln| log::trace!("{self}{ln}")); } - fn debug(&self, msg: impl std::fmt::Display, t: impl std::fmt::Debug) { + fn debug(&self, msg: impl core::fmt::Display, t: impl core::fmt::Debug) { format!("{msg} {t:#?}") .split('\n') .for_each(|ln| log::debug!("{self}{ln}")); } fn inc_padding(&self) -> Padding { - let _ = self.0.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + let _ = self.0.fetch_add(1, core::sync::atomic::Ordering::Relaxed); self.clone() } } diff --git a/third_party/rust/naga/src/front/glsl/ast.rs b/third_party/rust/naga/src/front/glsl/ast.rs index 78f5e2cb099a..cd1102c473ee 100644 --- a/third_party/rust/naga/src/front/glsl/ast.rs +++ b/third_party/rust/naga/src/front/glsl/ast.rs @@ -1,4 +1,5 @@ -use std::{borrow::Cow, fmt}; +use alloc::{borrow::Cow, string::String, vec::Vec}; +use core::fmt; use super::{builtins::MacroCall, Span}; use crate::{ diff --git a/third_party/rust/naga/src/front/glsl/builtins.rs b/third_party/rust/naga/src/front/glsl/builtins.rs index 94594f6cbaea..502da8a20c19 100644 --- a/third_party/rust/naga/src/front/glsl/builtins.rs +++ b/third_party/rust/naga/src/front/glsl/builtins.rs @@ -1,3 +1,5 @@ +use alloc::{vec, vec::Vec}; + use super::{ ast::{ BuiltinVariations, FunctionDeclaration, FunctionKind, Overload, ParameterInfo, diff --git a/third_party/rust/naga/src/front/glsl/context.rs b/third_party/rust/naga/src/front/glsl/context.rs index 04e89e839704..5296c4f28c0f 100644 --- a/third_party/rust/naga/src/front/glsl/context.rs +++ b/third_party/rust/naga/src/front/glsl/context.rs @@ -1,3 +1,6 @@ +use alloc::{format, string::String, vec::Vec}; +use core::ops::Index; + use super::{ ast::{ GlobalLookup, GlobalLookupKind, HirExpr, HirExprKind, ParameterInfo, ParameterQualifier, @@ -12,7 +15,6 @@ use crate::{ Expression, FastHashMap, FunctionArgument, Handle, Literal, LocalVariable, RelationalFunction, Scalar, Span, Statement, Type, TypeInner, VectorSize, }; -use std::ops::Index; /// The position at which an expression is, used while lowering #[derive(Clone, Copy, PartialEq, Eq, Debug)] @@ -136,10 +138,10 @@ impl<'a> Context<'a> { F: FnOnce(&mut Self) -> Result, { self.emit_restart(); - let old_body = std::mem::replace(&mut self.body, Block::new()); + let old_body = core::mem::replace(&mut self.body, Block::new()); let res = cb(self); self.emit_restart(); - let new_body = std::mem::replace(&mut self.body, old_body); + let new_body = core::mem::replace(&mut self.body, old_body); res.map(|r| (new_body, r)) } @@ -148,10 +150,10 @@ impl<'a> Context<'a> { F: FnOnce(&mut Self) -> Result<()>, { self.emit_restart(); - let old_body = std::mem::replace(&mut self.body, body); + let old_body = core::mem::replace(&mut self.body, body); let res = cb(self); self.emit_restart(); - let body = std::mem::replace(&mut self.body, old_body); + let body = core::mem::replace(&mut self.body, old_body); res.map(|_| body) } @@ -1103,14 +1105,14 @@ impl<'a> Context<'a> { .and_then(|scalar| Some((type_power(scalar)?, scalar))), ) { match accept_power.cmp(&reject_power) { - std::cmp::Ordering::Less => { + core::cmp::Ordering::Less => { accept_body = self.with_body(accept_body, |ctx| { ctx.conversion(&mut accept, accept_meta, reject_scalar)?; Ok(()) })?; } - std::cmp::Ordering::Equal => {} - std::cmp::Ordering::Greater => { + core::cmp::Ordering::Equal => {} + core::cmp::Ordering::Greater => { reject_body = self.with_body(reject_body, |ctx| { ctx.conversion(&mut reject, reject_meta, accept_scalar)?; Ok(()) @@ -1256,7 +1258,7 @@ impl<'a> Context<'a> { right = self.add_expression( Expression::Compose { ty, - components: std::iter::repeat(right).take(cols as usize).collect(), + components: core::iter::repeat(right).take(cols as usize).collect(), }, meta, )?; @@ -1428,11 +1430,11 @@ impl<'a> Context<'a> { right_components.and_then(|scalar| Some((type_power(scalar)?, scalar))), ) { match left_power.cmp(&right_power) { - std::cmp::Ordering::Less => { + core::cmp::Ordering::Less => { self.conversion(left, left_meta, right_scalar)?; } - std::cmp::Ordering::Equal => {} - std::cmp::Ordering::Greater => { + core::cmp::Ordering::Equal => {} + core::cmp::Ordering::Greater => { self.conversion(right, right_meta, left_scalar)?; } } diff --git a/third_party/rust/naga/src/front/glsl/error.rs b/third_party/rust/naga/src/front/glsl/error.rs index 92962db00d73..c0927e98a4c4 100644 --- a/third_party/rust/naga/src/front/glsl/error.rs +++ b/third_party/rust/naga/src/front/glsl/error.rs @@ -1,14 +1,21 @@ -use super::token::TokenValue; -use crate::SourceLocation; -use crate::{proc::ConstantEvaluatorError, Span}; +use alloc::{ + borrow::Cow, + string::{String, ToString}, + vec, + vec::Vec, +}; + use codespan_reporting::diagnostic::{Diagnostic, Label}; use codespan_reporting::files::SimpleFile; use codespan_reporting::term; use pp_rs::token::PreprocessorError; -use std::borrow::Cow; use termcolor::{NoColor, WriteColor}; use thiserror::Error; +use super::token::TokenValue; +use crate::SourceLocation; +use crate::{proc::ConstantEvaluatorError, Span}; + fn join_with_comma(list: &[ExpectedToken]) -> String { let mut string = "".to_string(); for (i, val) in list.iter().enumerate() { @@ -45,8 +52,8 @@ impl From for ExpectedToken { ExpectedToken::Token(token) } } -impl std::fmt::Display for ExpectedToken { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for ExpectedToken { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match *self { ExpectedToken::Token(ref token) => write!(f, "{token:?}"), ExpectedToken::TypeName => write!(f, "a type"), @@ -180,14 +187,14 @@ impl ParseErrors { } } -impl std::fmt::Display for ParseErrors { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { +impl core::fmt::Display for ParseErrors { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { self.errors.iter().try_for_each(|e| write!(f, "{e:?}")) } } -impl std::error::Error for ParseErrors { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for ParseErrors { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { None } } diff --git a/third_party/rust/naga/src/front/glsl/functions.rs b/third_party/rust/naga/src/front/glsl/functions.rs index 0d05c5433c76..b1d43af4b6b7 100644 --- a/third_party/rust/naga/src/front/glsl/functions.rs +++ b/third_party/rust/naga/src/front/glsl/functions.rs @@ -1,3 +1,11 @@ +use alloc::{ + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::iter; + use super::{ ast::*, builtins::{inject_builtin, sampled_to_depth}, @@ -11,7 +19,6 @@ use crate::{ Expression, Function, FunctionArgument, FunctionResult, Handle, Literal, LocalVariable, Scalar, ScalarKind, Span, Statement, StructMember, Type, TypeInner, }; -use std::iter; /// Struct detailing a store operation that must happen after a function call struct ProxyWrite { @@ -282,7 +289,7 @@ impl Frontend { for i in 0..columns as u32 { if i < ori_cols as u32 { - use std::cmp::Ordering; + use core::cmp::Ordering; let vector = ctx.add_expression( Expression::AccessIndex { @@ -1230,7 +1237,7 @@ impl Frontend { + 3, ); - let global_init_body = std::mem::replace(&mut ctx.body, body); + let global_init_body = core::mem::replace(&mut ctx.body, body); for arg in self.entry_args.iter() { if arg.storage != StorageQualifier::Input { diff --git a/third_party/rust/naga/src/front/glsl/lex.rs b/third_party/rust/naga/src/front/glsl/lex.rs index b4ebef1b309f..9337491b5dae 100644 --- a/third_party/rust/naga/src/front/glsl/lex.rs +++ b/third_party/rust/naga/src/front/glsl/lex.rs @@ -1,13 +1,16 @@ +use alloc::string::String; + +use pp_rs::{ + pp::Preprocessor, + token::{PreprocessorError, Punct, TokenValue as PPTokenValue}, +}; + use super::{ ast::Precision, token::{Directive, DirectiveKind, Token, TokenValue}, types::parse_type, }; use crate::{FastHashMap, Span, StorageAccess}; -use pp_rs::{ - pp::Preprocessor, - token::{PreprocessorError, Punct, TokenValue as PPTokenValue}, -}; #[derive(Debug)] #[cfg_attr(test, derive(PartialEq))] @@ -200,6 +203,8 @@ impl Iterator for Lexer<'_> { #[cfg(test)] mod tests { + use alloc::vec; + use pp_rs::token::{Integer, Location, Token as PPToken, TokenValue as PPTokenValue}; use super::{ diff --git a/third_party/rust/naga/src/front/glsl/mod.rs b/third_party/rust/naga/src/front/glsl/mod.rs index ea202b244548..876add46a1c9 100644 --- a/third_party/rust/naga/src/front/glsl/mod.rs +++ b/third_party/rust/naga/src/front/glsl/mod.rs @@ -16,6 +16,8 @@ pub use ast::{Precision, Profile}; pub use error::{Error, ErrorKind, ExpectedToken, ParseErrors}; pub use token::TokenValue; +use alloc::{string::String, vec::Vec}; + use crate::{proc::Layouter, FastHashMap, FastHashSet, Handle, Module, ShaderStage, Span, Type}; use ast::{EntryArg, FunctionDeclaration, GlobalLookup}; use parser::ParsingContext; @@ -34,7 +36,7 @@ mod token; mod types; mod variables; -type Result = std::result::Result; +type Result = core::result::Result; /// Per-shader options passed to [`parse`](Frontend::parse). /// @@ -196,7 +198,7 @@ impl Frontend { &mut self, options: &Options, source: &str, - ) -> std::result::Result { + ) -> core::result::Result { self.reset(options.stage); let lexer = lex::Lexer::new(source, &options.defines); @@ -207,12 +209,12 @@ impl Frontend { if self.errors.is_empty() { Ok(module) } else { - Err(std::mem::take(&mut self.errors).into()) + Err(core::mem::take(&mut self.errors).into()) } } Err(e) => { self.errors.push(e); - Err(std::mem::take(&mut self.errors).into()) + Err(core::mem::take(&mut self.errors).into()) } } } diff --git a/third_party/rust/naga/src/front/glsl/offset.rs b/third_party/rust/naga/src/front/glsl/offset.rs index 6e8d5ada107a..b17dbbecd0a3 100644 --- a/third_party/rust/naga/src/front/glsl/offset.rs +++ b/third_party/rust/naga/src/front/glsl/offset.rs @@ -11,6 +11,8 @@ The OpenGl spec (the layout rules are defined by the OpenGl spec in section equivalent to bytes. */ +use alloc::vec::Vec; + use super::{ ast::StructLayout, error::{Error, ErrorKind}, diff --git a/third_party/rust/naga/src/front/glsl/parser.rs b/third_party/rust/naga/src/front/glsl/parser.rs index d9ddeab932d0..2eb3ec4b0097 100644 --- a/third_party/rust/naga/src/front/glsl/parser.rs +++ b/third_party/rust/naga/src/front/glsl/parser.rs @@ -1,3 +1,8 @@ +use alloc::{string::String, vec}; +use core::iter::Peekable; + +use pp_rs::token::{PreprocessorError, Token as PPToken, TokenValue as PPTokenValue}; + use super::{ ast::{FunctionKind, Profile, TypeQualifiers}, context::{Context, ExprPos}, @@ -10,8 +15,6 @@ use super::{ Frontend, Result, }; use crate::{arena::Handle, proc::U32EvalError, Expression, Module, Span, Type}; -use pp_rs::token::{PreprocessorError, Token as PPToken, TokenValue as PPTokenValue}; -use std::iter::Peekable; mod declarations; mod expressions; diff --git a/third_party/rust/naga/src/front/glsl/parser/declarations.rs b/third_party/rust/naga/src/front/glsl/parser/declarations.rs index 1c5c151b5b09..f06482675163 100644 --- a/third_party/rust/naga/src/front/glsl/parser/declarations.rs +++ b/third_party/rust/naga/src/front/glsl/parser/declarations.rs @@ -1,3 +1,6 @@ +use alloc::{string::String, vec, vec::Vec}; + +use super::{DeclarationContext, ParsingContext, Result}; use crate::{ front::glsl::{ ast::{ @@ -17,8 +20,6 @@ use crate::{ Type, TypeInner, }; -use super::{DeclarationContext, ParsingContext, Result}; - /// Helper method used to retrieve the child type of `ty` at /// index `i`. /// diff --git a/third_party/rust/naga/src/front/glsl/parser/expressions.rs b/third_party/rust/naga/src/front/glsl/parser/expressions.rs index d08625d717ed..524863df5ee2 100644 --- a/third_party/rust/naga/src/front/glsl/parser/expressions.rs +++ b/third_party/rust/naga/src/front/glsl/parser/expressions.rs @@ -1,4 +1,5 @@ -use std::num::NonZeroU32; +use alloc::{vec, vec::Vec}; +use core::num::NonZeroU32; use crate::{ front::glsl::{ diff --git a/third_party/rust/naga/src/front/glsl/parser/functions.rs b/third_party/rust/naga/src/front/glsl/parser/functions.rs index e9028c419b96..441e99130a0b 100644 --- a/third_party/rust/naga/src/front/glsl/parser/functions.rs +++ b/third_party/rust/naga/src/front/glsl/parser/functions.rs @@ -1,3 +1,5 @@ +use alloc::{vec, vec::Vec}; + use crate::front::glsl::context::ExprPos; use crate::front::glsl::Span; use crate::Literal; diff --git a/third_party/rust/naga/src/front/glsl/parser/types.rs b/third_party/rust/naga/src/front/glsl/parser/types.rs index 501d53805c04..0d801443544a 100644 --- a/third_party/rust/naga/src/front/glsl/parser/types.rs +++ b/third_party/rust/naga/src/front/glsl/parser/types.rs @@ -1,4 +1,5 @@ -use std::num::NonZeroU32; +use alloc::{vec, vec::Vec}; +use core::num::NonZeroU32; use crate::{ front::glsl::{ diff --git a/third_party/rust/naga/src/front/glsl/parser_tests.rs b/third_party/rust/naga/src/front/glsl/parser_tests.rs index 135765ca58d0..6fdd1e39715d 100644 --- a/third_party/rust/naga/src/front/glsl/parser_tests.rs +++ b/third_party/rust/naga/src/front/glsl/parser_tests.rs @@ -1,3 +1,7 @@ +use alloc::{borrow::ToOwned, vec}; + +use pp_rs::token::PreprocessorError; + use super::{ ast::Profile, error::ExpectedToken, @@ -6,7 +10,9 @@ use super::{ Frontend, Options, Span, }; use crate::ShaderStage; -use pp_rs::token::PreprocessorError; + +#[cfg(test)] +use std::println; #[test] fn version() { diff --git a/third_party/rust/naga/src/front/glsl/token.rs b/third_party/rust/naga/src/front/glsl/token.rs index 303723a27b5d..78c23c56c29a 100644 --- a/third_party/rust/naga/src/front/glsl/token.rs +++ b/third_party/rust/naga/src/front/glsl/token.rs @@ -1,5 +1,7 @@ pub use pp_rs::token::{Float, Integer, Location, Token as PPToken}; +use alloc::{string::String, vec::Vec}; + use super::ast::Precision; use crate::{Interpolation, Sampling, Span, Type}; diff --git a/third_party/rust/naga/src/front/glsl/types.rs b/third_party/rust/naga/src/front/glsl/types.rs index ad5e188fd956..72b10a62a9f5 100644 --- a/third_party/rust/naga/src/front/glsl/types.rs +++ b/third_party/rust/naga/src/front/glsl/types.rs @@ -1,3 +1,5 @@ +use alloc::format; + use super::{context::Context, Error, ErrorKind, Result, Span}; use crate::{ proc::ResolveContext, Expression, Handle, ImageClass, ImageDimension, Scalar, ScalarKind, Type, diff --git a/third_party/rust/naga/src/front/glsl/variables.rs b/third_party/rust/naga/src/front/glsl/variables.rs index 23a4141e97c9..3fd31baef1ef 100644 --- a/third_party/rust/naga/src/front/glsl/variables.rs +++ b/third_party/rust/naga/src/front/glsl/variables.rs @@ -1,3 +1,5 @@ +use alloc::{format, string::String, vec::Vec}; + use super::{ ast::*, context::{Context, ExprPos}, diff --git a/third_party/rust/naga/src/front/mod.rs b/third_party/rust/naga/src/front/mod.rs index 11c8aa047e1d..9480e69aa269 100644 --- a/third_party/rust/naga/src/front/mod.rs +++ b/third_party/rust/naga/src/front/mod.rs @@ -14,12 +14,14 @@ pub mod spv; #[cfg(feature = "wgsl-in")] pub mod wgsl; +use alloc::{vec, vec::Vec}; +use core::ops; + use crate::{ arena::{Arena, Handle, HandleVec, UniqueArena}, proc::{ResolveContext, ResolveError, TypeResolution}, FastHashMap, }; -use std::ops; /// A table of types for an `Arena`. /// @@ -262,7 +264,7 @@ impl SymbolTable { impl SymbolTable where - Name: std::hash::Hash + Eq, + Name: core::hash::Hash + Eq, { /// Perform a lookup for a variable named `name`. /// @@ -272,8 +274,8 @@ where /// scope. pub fn lookup(&self, name: &Q) -> Option<&Var> where - Name: std::borrow::Borrow, - Q: std::hash::Hash + Eq + ?Sized, + Name: core::borrow::Borrow, + Q: core::hash::Hash + Eq + ?Sized, { // Iterate backwards through the scopes and try to find the variable for scope in self.scopes[..self.cursor].iter().rev() { @@ -318,7 +320,7 @@ impl Default for SymbolTable { } } -use std::fmt; +use core::fmt; impl fmt::Debug for SymbolTable { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/third_party/rust/naga/src/front/spv/convert.rs b/third_party/rust/naga/src/front/spv/convert.rs index 6baf74225cb7..3e68c7bee213 100644 --- a/third_party/rust/naga/src/front/spv/convert.rs +++ b/third_party/rust/naga/src/front/spv/convert.rs @@ -1,5 +1,6 @@ +use core::convert::TryInto; + use super::error::Error; -use std::convert::TryInto; pub(super) const fn map_binary_operator(word: spirv::Op) -> Result { use crate::BinaryOperator; diff --git a/third_party/rust/naga/src/front/spv/error.rs b/third_party/rust/naga/src/front/spv/error.rs index 898113d44692..42b1bca086c4 100644 --- a/third_party/rust/naga/src/front/spv/error.rs +++ b/third_party/rust/naga/src/front/spv/error.rs @@ -1,10 +1,17 @@ -use super::ModuleState; -use crate::{arena::Handle, front::atomic_upgrade}; +use alloc::{ + format, + string::{String, ToString}, + vec::Vec, +}; + use codespan_reporting::diagnostic::Diagnostic; use codespan_reporting::files::SimpleFile; use codespan_reporting::term; use termcolor::{NoColor, WriteColor}; +use super::ModuleState; +use crate::{arena::Handle, front::atomic_upgrade}; + #[derive(Clone, Debug, thiserror::Error)] pub enum Error { #[error("invalid header")] diff --git a/third_party/rust/naga/src/front/spv/function.rs b/third_party/rust/naga/src/front/spv/function.rs index b780cbe775e3..fe56ba833b2f 100644 --- a/third_party/rust/naga/src/front/spv/function.rs +++ b/third_party/rust/naga/src/front/spv/function.rs @@ -1,11 +1,12 @@ +use alloc::{format, vec, vec::Vec}; + +use super::{Error, Instruction, LookupExpression, LookupHelper as _}; +use crate::proc::Emitter; use crate::{ arena::{Arena, Handle}, front::spv::{BlockContext, BodyIndex}, }; -use super::{Error, Instruction, LookupExpression, LookupHelper as _}; -use crate::proc::Emitter; - pub type BlockId = u32; impl> super::Frontend { @@ -643,7 +644,7 @@ impl BlockContext<'_> { let body = lower_impl(blocks, bodies, body_idx); // Handle simple cases that would make a fallthrough statement unreachable code - let fall_through = body.last().map_or(true, |s| !s.is_terminator()); + let fall_through = body.last().is_none_or(|s| !s.is_terminator()); crate::SwitchCase { value: crate::SwitchValue::I32(value), diff --git a/third_party/rust/naga/src/front/spv/image.rs b/third_party/rust/naga/src/front/spv/image.rs index ace97d4dd5e9..8650c89adfc1 100644 --- a/third_party/rust/naga/src/front/spv/image.rs +++ b/third_party/rust/naga/src/front/spv/image.rs @@ -1,3 +1,5 @@ +use alloc::vec::Vec; + use crate::{ arena::{Handle, UniqueArena}, Scalar, diff --git a/third_party/rust/naga/src/front/spv/mod.rs b/third_party/rust/naga/src/front/spv/mod.rs index d34edf367e1e..0b512eab40ea 100644 --- a/third_party/rust/naga/src/front/spv/mod.rs +++ b/third_party/rust/naga/src/front/spv/mod.rs @@ -33,20 +33,22 @@ mod function; mod image; mod null; -use convert::*; pub use error::Error; -use function::*; +use alloc::{borrow::ToOwned, format, string::String, vec, vec::Vec}; +use core::{convert::TryInto, mem, num::NonZeroU32}; +use std::path::PathBuf; + +use petgraph::graphmap::GraphMap; + +use super::atomic_upgrade::Upgrades; use crate::{ arena::{Arena, Handle, UniqueArena}, proc::{Alignment, Layouter}, FastHashMap, FastHashSet, FastIndexMap, }; - -use petgraph::graphmap::GraphMap; -use std::{convert::TryInto, mem, num::NonZeroU32, path::PathBuf}; - -use super::atomic_upgrade::Upgrades; +use convert::*; +use function::*; pub const SUPPORTED_CAPABILITIES: &[spirv::Capability] = &[ spirv::Capability::Shader, @@ -702,7 +704,7 @@ impl> Frontend { break; } } - std::str::from_utf8(&self.temp_bytes) + core::str::from_utf8(&self.temp_bytes) .map(|s| (s.to_owned(), count)) .map_err(|_| Error::BadString) } @@ -3846,6 +3848,10 @@ impl> Frontend { .bits() != 0, ); + flags.set( + crate::Barrier::TEXTURE, + semantics & spirv::MemorySemantics::IMAGE_MEMORY.bits() != 0, + ); block.push(crate::Statement::Barrier(flags), span); } else { log::warn!("Unsupported barrier execution scope: {}", exec_scope); @@ -6062,6 +6068,8 @@ fn is_parent(mut child: usize, parent: usize, block_ctx: &BlockContext) -> bool #[cfg(test)] mod test { + use alloc::vec; + #[test] fn parse() { let bin = vec![ diff --git a/third_party/rust/naga/src/front/spv/null.rs b/third_party/rust/naga/src/front/spv/null.rs index c7d3776841a7..8cd33f142f25 100644 --- a/third_party/rust/naga/src/front/spv/null.rs +++ b/third_party/rust/naga/src/front/spv/null.rs @@ -1,3 +1,5 @@ +use alloc::vec; + use super::Error; use crate::arena::{Arena, Handle}; diff --git a/third_party/rust/naga/src/front/type_gen.rs b/third_party/rust/naga/src/front/type_gen.rs index 2e75076239ee..687d245b1e4c 100644 --- a/third_party/rust/naga/src/front/type_gen.rs +++ b/third_party/rust/naga/src/front/type_gen.rs @@ -2,6 +2,8 @@ Type generators. */ +use alloc::{format, string::ToString, vec}; + use crate::{arena::Handle, span::Span}; impl crate::Module { @@ -102,6 +104,36 @@ impl crate::Module { handle } + /// Make sure the types for the vertex return are in the module's type + pub fn generate_vertex_return_type(&mut self) -> Handle { + if let Some(handle) = self.special_types.ray_vertex_return { + return handle; + } + let ty_vec3f = self.types.insert( + crate::Type { + name: None, + inner: crate::TypeInner::Vector { + size: crate::VectorSize::Tri, + scalar: crate::Scalar::F32, + }, + }, + Span::UNDEFINED, + ); + let array = self.types.insert( + crate::Type { + name: None, + inner: crate::TypeInner::Array { + base: ty_vec3f, + size: crate::ArraySize::Constant(core::num::NonZeroU32::new(3).unwrap()), + stride: 16, + }, + }, + Span::UNDEFINED, + ); + self.special_types.ray_vertex_return = Some(array); + array + } + /// Populate this module's [`SpecialTypes::ray_intersection`] type. /// /// [`SpecialTypes::ray_intersection`] is the type of a @@ -251,7 +283,7 @@ impl crate::Module { &mut self, special_type: crate::PredeclaredType, ) -> Handle { - use std::fmt::Write; + use core::fmt::Write; if let Some(value) = self.special_types.predeclared_types.get(&special_type) { return *value; diff --git a/third_party/rust/naga/src/front/wgsl/error.rs b/third_party/rust/naga/src/front/wgsl/error.rs index 7bdbf12d2c79..de45cd28126c 100644 --- a/third_party/rust/naga/src/front/wgsl/error.rs +++ b/third_party/rust/naga/src/front/wgsl/error.rs @@ -1,3 +1,19 @@ +use alloc::{ + borrow::Cow, + boxed::Box, + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::ops::Range; + +use codespan_reporting::diagnostic::{Diagnostic, Label}; +use codespan_reporting::files::SimpleFile; +use codespan_reporting::term; +use termcolor::{ColorChoice, NoColor, StandardStream}; +use thiserror::Error; + use crate::diagnostic_filter::ConflictingDiagnosticRuleError; use crate::front::wgsl::parse::directive::enable_extension::{ EnableExtension, UnimplementedEnableExtension, @@ -9,16 +25,6 @@ use crate::front::wgsl::parse::lexer::Token; use crate::front::wgsl::Scalar; use crate::proc::{Alignment, ConstantEvaluatorError, ResolveError}; use crate::{SourceLocation, Span}; -use codespan_reporting::diagnostic::{Diagnostic, Label}; -use codespan_reporting::files::SimpleFile; -use codespan_reporting::term; -use std::borrow::Cow; -use std::ops::Range; -use termcolor::{ColorChoice, NoColor, StandardStream}; -use thiserror::Error; - -#[cfg(test)] -use std::mem::size_of; #[derive(Clone, Debug)] pub struct ParseError { @@ -102,14 +108,14 @@ impl ParseError { } } -impl std::fmt::Display for ParseError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for ParseError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.message) } } -impl std::error::Error for ParseError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for ParseError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { None } } @@ -712,7 +718,7 @@ impl<'a> Error<'a> { ParseError { message: "invalid left-hand side of assignment".into(), - labels: std::iter::once((span, "cannot assign to this expression".into())) + labels: core::iter::once((span, "cannot assign to this expression".into())) .chain(extra_label) .collect(), notes, @@ -1100,7 +1106,7 @@ impl<'a> Error<'a> { ) }) .expect("internal error: diag. attr. rejection on empty map"); - std::iter::once(first) + core::iter::once(first) .chain(spans.map(|span| (span, "".into()))) .collect() }, diff --git a/third_party/rust/naga/src/front/wgsl/index.rs b/third_party/rust/naga/src/front/wgsl/index.rs index bc0af670ff00..7dafb6ef64a0 100644 --- a/third_party/rust/naga/src/front/wgsl/index.rs +++ b/third_party/rust/naga/src/front/wgsl/index.rs @@ -1,3 +1,5 @@ +use alloc::{vec, vec::Vec}; + use super::Error; use crate::front::wgsl::parse::ast; use crate::{FastHashMap, Handle, Span}; diff --git a/third_party/rust/naga/src/front/wgsl/lower/construction.rs b/third_party/rust/naga/src/front/wgsl/lower/construction.rs index 21317545bb74..b5fc3b66f0ec 100644 --- a/third_party/rust/naga/src/front/wgsl/lower/construction.rs +++ b/third_party/rust/naga/src/front/wgsl/lower/construction.rs @@ -1,10 +1,15 @@ -use std::num::NonZeroU32; - -use crate::front::wgsl::parse::ast; -use crate::{Handle, Span}; +use alloc::{ + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::num::NonZeroU32; use crate::front::wgsl::error::Error; use crate::front::wgsl::lower::{ExpressionContext, Lowerer}; +use crate::front::wgsl::parse::ast; +use crate::{Handle, Span}; /// A cooked form of `ast::ConstructorType` that uses Naga types whenever /// possible. @@ -300,7 +305,7 @@ impl<'source> Lowerer<'source, '_> { Constructor::Type((_, &crate::TypeInner::Vector { size, scalar })), ) => { ctx.convert_slice_to_common_leaf_scalar( - std::slice::from_mut(&mut component), + core::slice::from_mut(&mut component), scalar, )?; expr = crate::Expression::Splat { diff --git a/third_party/rust/naga/src/front/wgsl/lower/conversion.rs b/third_party/rust/naga/src/front/wgsl/lower/conversion.rs index f78bb3da27a3..58a7f391241e 100644 --- a/third_party/rust/naga/src/front/wgsl/lower/conversion.rs +++ b/third_party/rust/naga/src/front/wgsl/lower/conversion.rs @@ -1,5 +1,7 @@ //! WGSL's automatic conversions for abstract types. +use alloc::{boxed::Box, string::String, vec::Vec}; + use crate::front::wgsl::error::{ AutoConversionError, AutoConversionLeafScalarError, ConcretizationFailedError, }; @@ -440,8 +442,8 @@ impl crate::TypeInner { | Ti::Struct { .. } | Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } | Ti::BindingArray { .. } => None, } } @@ -466,8 +468,8 @@ impl crate::TypeInner { Ti::Struct { .. } | Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } | Ti::BindingArray { .. } => None, } } 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 7d8fbb7c80f4..36be28111168 100644 --- a/third_party/rust/naga/src/front/wgsl/lower/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/lower/mod.rs @@ -1,4 +1,9 @@ -use std::num::NonZeroU32; +use alloc::{ + borrow::ToOwned, + string::{String, ToString}, + vec::Vec, +}; +use core::num::NonZeroU32; use crate::front::wgsl::error::{Error, ExpectedToken, InvalidAssignmentType}; use crate::front::wgsl::index::Index; @@ -782,7 +787,7 @@ impl<'source, 'temp, 'out> ExpressionContext<'source, 'temp, 'out> { } struct ArgumentContext<'ctx, 'source> { - args: std::slice::Iter<'ctx, Handle>>, + args: core::slice::Iter<'ctx, Handle>>, min_args: u32, args_used: u32, total_args: u32, @@ -2035,10 +2040,18 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { } } - lowered_base.map(|base| match ctx.const_eval_expr_to_u32(index).ok() { - Some(index) => crate::Expression::AccessIndex { base, index }, - None => crate::Expression::Access { base, index }, - }) + lowered_base.try_map(|base| match ctx.const_eval_expr_to_u32(index).ok() { + Some(index) => Ok::<_, Error>(crate::Expression::AccessIndex { base, index }), + None => { + // When an abstract array value e is indexed by an expression + // that is not a const-expression, then the array is concretized + // before the index is applied. + // https://www.w3.org/TR/WGSL/#array-access-expr + // Also applies to vectors and matrices. + let base = ctx.concretize(base)?; + Ok(crate::Expression::Access { base, index }) + } + })? } ast::Expression::Member { base, ref field } => { let mut lowered_base = self.expression_for_reference(base, ctx)?; @@ -2157,13 +2170,37 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { // Apply automatic conversions. match op { - // Shift operators require the right operand to be `u32` or - // `vecN`. We can let the validator sort out vector length - // issues, but the right operand must be, or convert to, a u32 leaf - // scalar. crate::BinaryOperator::ShiftLeft | crate::BinaryOperator::ShiftRight => { + // Shift operators require the right operand to be `u32` or + // `vecN`. We can let the validator sort out vector length + // issues, but the right operand must be, or convert to, a u32 leaf + // scalar. right = ctx.try_automatic_conversion_for_leaf_scalar(right, crate::Scalar::U32, span)?; + + // Additionally, we must concretize the left operand if the right operand + // is not a const-expression. + // See https://www.w3.org/TR/WGSL/#overload-resolution-section. + // + // 2. Eliminate any candidate where one of its subexpressions resolves to + // an abstract type after feasible automatic conversions, but another of + // the candidate’s subexpressions is not a const-expression. + // + // We only have to explicitly do so for shifts as their operands may be + // of different types - for other binary ops this is achieved by finding + // the conversion consensus for both operands. + let expr_kind_tracker = match ctx.expr_type { + ExpressionContextType::Runtime(ref ctx) + | ExpressionContextType::Constant(Some(ref ctx)) => { + &ctx.local_expression_kind_tracker + } + ExpressionContextType::Constant(None) | ExpressionContextType::Override => { + &ctx.global_expression_kind_tracker + } + }; + if !expr_kind_tracker.is_const(right) { + left = ctx.concretize(left)?; + } } // All other operators follow the same pattern: reconcile the @@ -2534,6 +2571,14 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { .push(crate::Statement::Barrier(crate::Barrier::SUB_GROUP), span); return Ok(None); } + "textureBarrier" => { + ctx.prepare_args(arguments, 0, span).finish()?; + + let rctx = ctx.runtime_expression_ctx(span)?; + rctx.block + .push(crate::Statement::Barrier(crate::Barrier::TEXTURE), span); + return Ok(None); + } "workgroupUniformLoad" => { let mut args = ctx.prepare_args(arguments, 1, span); let expr = args.next()?; @@ -2703,6 +2748,30 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { .push(crate::Statement::RayQuery { query, fun }, span); return Ok(None); } + "getCommittedHitVertexPositions" => { + let mut args = ctx.prepare_args(arguments, 1, span); + let query = self.ray_query_pointer(args.next()?, ctx)?; + args.finish()?; + + let _ = ctx.module.generate_vertex_return_type(); + + crate::Expression::RayQueryVertexPositions { + query, + committed: true, + } + } + "getCandidateHitVertexPositions" => { + let mut args = ctx.prepare_args(arguments, 1, span); + let query = self.ray_query_pointer(args.next()?, ctx)?; + args.finish()?; + + let _ = ctx.module.generate_vertex_return_type(); + + crate::Expression::RayQueryVertexPositions { + query, + committed: false, + } + } "rayQueryProceed" => { let mut args = ctx.prepare_args(arguments, 1, span); let query = self.ray_query_pointer(args.next()?, ctx)?; @@ -3315,8 +3384,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { class, }, ast::Type::Sampler { comparison } => crate::TypeInner::Sampler { comparison }, - ast::Type::AccelerationStructure => crate::TypeInner::AccelerationStructure, - ast::Type::RayQuery => crate::TypeInner::RayQuery, + ast::Type::AccelerationStructure { vertex_return } => { + crate::TypeInner::AccelerationStructure { vertex_return } + } + ast::Type::RayQuery { vertex_return } => crate::TypeInner::RayQuery { vertex_return }, ast::Type::BindingArray { base, size } => { let base = self.resolve_ast_type(base, ctx)?; let size = self.array_size(size, ctx)?; @@ -3386,7 +3457,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { match *resolve_inner!(ctx, pointer) { crate::TypeInner::Pointer { base, .. } => match ctx.module.types[base].inner { - crate::TypeInner::RayQuery => Ok(pointer), + crate::TypeInner::RayQuery { .. } => Ok(pointer), ref other => { log::error!("Pointer type to {:?} passed to ray query op", other); Err(Error::InvalidRayQueryPointer(span)) diff --git a/third_party/rust/naga/src/front/wgsl/mod.rs b/third_party/rust/naga/src/front/wgsl/mod.rs index dcd6398eb6b1..dc97298acd4a 100644 --- a/third_party/rust/naga/src/front/wgsl/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/mod.rs @@ -12,18 +12,21 @@ mod parse; mod tests; mod to_wgsl; -use crate::front::wgsl::error::Error; -use crate::front::wgsl::parse::Parser; -use thiserror::Error; - pub use crate::front::wgsl::error::ParseError; -use crate::front::wgsl::lower::Lowerer; -use crate::Scalar; - pub use crate::front::wgsl::parse::directive::language_extension::{ ImplementedLanguageExtension, LanguageExtension, UnimplementedLanguageExtension, }; +use thiserror::Error; + +use crate::front::wgsl::error::Error; +use crate::front::wgsl::lower::Lowerer; +use crate::front::wgsl::parse::Parser; +use crate::Scalar; + +#[cfg(test)] +use std::println; + pub struct Frontend { parser: Parser, } diff --git a/third_party/rust/naga/src/front/wgsl/parse/ast.rs b/third_party/rust/naga/src/front/wgsl/parse/ast.rs index 219dd856e7d4..3318a3640c91 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/ast.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/ast.rs @@ -1,9 +1,11 @@ +use alloc::vec::Vec; +use core::hash::Hash; + use crate::diagnostic_filter::DiagnosticFilterNode; use crate::front::wgsl::parse::directive::enable_extension::EnableExtensions; use crate::front::wgsl::parse::number::Number; use crate::front::wgsl::Scalar; use crate::{Arena, FastIndexSet, Handle, Span}; -use std::hash::Hash; #[derive(Debug, Default)] pub struct TranslationUnit<'a> { @@ -68,7 +70,7 @@ pub struct Dependency<'a> { } impl Hash for Dependency<'_> { - fn hash(&self, state: &mut H) { + fn hash(&self, state: &mut H) { self.ident.hash(state); } } @@ -241,8 +243,12 @@ pub enum Type<'a> { Sampler { comparison: bool, }, - AccelerationStructure, - RayQuery, + AccelerationStructure { + vertex_return: bool, + }, + RayQuery { + vertex_return: bool, + }, RayDesc, RayIntersection, BindingArray { diff --git a/third_party/rust/naga/src/front/wgsl/parse/directive.rs b/third_party/rust/naga/src/front/wgsl/parse/directive.rs index 5302fff13862..3a661bc5856b 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/directive.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/directive.rs @@ -49,11 +49,12 @@ impl crate::diagnostic_filter::Severity { #[cfg(test)] mod test { + use alloc::format; + use strum::IntoEnumIterator; - use crate::front::wgsl::assert_parse_err; - use super::DirectiveKind; + use crate::front::wgsl::assert_parse_err; #[test] fn directive_after_global_decl() { diff --git a/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs b/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs index 147ec0b5e042..e87f44eb5da5 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/directive/enable_extension.rs @@ -1,6 +1,7 @@ //! `enable …;` extensions in WGSL. //! //! The focal point of this module is the [`EnableExtension`] API. + use crate::{front::wgsl::error::Error, Span}; /// Tracks the status of every enable-extension known to Naga. @@ -42,6 +43,12 @@ pub enum EnableExtension { Unimplemented(UnimplementedEnableExtension), } +impl From for EnableExtension { + fn from(value: ImplementedEnableExtension) -> Self { + Self::Implemented(value) + } +} + impl EnableExtension { const F16: &'static str = "f16"; const CLIP_DISTANCES: &'static str = "clip_distances"; @@ -91,13 +98,13 @@ pub enum UnimplementedEnableExtension { /// /// In the WGSL standard, this corresponds to [`enable clip_distances;`]. /// - /// [`enable clip_distances;`]: https://www.w3.org/TR/WGSL/#extension-f16 + /// [`enable clip_distances;`]: https://www.w3.org/TR/WGSL/#extension-clip_distances ClipDistances, /// Enables the `blend_src` attribute in WGSL. /// /// In the WGSL standard, this corresponds to [`enable dual_source_blending;`]. /// - /// [`enable dual_source_blending;`]: https://www.w3.org/TR/WGSL/#extension-f16 + /// [`enable dual_source_blending;`]: https://www.w3.org/TR/WGSL/#extension-dual_source_blending DualSourceBlending, } diff --git a/third_party/rust/naga/src/front/wgsl/parse/lexer.rs b/third_party/rust/naga/src/front/wgsl/parse/lexer.rs index 955643e62c22..2c1f9608c417 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/lexer.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/lexer.rs @@ -466,6 +466,28 @@ impl<'a> Lexer<'a> { Ok((format, access)) } + pub(in crate::front::wgsl) fn next_acceleration_structure_flags( + &mut self, + ) -> Result> { + Ok(if self.skip(Token::Paren('<')) { + if !self.skip(Token::Paren('>')) { + let (name, span) = self.next_ident_with_span()?; + let ret = if name == "vertex_return" { + true + } else { + return Err(Error::UnknownAttribute(span)); + }; + self.skip(Token::Separator(',')); + self.expect(Token::Paren('>'))?; + ret + } else { + false + } + } else { + false + }) + } + pub(in crate::front::wgsl) fn open_arguments(&mut self) -> Result<(), Error<'a>> { self.expect(Token::Paren('(')) } diff --git a/third_party/rust/naga/src/front/wgsl/parse/mod.rs b/third_party/rust/naga/src/front/wgsl/parse/mod.rs index ad229b2170ce..8057a03ab1c1 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/mod.rs @@ -1,3 +1,5 @@ +use alloc::{boxed::Box, vec::Vec}; + use crate::diagnostic_filter::{ self, DiagnosticFilter, DiagnosticFilterMap, DiagnosticFilterNode, FilterableTriggeringRule, ShouldConflictOnFullDuplicate, StandardFilterableTriggeringRule, @@ -1652,8 +1654,14 @@ impl Parser { class: crate::ImageClass::Storage { format, access }, } } - "acceleration_structure" => ast::Type::AccelerationStructure, - "ray_query" => ast::Type::RayQuery, + "acceleration_structure" => { + let vertex_return = lexer.next_acceleration_structure_flags()?; + ast::Type::AccelerationStructure { vertex_return } + } + "ray_query" => { + let vertex_return = lexer.next_acceleration_structure_flags()?; + ast::Type::RayQuery { vertex_return } + } "RayDesc" => ast::Type::RayDesc, "RayIntersection" => ast::Type::RayIntersection, _ => return Ok(None), diff --git a/third_party/rust/naga/src/front/wgsl/parse/number.rs b/third_party/rust/naga/src/front/wgsl/parse/number.rs index 72795de6b425..e447c12c99db 100644 --- a/third_party/rust/naga/src/front/wgsl/parse/number.rs +++ b/third_party/rust/naga/src/front/wgsl/parse/number.rs @@ -1,3 +1,5 @@ +use alloc::format; + use crate::front::wgsl::error::NumberError; use crate::front::wgsl::parse::lexer::Token; diff --git a/third_party/rust/naga/src/front/wgsl/tests.rs b/third_party/rust/naga/src/front/wgsl/tests.rs index 7d14105b92e0..1746df56fa4a 100644 --- a/third_party/rust/naga/src/front/wgsl/tests.rs +++ b/third_party/rust/naga/src/front/wgsl/tests.rs @@ -1,3 +1,5 @@ +use alloc::format; + use super::parse_str; #[test] diff --git a/third_party/rust/naga/src/front/wgsl/to_wgsl.rs b/third_party/rust/naga/src/front/wgsl/to_wgsl.rs index 7d4c17f5f082..f24e7296bd76 100644 --- a/third_party/rust/naga/src/front/wgsl/to_wgsl.rs +++ b/third_party/rust/naga/src/front/wgsl/to_wgsl.rs @@ -1,5 +1,10 @@ //! Producing the WGSL forms of types, for use in error messages. +use alloc::{ + format, + string::{String, ToString}, +}; + use crate::proc::GlobalCtx; use crate::Handle; @@ -117,8 +122,14 @@ impl crate::TypeInner { format!("texture{class_suffix}{dim_suffix}{array_suffix}{type_in_brackets}") } Ti::Sampler { .. } => "sampler".to_string(), - Ti::AccelerationStructure => "acceleration_structure".to_string(), - Ti::RayQuery => "ray_query".to_string(), + Ti::AccelerationStructure { vertex_return } => { + let caps = if vertex_return { "" } else { "" }; + format!("acceleration_structure{}", caps) + } + Ti::RayQuery { vertex_return } => { + let caps = if vertex_return { "" } else { "" }; + format!("ray_query{}", caps) + } Ti::BindingArray { base, size, .. } => { let member_type = &gctx.types[base]; let base = member_type.name.as_deref().unwrap_or("unknown"); @@ -198,10 +209,13 @@ impl crate::StorageFormat { } } +#[cfg(test)] mod tests { + use alloc::{string::ToString, vec}; + #[test] fn to_wgsl() { - use std::num::NonZeroU32; + use core::num::NonZeroU32; let mut types = crate::UniqueArena::new(); diff --git a/third_party/rust/naga/src/lib.rs b/third_party/rust/naga/src/lib.rs index 2e917d34e049..48156b977ebc 100644 --- a/third_party/rust/naga/src/lib.rs +++ b/third_party/rust/naga/src/lib.rs @@ -249,6 +249,12 @@ An override expression can be evaluated at pipeline creation time. clippy::todo ) )] +#![no_std] + +#[cfg(any(test, spv_out, feature = "spv-in", feature = "wgsl-in"))] +extern crate std; + +extern crate alloc; mod arena; pub mod back; @@ -265,12 +271,14 @@ pub mod proc; mod span; pub mod valid; -pub use crate::arena::{Arena, Handle, Range, UniqueArena}; +use alloc::{string::String, vec::Vec}; +pub use crate::arena::{Arena, Handle, Range, UniqueArena}; pub use crate::span::{SourceLocation, Span, SpanContext, WithSpan}; +use diagnostic_filter::DiagnosticFilterNode; + #[cfg(feature = "arbitrary")] use arbitrary::Arbitrary; -use diagnostic_filter::DiagnosticFilterNode; #[cfg(feature = "deserialize")] use serde::Deserialize; #[cfg(feature = "serialize")] @@ -283,25 +291,25 @@ pub const BOOL_WIDTH: Bytes = 1; pub const ABSTRACT_WIDTH: Bytes = 8; /// Hash map that is faster but not resilient to DoS attacks. -/// (Similar to rustc_hash::FxHashMap but using hashbrown::HashMap instead of std::collections::HashMap.) +/// (Similar to rustc_hash::FxHashMap but using hashbrown::HashMap instead of alloc::collections::HashMap.) /// To construct a new instance: `FastHashMap::default()` pub type FastHashMap = - hashbrown::HashMap>; + hashbrown::HashMap>; /// Hash set that is faster but not resilient to DoS attacks. -/// (Similar to rustc_hash::FxHashSet but using hashbrown::HashSet instead of std::collections::HashMap.) +/// (Similar to rustc_hash::FxHashSet but using hashbrown::HashSet instead of alloc::collections::HashMap.) pub type FastHashSet = - hashbrown::HashSet>; + hashbrown::HashSet>; /// Insertion-order-preserving hash set (`IndexSet`), but with the same /// hasher as `FastHashSet` (faster but not resilient to DoS attacks). pub type FastIndexSet = - indexmap::IndexSet>; + indexmap::IndexSet>; /// Insertion-order-preserving hash map (`IndexMap`), but with the same /// hasher as `FastHashMap` (faster but not resilient to DoS attacks). pub type FastIndexMap = - indexmap::IndexMap>; + indexmap::IndexMap>; /// Map of expressions that have associated variable names pub(crate) type NamedExpressions = FastIndexMap, String>; @@ -511,7 +519,7 @@ pub enum PendingArraySize { #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ArraySize { /// The array size is constant. - Constant(std::num::NonZeroU32), + Constant(core::num::NonZeroU32), /// The array size is an override-expression. Pending(PendingArraySize), /// The array size can change at runtime. @@ -839,10 +847,10 @@ pub enum TypeInner { Sampler { comparison: bool }, /// Opaque object representing an acceleration structure of geometry. - AccelerationStructure, + AccelerationStructure { vertex_return: bool }, /// Locally used handle for ray queries. - RayQuery, + RayQuery { vertex_return: bool }, /// Array of bindings. /// @@ -1371,6 +1379,8 @@ bitflags::bitflags! { const WORK_GROUP = 1 << 1; /// Barrier synchronizes execution across all invocations within a subgroup that execute this instruction. const SUB_GROUP = 1 << 2; + /// Barrier synchronizes texture memory accesses in a workgroup. + const TEXTURE = 1 << 3; } } @@ -1687,6 +1697,14 @@ pub enum Expression { /// a pointer to a structure containing a runtime array in its' last field. ArrayLength(Handle), + /// Get the Positions of the triangle hit by the [`RayQuery`] + /// + /// [`RayQuery`]: Statement::RayQuery + RayQueryVertexPositions { + query: Handle, + committed: bool, + }, + /// Result of a [`Proceed`] [`RayQuery`] statement. /// /// [`Proceed`]: RayQueryFunction::Proceed @@ -2331,6 +2349,11 @@ pub struct SpecialTypes { /// this if needed and return the handle. pub ray_intersection: Option>, + /// Type for `RayVertexReturn + /// + /// Call [`Module::generate_vertex_return_type`] + pub ray_vertex_return: Option>, + /// Types for predeclared wgsl types instantiated on demand. /// /// Call [`Module::generate_predeclared_type`] to populate this if diff --git a/third_party/rust/naga/src/non_max_u32.rs b/third_party/rust/naga/src/non_max_u32.rs index 2ad402e497b5..da866f738084 100644 --- a/third_party/rust/naga/src/non_max_u32.rs +++ b/third_party/rust/naga/src/non_max_u32.rs @@ -13,10 +13,10 @@ //! within the implementation. //! //! [`Handle`]: crate::arena::Handle -//! [`NonZeroU32`]: std::num::NonZeroU32 +//! [`NonZeroU32`]: core::num::NonZeroU32 #![allow(dead_code)] -use std::num::NonZeroU32; +use core::num::NonZeroU32; /// An unsigned 32-bit value known not to be [`u32::MAX`]. /// @@ -48,7 +48,7 @@ use std::num::NonZeroU32; /// around, the value unrepresentable in `NonMaxU32`, [`u32::MAX`], becomes the /// value unrepresentable in [`NonZeroU32`], `0`.) /// -/// [`NonZeroU32`]: std::num::NonZeroU32 +/// [`NonZeroU32`]: core::num::NonZeroU32 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct NonMaxU32(NonZeroU32); @@ -97,14 +97,14 @@ impl NonMaxU32 { } } -impl std::fmt::Debug for NonMaxU32 { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Debug for NonMaxU32 { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.get().fmt(f) } } -impl std::fmt::Display for NonMaxU32 { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for NonMaxU32 { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.get().fmt(f) } } @@ -140,6 +140,5 @@ impl<'de> serde::Deserialize<'de> for NonMaxU32 { #[test] fn size() { - use core::mem::size_of; assert_eq!(size_of::>(), size_of::()); } diff --git a/third_party/rust/naga/src/proc/constant_evaluator.rs b/third_party/rust/naga/src/proc/constant_evaluator.rs index 684b52c565f2..bb6893bc1f1e 100644 --- a/third_party/rust/naga/src/proc/constant_evaluator.rs +++ b/third_party/rust/naga/src/proc/constant_evaluator.rs @@ -1,4 +1,10 @@ -use std::iter; +use alloc::{ + format, + string::{String, ToString}, + vec, + vec::Vec, +}; +use core::iter; use arrayvec::ArrayVec; @@ -957,7 +963,9 @@ impl<'a> ConstantEvaluator<'a> { Expression::ImageSample { .. } | Expression::ImageLoad { .. } | Expression::ImageQuery { .. } => Err(ConstantEvaluatorError::ImageExpression), - Expression::RayQueryProceedResult | Expression::RayQueryGetIntersection { .. } => { + Expression::RayQueryProceedResult + | Expression::RayQueryGetIntersection { .. } + | Expression::RayQueryVertexPositions { .. } => { Err(ConstantEvaluatorError::RayQueryExpression) } Expression::SubgroupBallotResult => Err(ConstantEvaluatorError::SubgroupExpression), @@ -1744,7 +1752,7 @@ impl<'a> ConstantEvaluator<'a> { self.types.insert(Type { name: None, inner }, span) } }; - let mut layouter = std::mem::take(self.layouter); + let mut layouter = core::mem::take(self.layouter); layouter.update(self.to_ctx()).unwrap(); *self.layouter = layouter; @@ -2536,7 +2544,7 @@ impl TryFromAbstract for u64 { #[cfg(test)] mod tests { - use std::vec; + use alloc::{vec, vec::Vec}; use crate::{ Arena, Constant, Expression, Literal, ScalarKind, Type, TypeInner, UnaryOperator, diff --git a/third_party/rust/naga/src/proc/layouter.rs b/third_party/rust/naga/src/proc/layouter.rs index 82b1be094a49..0001d92f28b6 100644 --- a/third_party/rust/naga/src/proc/layouter.rs +++ b/third_party/rust/naga/src/proc/layouter.rs @@ -1,5 +1,6 @@ +use core::{fmt::Display, num::NonZeroU32, ops}; + use crate::arena::{Handle, HandleVec}; -use std::{fmt::Display, num::NonZeroU32, ops}; /// A newtype struct where its only valid values are powers of 2 #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -50,7 +51,7 @@ impl Alignment { } impl Display for Alignment { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.get().fmt(f) } } @@ -233,8 +234,8 @@ impl Layouter { } Ti::Image { .. } | Ti::Sampler { .. } - | Ti::AccelerationStructure - | Ti::RayQuery + | Ti::AccelerationStructure { .. } + | Ti::RayQuery { .. } | Ti::BindingArray { .. } => TypeLayout { size, alignment: Alignment::ONE, diff --git a/third_party/rust/naga/src/proc/mod.rs b/third_party/rust/naga/src/proc/mod.rs index a6a19f70eda3..0ba561027f86 100644 --- a/third_party/rust/naga/src/proc/mod.rs +++ b/third_party/rust/naga/src/proc/mod.rs @@ -527,7 +527,7 @@ pub fn flatten_compose<'arenas>( return subcomponents; } } - std::slice::from_ref(component) + core::slice::from_ref(component) } /// Flatten `Splat` expressions if `is_vector` is true. @@ -544,7 +544,7 @@ pub fn flatten_compose<'arenas>( count = size as usize; } } - std::iter::repeat(expr).take(count) + core::iter::repeat(expr).take(count) } // Expressions like `vec4(vec3(vec2(6, 7), 8), 9)` require us to diff --git a/third_party/rust/naga/src/proc/namer.rs b/third_party/rust/naga/src/proc/namer.rs index 8afacb593df8..53bb39ecabb1 100644 --- a/third_party/rust/naga/src/proc/namer.rs +++ b/third_party/rust/naga/src/proc/namer.rs @@ -1,6 +1,12 @@ +use alloc::{ + borrow::Cow, + format, + string::{String, ToString}, + vec::Vec, +}; +use core::hash::{Hash, Hasher}; + use crate::{arena::Handle, FastHashMap, FastHashSet}; -use std::borrow::Cow; -use std::hash::{Hash, Hasher}; pub type EntryPointIndex = u16; const SEPARATOR: char = '_'; @@ -92,7 +98,7 @@ impl Namer { /// Guarantee uniqueness by applying a numeric suffix when necessary. If `label_raw` /// itself ends with digits, separate them from the suffix with an underscore. pub fn call(&mut self, label_raw: &str) -> String { - use std::fmt::Write as _; // for write!-ing to Strings + use core::fmt::Write as _; // for write!-ing to Strings let base = self.sanitize(label_raw); debug_assert!(!base.is_empty() && !base.ends_with(SEPARATOR)); @@ -143,7 +149,7 @@ impl Namer { /// context for the duration of the call to `body`. fn namespace(&mut self, capacity: usize, body: impl FnOnce(&mut Self)) { let fresh = FastHashMap::with_capacity_and_hasher(capacity, Default::default()); - let outer = std::mem::replace(&mut self.unique, fresh); + let outer = core::mem::replace(&mut self.unique, fresh); body(self); self.unique = outer; } @@ -175,10 +181,38 @@ impl Namer { .map(|string| (AsciiUniCase(*string))), ); + // Choose fallback names for anonymous entry point return types. + let mut entrypoint_type_fallbacks = FastHashMap::default(); + for ep in &module.entry_points { + if let Some(ref result) = ep.function.result { + if let crate::Type { + name: None, + inner: crate::TypeInner::Struct { .. }, + } = module.types[result.ty] + { + let label = match ep.stage { + crate::ShaderStage::Vertex => "VertexOutput", + crate::ShaderStage::Fragment => "FragmentOutput", + crate::ShaderStage::Compute => "ComputeOutput", + }; + entrypoint_type_fallbacks.insert(result.ty, label); + } + } + } + let mut temp = String::new(); for (ty_handle, ty) in module.types.iter() { - let ty_name = self.call_or(&ty.name, "type"); + // If the type is anonymous, check `entrypoint_types` for + // something better than just `"type"`. + let raw_label = match ty.name { + Some(ref given_name) => given_name.as_str(), + None => entrypoint_type_fallbacks + .get(&ty_handle) + .cloned() + .unwrap_or("type"), + }; + let ty_name = self.call(raw_label); output.insert(NameKey::Type(ty_handle), ty_name); if let crate::TypeInner::Struct { ref members, .. } = ty.inner { @@ -230,7 +264,7 @@ impl Namer { let label = match constant.name { Some(ref name) => name, None => { - use std::fmt::Write; + use core::fmt::Write; // Try to be more descriptive about the constant values temp.clear(); write!(temp, "const_{}", output[&NameKey::Type(constant.ty)]).unwrap(); diff --git a/third_party/rust/naga/src/proc/type_methods.rs b/third_party/rust/naga/src/proc/type_methods.rs index d73b6df10f8b..3b9e9348a9bf 100644 --- a/third_party/rust/naga/src/proc/type_methods.rs +++ b/third_party/rust/naga/src/proc/type_methods.rs @@ -164,8 +164,8 @@ impl crate::TypeInner { Self::Struct { span, .. } => span, Self::Image { .. } | Self::Sampler { .. } - | Self::AccelerationStructure - | Self::RayQuery + | Self::AccelerationStructure { .. } + | Self::RayQuery { .. } | Self::BindingArray { .. } => 0, } } @@ -276,8 +276,8 @@ impl crate::TypeInner { | crate::TypeInner::Struct { .. } | crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure - | crate::TypeInner::RayQuery + | crate::TypeInner::AccelerationStructure { .. } + | crate::TypeInner::RayQuery { .. } | crate::TypeInner::BindingArray { .. } => None, } } @@ -298,8 +298,8 @@ impl crate::TypeInner { | crate::TypeInner::Struct { .. } | crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure - | crate::TypeInner::RayQuery + | crate::TypeInner::AccelerationStructure { .. } + | crate::TypeInner::RayQuery { .. } | crate::TypeInner::BindingArray { .. } => false, } } diff --git a/third_party/rust/naga/src/proc/typifier.rs b/third_party/rust/naga/src/proc/typifier.rs index 135928990060..2f189eb8b7aa 100644 --- a/third_party/rust/naga/src/proc/typifier.rs +++ b/third_party/rust/naga/src/proc/typifier.rs @@ -1,7 +1,9 @@ -use crate::arena::{Arena, Handle, UniqueArena}; +use alloc::{format, string::String}; use thiserror::Error; +use crate::arena::{Arena, Handle, UniqueArena}; + /// The result of computing an expression's type. /// /// This is the (Rust) type returned by [`ResolveContext::resolve`] to represent @@ -147,6 +149,7 @@ impl Clone for TypeResolution { scalar, space, }, + Ti::Array { base, size, stride } => Ti::Array { base, size, stride }, _ => unreachable!("Unexpected clone type: {:?}", v), }), } @@ -898,6 +901,13 @@ impl<'a> ResolveContext<'a> { .ok_or(ResolveError::MissingSpecialType)?; TypeResolution::Handle(result) } + crate::Expression::RayQueryVertexPositions { .. } => { + let result = self + .special_types + .ray_vertex_return + .ok_or(ResolveError::MissingSpecialType)?; + TypeResolution::Handle(result) + } crate::Expression::SubgroupBallotResult => TypeResolution::Value(Ti::Vector { scalar: crate::Scalar::U32, size: crate::VectorSize::Quad, @@ -908,6 +918,5 @@ impl<'a> ResolveContext<'a> { #[test] fn test_error_size() { - use std::mem::size_of; assert_eq!(size_of::(), 32); } diff --git a/third_party/rust/naga/src/span.rs b/third_party/rust/naga/src/span.rs index 0256e19dc482..fbc2de633d5b 100644 --- a/third_party/rust/naga/src/span.rs +++ b/third_party/rust/naga/src/span.rs @@ -1,5 +1,12 @@ +use alloc::{ + borrow::ToOwned, + format, + string::{String, ToString}, + vec::Vec, +}; +use core::{error::Error, fmt, ops::Range}; + use crate::{Arena, Handle, UniqueArena}; -use std::{error::Error, fmt, ops::Range}; /// A source code span, used for error reporting. #[derive(Clone, Copy, Debug, PartialEq, Default)] @@ -94,7 +101,7 @@ impl From> for Span { } } -impl std::ops::Index for str { +impl core::ops::Index for str { type Output = str; #[inline] @@ -359,7 +366,7 @@ pub(crate) trait SpanProvider { x if !x.is_defined() => (Default::default(), "".to_string()), known => ( known, - format!("{} {:?}", std::any::type_name::(), handle), + format!("{} {:?}", core::any::type_name::(), handle), ), } } diff --git a/third_party/rust/naga/src/valid/analyzer.rs b/third_party/rust/naga/src/valid/analyzer.rs index c666abfaf2de..5a3d6ebc34b3 100644 --- a/third_party/rust/naga/src/valid/analyzer.rs +++ b/third_party/rust/naga/src/valid/analyzer.rs @@ -5,6 +5,9 @@ //! - texture/sampler pairs //! - expression reference counts +use alloc::{boxed::Box, vec}; +use core::ops; + use super::{ExpressionError, FunctionError, ModuleInfo, ShaderStages, ValidationFlags}; use crate::diagnostic_filter::{DiagnosticFilterNode, StandardFilterableTriggeringRule}; use crate::span::{AddSpan as _, WithSpan}; @@ -12,7 +15,6 @@ use crate::{ arena::{Arena, Handle}, proc::{ResolveContext, TypeResolution}, }; -use std::ops; pub type NonUniformResult = Option>; @@ -261,7 +263,7 @@ pub struct FunctionInfo { /// How this function and its callees use this module's globals. /// /// This is indexed by `Handle` indices. However, - /// `FunctionInfo` implements `std::ops::Index>`, + /// `FunctionInfo` implements `core::ops::Index>`, /// so you can simply index this struct with a global handle to retrieve /// its usage information. global_uses: Box<[GlobalUse]>, @@ -269,7 +271,7 @@ pub struct FunctionInfo { /// Information about each expression in this function's body. /// /// This is indexed by `Handle` indices. However, `FunctionInfo` - /// implements `std::ops::Index>`, so you can simply + /// implements `core::ops::Index>`, so you can simply /// index this struct with an expression handle to retrieve its /// `ExpressionInfo`. expressions: Box<[ExpressionInfo]>, @@ -807,6 +809,13 @@ impl FunctionInfo { non_uniform_result: Some(handle), requirements: UniformityRequirements::empty(), }, + E::RayQueryVertexPositions { + query, + committed: _, + } => Uniformity { + non_uniform_result: self.add_ref(query), + requirements: UniformityRequirements::empty(), + }, }; let ty = resolve_context.resolve(expression, |h| Ok(&self[h].ty))?; diff --git a/third_party/rust/naga/src/valid/compose.rs b/third_party/rust/naga/src/valid/compose.rs index c21e98c6f2a3..13d9bf38ffed 100644 --- a/third_party/rust/naga/src/valid/compose.rs +++ b/third_party/rust/naga/src/valid/compose.rs @@ -1,6 +1,5 @@ -use crate::proc::TypeResolution; - use crate::arena::Handle; +use crate::proc::TypeResolution; #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] diff --git a/third_party/rust/naga/src/valid/expression.rs b/third_party/rust/naga/src/valid/expression.rs index 4769b51a7d4e..49b2fd27b2d4 100644 --- a/third_party/rust/naga/src/valid/expression.rs +++ b/third_party/rust/naga/src/valid/expression.rs @@ -1,6 +1,5 @@ use super::{compose::validate_compose, FunctionInfo, ModuleInfo, ShaderStages, TypeFlags}; use crate::arena::UniqueArena; - use crate::{ arena::Handle, proc::{IndexableLengthError, ResolveError}, @@ -177,7 +176,7 @@ struct ExpressionTypeResolver<'a> { info: &'a FunctionInfo, } -impl std::ops::Index> for ExpressionTypeResolver<'_> { +impl core::ops::Index> for ExpressionTypeResolver<'_> { type Output = crate::TypeInner; #[allow(clippy::panic)] @@ -1727,7 +1726,28 @@ impl super::Validator { base, space: crate::AddressSpace::Function, } => match resolver.types[base].inner { - Ti::RayQuery => ShaderStages::all(), + Ti::RayQuery { .. } => ShaderStages::all(), + ref other => { + log::error!("Intersection result of a pointer to {:?}", other); + return Err(ExpressionError::InvalidRayQueryType(query)); + } + }, + ref other => { + log::error!("Intersection result of {:?}", other); + return Err(ExpressionError::InvalidRayQueryType(query)); + } + }, + E::RayQueryVertexPositions { + query, + committed: _, + } => match resolver[query] { + Ti::Pointer { + base, + space: crate::AddressSpace::Function, + } => match resolver.types[base].inner { + Ti::RayQuery { + vertex_return: true, + } => ShaderStages::all(), ref other => { log::error!("Intersection result of a pointer to {:?}", other); return Err(ExpressionError::InvalidRayQueryType(query)); diff --git a/third_party/rust/naga/src/valid/function.rs b/third_party/rust/naga/src/valid/function.rs index eb74ca237b4a..b6ff92bbdcb4 100644 --- a/third_party/rust/naga/src/valid/function.rs +++ b/third_party/rust/naga/src/valid/function.rs @@ -1,12 +1,12 @@ -use crate::arena::{Arena, UniqueArena}; -use crate::arena::{Handle, HandleSet}; +use alloc::{format, string::String}; use super::validate_atomic_compare_exchange_struct; - use super::{ analyzer::{UniformityDisruptor, UniformityRequirements}, ExpressionError, FunctionInfo, ModuleInfo, }; +use crate::arena::{Arena, UniqueArena}; +use crate::arena::{Handle, HandleSet}; use crate::span::WithSpan; use crate::span::{AddSpan as _, MapErrWithSpan as _}; @@ -173,6 +173,12 @@ pub enum FunctionError { InvalidRayQueryExpression(Handle), #[error("Acceleration structure {0:?} is not a matching expression")] InvalidAccelerationStructure(Handle), + #[error( + "Acceleration structure {0:?} is missing flag vertex_return while Ray Query {1:?} does" + )] + MissingAccelerationStructureVertexReturn(Handle, Handle), + #[error("Ray Query {0:?} is missing flag vertex_return")] + MissingRayQueryVertexReturn(Handle), #[error("Ray descriptor {0:?} is not a matching expression")] InvalidRayDescriptor(Handle), #[error("Ray Query {0:?} does not have a matching type")] @@ -765,7 +771,8 @@ impl super::Validator { | Ex::Math { .. } | Ex::As { .. } | Ex::ArrayLength(_) - | Ex::RayQueryGetIntersection { .. } => { + | Ex::RayQueryGetIntersection { .. } + | Ex::RayQueryVertexPositions { .. } => { self.emit_expression(handle, context)? } Ex::CallResult(_) @@ -1140,10 +1147,10 @@ impl super::Validator { }; // The `coordinate` operand must be a vector of the appropriate size. - if !context + if context .resolve_type(coordinate, &self.valid_expression_set)? .image_storage_coordinates() - .is_some_and(|coord_dim| coord_dim == dim) + .is_none_or(|coord_dim| coord_dim != dim) { return Err(FunctionError::InvalidImageStore( ExpressionError::InvalidImageCoordinateType(dim, coordinate), @@ -1451,14 +1458,14 @@ impl super::Validator { .with_span_static(span, "invalid query expression")); } }; - match context.types[query_var.ty].inner { - Ti::RayQuery => {} + let rq_vertex_return = match context.types[query_var.ty].inner { + Ti::RayQuery { vertex_return } => vertex_return, ref other => { log::error!("Unexpected ray query type {other:?}"); return Err(FunctionError::InvalidRayQueryType(query_var.ty) .with_span_static(span, "invalid query type")); } - } + }; match *fun { crate::RayQueryFunction::Initialize { acceleration_structure, @@ -1467,7 +1474,11 @@ impl super::Validator { match *context .resolve_type(acceleration_structure, &self.valid_expression_set)? { - Ti::AccelerationStructure => {} + Ti::AccelerationStructure { vertex_return } => { + if (!vertex_return) && rq_vertex_return { + return Err(FunctionError::MissingAccelerationStructureVertexReturn(acceleration_structure, query).with_span_static(span, "invalid acceleration structure")); + } + } _ => { return Err(FunctionError::InvalidAccelerationStructure( acceleration_structure, diff --git a/third_party/rust/naga/src/valid/handles.rs b/third_party/rust/naga/src/valid/handles.rs index 5affa9bff2f3..93265e17a047 100644 --- a/third_party/rust/naga/src/valid/handles.rs +++ b/third_party/rust/naga/src/valid/handles.rs @@ -1,17 +1,18 @@ //! Implementation of `Validator::validate_module_handles`. +use core::{convert::TryInto, hash::Hash}; + +use super::ValidationError; +use crate::non_max_u32::NonMaxU32; use crate::{ arena::{BadHandle, BadRangeError}, diagnostic_filter::DiagnosticFilterNode, Handle, }; - -use crate::non_max_u32::NonMaxU32; use crate::{Arena, UniqueArena}; -use super::ValidationError; - -use std::{convert::TryInto, hash::Hash}; +#[cfg(test)] +use alloc::string::ToString; impl super::Validator { /// Validates that all handles within `module` are: @@ -245,6 +246,9 @@ impl super::Validator { if let Some(ty) = special_types.ray_intersection { validate_type(ty)?; } + if let Some(ty) = special_types.ray_vertex_return { + validate_type(ty)?; + } for (handle, _node) in diagnostic_filters.iter() { let DiagnosticFilterNode { inner: _, parent } = diagnostic_filters[handle]; @@ -309,8 +313,8 @@ impl super::Validator { | crate::TypeInner::Atomic { .. } | crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure - | crate::TypeInner::RayQuery => None, + | crate::TypeInner::AccelerationStructure { .. } + | crate::TypeInner::RayQuery { .. } => None, crate::TypeInner::Pointer { base, space: _ } => { handle.check_dep(base)?; None @@ -558,6 +562,10 @@ impl super::Validator { crate::Expression::RayQueryGetIntersection { query, committed: _, + } + | crate::Expression::RayQueryVertexPositions { + query, + committed: _, } => { handle.check_dep(query)?; } @@ -838,9 +846,9 @@ impl Handle { }; Err(FwdDepError { subject: erase_handle_type(self), - subject_kind: std::any::type_name::(), + subject_kind: core::any::type_name::(), depends_on: erase_handle_type(depends_on), - depends_on_kind: std::any::type_name::(), + depends_on_kind: core::any::type_name::(), }) } } diff --git a/third_party/rust/naga/src/valid/interface.rs b/third_party/rust/naga/src/valid/interface.rs index a6fff61d826a..d182d9575a4e 100644 --- a/third_party/rust/naga/src/valid/interface.rs +++ b/third_party/rust/naga/src/valid/interface.rs @@ -1,11 +1,13 @@ +use alloc::vec::Vec; + +use bit_set::BitSet; + use super::{ analyzer::{FunctionInfo, GlobalUse}, Capabilities, Disalignment, FunctionError, ModuleInfo, }; use crate::arena::{Handle, UniqueArena}; - use crate::span::{AddSpan as _, MapErrWithSpan as _, SpanProvider as _, WithSpan}; -use bit_set::BitSet; const MAX_WORKGROUP_SIZE: u32 = 0x4000; @@ -549,8 +551,8 @@ impl super::Validator { _ => {} }, crate::TypeInner::Sampler { .. } - | crate::TypeInner::AccelerationStructure - | crate::TypeInner::RayQuery => {} + | crate::TypeInner::AccelerationStructure { .. } + | crate::TypeInner::RayQuery { .. } => {} _ => { return Err(GlobalVariableError::InvalidType(var.space)); } diff --git a/third_party/rust/naga/src/valid/mod.rs b/third_party/rust/naga/src/valid/mod.rs index 8560404703a3..e7a50d928d44 100644 --- a/third_party/rust/naga/src/valid/mod.rs +++ b/third_party/rust/naga/src/valid/mod.rs @@ -10,13 +10,16 @@ mod handles; mod interface; mod r#type; +use alloc::{boxed::Box, string::String, vec, vec::Vec}; +use core::ops; + +use bit_set::BitSet; + use crate::{ arena::{Handle, HandleSet}, proc::{ExpressionKindTracker, LayoutError, Layouter, TypeResolution}, FastHashSet, }; -use bit_set::BitSet; -use std::ops; //TODO: analyze the model at the same time as we validate it, // merge the corresponding matches over expressions and statements. @@ -158,6 +161,8 @@ bitflags::bitflags! { const TEXTURE_ATOMIC = 1 << 23; /// Support for atomic operations on 64-bit images. const TEXTURE_INT64_ATOMIC = 1 << 24; + /// Support for ray queries returning vertex position + const RAY_HIT_VERTEX_POSITION = 1 << 25; } } @@ -400,8 +405,8 @@ impl crate::TypeInner { Self::Array { .. } | Self::Image { .. } | Self::Sampler { .. } - | Self::AccelerationStructure - | Self::RayQuery + | Self::AccelerationStructure { .. } + | Self::RayQuery { .. } | Self::BindingArray { .. } => false, } } diff --git a/third_party/rust/naga/src/valid/type.rs b/third_party/rust/naga/src/valid/type.rs index 8c6825b842e9..5863eb813f41 100644 --- a/third_party/rust/naga/src/valid/type.rs +++ b/third_party/rust/naga/src/valid/type.rs @@ -1,3 +1,5 @@ +use alloc::string::String; + use super::Capabilities; use crate::{arena::Handle, proc::Alignment}; @@ -702,15 +704,21 @@ impl super::Validator { TypeFlags::ARGUMENT | TypeFlags::CREATION_RESOLVED, Alignment::ONE, ), - Ti::AccelerationStructure => { + Ti::AccelerationStructure { vertex_return } => { self.require_type_capability(Capabilities::RAY_QUERY)?; + if vertex_return { + self.require_type_capability(Capabilities::RAY_HIT_VERTEX_POSITION)?; + } TypeInfo::new( TypeFlags::ARGUMENT | TypeFlags::CREATION_RESOLVED, Alignment::ONE, ) } - Ti::RayQuery => { + Ti::RayQuery { vertex_return } => { self.require_type_capability(Capabilities::RAY_QUERY)?; + if vertex_return { + self.require_type_capability(Capabilities::RAY_HIT_VERTEX_POSITION)?; + } TypeInfo::new( TypeFlags::DATA | TypeFlags::CONSTRUCTIBLE diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json index 2f66b4652f06..d9e3b5786f4e 100644 --- a/third_party/rust/wgpu-core/.cargo-checksum.json +++ b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"a67ceea75e8e2a08f78c8761ce91ef9fcd575366feb4df5ee59b2f6ea6781873","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","build.rs":"d1b16b11773c58612398a008f93e2faa12ada843afc01db3a7559945b43d9bd9","src/binding_model.rs":"66065c3e8b57543892764a5b9e4b7759d169dd6f306832e4d731cd5227b76fa5","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"71b86e0db5cfaa2b0a4b849320173135893e90d63763c3002a60dcc8fc415a89","src/command/bundle.rs":"4505b036b602302afcdf9ffbcf111ee396612d15758b919276e91a3278b5db64","src/command/clear.rs":"4522488370bd90b5264e1ddfcacd6d8c48256b5305fa89403e518401ec6970e3","src/command/compute.rs":"5f9748cff962b3602ecffa8a0b5ea96d9455a403392d9cd9cd2cc79a2a175708","src/command/compute_command.rs":"18aa0b8e389a5d345243b876b1abbacfc998a19d23069e092183fa7be10fa0ab","src/command/draw.rs":"fe23039c3918eb4e61b9c1ac12715eee448277bb4d3537caa4f11287c04687af","src/command/memory_init.rs":"f25554cff06f96e37afd81153a351e9d8482c855318b86b4db29231926d265b5","src/command/mod.rs":"b02acf1aac4d35b31ae643da2f4a367a94bdf5f513b07169918e8a926bba79ce","src/command/query.rs":"0f6e1ead307465318977a6f3c09a3b902b9e59f7a38fcb08db421c5eab57f068","src/command/ray_tracing.rs":"3ab138c1f2599cc687c316d3d0db61b240a63098f99199ef205f654605afcf1b","src/command/render.rs":"dd948ca985c3f7bff09cb752fc60edf60caa7fd7a28d0358a9bb0e0a12836cb7","src/command/render_command.rs":"f216e42d27a6bef9d2e024881f978a11411d07bf2d771262ba79fb1c1e2842d8","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"cbc0cbbeaf7f59913ca72cb01bebcd5987674b1b0e58022fba207afde9342547","src/command/transition_resources.rs":"1824f6155047af4b19aeceaa72ac53f1289270eb2732c9f7f3574d806d62f206","src/conv.rs":"e922723428b0ebd774dd52704838a20085b87b8b44ee666485abdce3a9f07fac","src/device/bgl.rs":"fcb1d53b692970912781748379df675268981c97352872abf2e7bb0b1ebdd533","src/device/global.rs":"845fcab531a92eaebdfdc6f71a42fdb81c2884aafe1818c43601e7982f3e3fb0","src/device/life.rs":"bc1899dbf8d2b0389cba39775cc47d5dd0e2ae3a250b5e9db3dd79d613e4fd18","src/device/mod.rs":"e5d9a7f1af8ca840289495b8774640fce6f0931cfcc3794ebf57bb8440213ad3","src/device/queue.rs":"0c4697c841f351355246b99931ec9b7d1836a1ed946f885942dbb5954b60d981","src/device/ray_tracing.rs":"ac72925fd9b9119e0f0b99c859714a5f2d3553df0dd2b27d00ece87732072e18","src/device/resource.rs":"4997b431f4ef2da4ed6dfeaab577b8134822a41fa556af9b6f605c2b666f1c17","src/device/trace.rs":"f0b37f2bebc77c98db3ed047cd4a91fff2ffc2b790b98dd313910be0c237bddd","src/error.rs":"e2bedec8e0357f95478ca9468aa84a9fa19ce75b5e71a0ac9506d53520ebd294","src/global.rs":"1c787c8f0491078686caada234a860d7bb16027609738536a9e213a6d0098648","src/hal_api.rs":"7962c119456602e9c2ba958712660532290cabe0b8c4c67ef7595de73cdf8b57","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"ce0a14d5a3314df318bbc7c4d8c40ea2b3197dbddb2227e828ceb5127db7d37d","src/id.rs":"142feebe19f356af18e46970730ca0913593fcb440f289db31aa9f61220502bc","src/identity.rs":"0a92302fc5b483ea1a8750b1672971af1cf2abfd4c0325bb02488b43e85073e2","src/indirect_validation.rs":"057d1c9b8c323c1e248358fba57d905c70c8612f76930d1592ebae595e351026","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"3895c4a2284631b6d6247c0d96c5fc9cfd024d358e09cad8752b2505700138a3","src/init_tracker/texture.rs":"83e3769b21ee7b784f71f638a525bf25daf91da23fee1f807af739cf89c88391","src/instance.rs":"9b7f6d15c22ff8128f111fa3528297653ce9115f9c14f206045721ae8a36deb5","src/lib.rs":"16b86a1549142c59309ec350552c6f420a2c776ad6a2bee1bbd69929fc747b16","src/lock/mod.rs":"c58ae08a8e6108432d9e14e7d8b7bd15af7bb5e98bf700d6bd9a469b80a38b11","src/lock/observing.rs":"acc4fba523512066a519b95cf1f7846fda08a9d76e1ce65168aac8b21b67d1b6","src/lock/rank.rs":"8cf08cd720bac88c06bd8b0fe11f35175546c3e52c75a0163ddeded6fb383923","src/lock/ranked.rs":"7f44776bc7d71a25e23c97ab80e2fdab3576bb3f912bc8a0b4fcc28a64ef5c6e","src/lock/vanilla.rs":"713c4f8408b60779bb32377aca6fb7fd1241456057ebcf01f7602f52397a7cbe","src/pipeline.rs":"e6d57bb5aca82dc389214899066c6fd644dbae63b89df8c36e92471bc52d4ff1","src/pipeline_cache.rs":"4d5d823e2be797ef5573b9a4d0f9888fbbb2d9b83ab3a6c4731eb38c563b9af9","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"165c9e0f81c87e6b5c0500915e8f9db0448208a953d2e9468bd270ed2f2948ce","src/ray_tracing.rs":"d18ee884098bf7b3eb290a596c81f01d2e5b8219c0e7cb8c9665bc7706734390","src/registry.rs":"4eb33818f22825afa05814160289a8498e2cd04036b6e08e507d40908c498499","src/resource.rs":"a0110c6e82b5e7bbfb44f4ac55a02237d137829a73f7842fe8dc71ef54fe7dcd","src/scratch.rs":"05f2032fa6d6f589c2507f4028755769b9524029e5ad59cc500cab7940e40d42","src/snatch.rs":"68ce9e096f649b50f2856e1407ed5945c15cdba29761f8395a1f09e5aee209a3","src/storage.rs":"2ea3695b77ea540fee05149650005043fcc0abb3eb405738b5dea53efa60903d","src/track/buffer.rs":"1ab5310367606fc74f0791733ea5ba2e09acc92ff7f4f4773f66bcfb3138c52f","src/track/metadata.rs":"04b8bcf8ded7c7c805d9336cfc874da9d8de7d12d99f7525f0540780a1dffc45","src/track/mod.rs":"6af2b831b3a0c91a60a8fd6f141db67695218e0af1735a31b9dee39053703b27","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"fbd5f3cde5161404048131dbea014806cfc210ab1497bfd638f0064969c004f9","src/validation.rs":"06684d20a4548133104291acfa06a03c41fefc7b70f0bf757b06b74fcc941ca0","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"df9c4e07eaaf5e78590d2c1b8b14545311ffda3fddbddf7ea7973a024c03da27","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","build.rs":"d1b16b11773c58612398a008f93e2faa12ada843afc01db3a7559945b43d9bd9","src/binding_model.rs":"250c0071fd6b4e7adf923670c7b42824734bd29668ed17af39ad1dfb909fa688","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"71b86e0db5cfaa2b0a4b849320173135893e90d63763c3002a60dcc8fc415a89","src/command/bundle.rs":"cee52e3bce74497b06c733d5c78d39b315124085cd203b0452d52d51d00fc873","src/command/clear.rs":"4522488370bd90b5264e1ddfcacd6d8c48256b5305fa89403e518401ec6970e3","src/command/compute.rs":"ceb91f4922d6b9bde7ac1e4c74ba3880e5efc6f13a9c905aa8c4f8116beda24d","src/command/compute_command.rs":"18aa0b8e389a5d345243b876b1abbacfc998a19d23069e092183fa7be10fa0ab","src/command/draw.rs":"fe23039c3918eb4e61b9c1ac12715eee448277bb4d3537caa4f11287c04687af","src/command/memory_init.rs":"f25554cff06f96e37afd81153a351e9d8482c855318b86b4db29231926d265b5","src/command/mod.rs":"b02acf1aac4d35b31ae643da2f4a367a94bdf5f513b07169918e8a926bba79ce","src/command/query.rs":"0f6e1ead307465318977a6f3c09a3b902b9e59f7a38fcb08db421c5eab57f068","src/command/ray_tracing.rs":"d29e9afe9f7285c9a553d91596ce976c2f4bcd033188c98567fb325e6c6d4307","src/command/render.rs":"6eda7f40fcf2332a30f1fdf361d3cf51d9d3350509300c9f030738ae181ddca4","src/command/render_command.rs":"f216e42d27a6bef9d2e024881f978a11411d07bf2d771262ba79fb1c1e2842d8","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"cbc0cbbeaf7f59913ca72cb01bebcd5987674b1b0e58022fba207afde9342547","src/command/transition_resources.rs":"1824f6155047af4b19aeceaa72ac53f1289270eb2732c9f7f3574d806d62f206","src/conv.rs":"e922723428b0ebd774dd52704838a20085b87b8b44ee666485abdce3a9f07fac","src/device/bgl.rs":"fcb1d53b692970912781748379df675268981c97352872abf2e7bb0b1ebdd533","src/device/global.rs":"845fcab531a92eaebdfdc6f71a42fdb81c2884aafe1818c43601e7982f3e3fb0","src/device/life.rs":"bc1899dbf8d2b0389cba39775cc47d5dd0e2ae3a250b5e9db3dd79d613e4fd18","src/device/mod.rs":"7e339cb67c373a230852e2f0758b1fcea11b3eaf7215acd2f41c30afb1917b1f","src/device/queue.rs":"0c4697c841f351355246b99931ec9b7d1836a1ed946f885942dbb5954b60d981","src/device/ray_tracing.rs":"72dab8c0998ef92cad3a0a8ba62675dbdee2feb2044a78079510f9ab1c2a9742","src/device/resource.rs":"d3429696e15e34034e96aa0c7109d5b684b7e7e7508860fbfcb6fb339f17ccb2","src/device/trace.rs":"f0b37f2bebc77c98db3ed047cd4a91fff2ffc2b790b98dd313910be0c237bddd","src/error.rs":"4f07a0b09b30b2d6cbc855d0091d724000f492018af3b41e80befbeccf2a6f4e","src/global.rs":"1c787c8f0491078686caada234a860d7bb16027609738536a9e213a6d0098648","src/hal_api.rs":"7962c119456602e9c2ba958712660532290cabe0b8c4c67ef7595de73cdf8b57","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"ce0a14d5a3314df318bbc7c4d8c40ea2b3197dbddb2227e828ceb5127db7d37d","src/id.rs":"207f262558388147b484c51cf07d2554c26a3e19243058939e63a7f8e5c7ea75","src/identity.rs":"0a92302fc5b483ea1a8750b1672971af1cf2abfd4c0325bb02488b43e85073e2","src/indirect_validation.rs":"b41c76f41766dcc4b997e37df3291b10ae8acfe3e9eb5156aaf6cac964ba5f04","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"3895c4a2284631b6d6247c0d96c5fc9cfd024d358e09cad8752b2505700138a3","src/init_tracker/texture.rs":"83e3769b21ee7b784f71f638a525bf25daf91da23fee1f807af739cf89c88391","src/instance.rs":"1cbbcc6002946f39e669b610a179bc435b80c6d1511fa9cc1a6151dd74562c39","src/lib.rs":"4902abe167b4c58b268d57a6ae9e15a0f2f35f56535e259780e82c0e217ab785","src/lock/mod.rs":"c58ae08a8e6108432d9e14e7d8b7bd15af7bb5e98bf700d6bd9a469b80a38b11","src/lock/observing.rs":"acc4fba523512066a519b95cf1f7846fda08a9d76e1ce65168aac8b21b67d1b6","src/lock/rank.rs":"8cf08cd720bac88c06bd8b0fe11f35175546c3e52c75a0163ddeded6fb383923","src/lock/ranked.rs":"7f44776bc7d71a25e23c97ab80e2fdab3576bb3f912bc8a0b4fcc28a64ef5c6e","src/lock/vanilla.rs":"713c4f8408b60779bb32377aca6fb7fd1241456057ebcf01f7602f52397a7cbe","src/pipeline.rs":"e6d57bb5aca82dc389214899066c6fd644dbae63b89df8c36e92471bc52d4ff1","src/pipeline_cache.rs":"ada909b8d80de15687963559eb04936181d6b50d5ec1ea50a2188721748da4ed","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"165c9e0f81c87e6b5c0500915e8f9db0448208a953d2e9468bd270ed2f2948ce","src/ray_tracing.rs":"ba6e9c78e26e28821582b996e2b19aa751f03dea6a84336788e5e31aaeefef8b","src/registry.rs":"779d8c277193537edd2b883b72cdcc07161b7231c8d2c80be726bd800cd327b6","src/resource.rs":"a0110c6e82b5e7bbfb44f4ac55a02237d137829a73f7842fe8dc71ef54fe7dcd","src/scratch.rs":"05f2032fa6d6f589c2507f4028755769b9524029e5ad59cc500cab7940e40d42","src/snatch.rs":"68ce9e096f649b50f2856e1407ed5945c15cdba29761f8395a1f09e5aee209a3","src/storage.rs":"2ea3695b77ea540fee05149650005043fcc0abb3eb405738b5dea53efa60903d","src/track/buffer.rs":"1ab5310367606fc74f0791733ea5ba2e09acc92ff7f4f4773f66bcfb3138c52f","src/track/metadata.rs":"04b8bcf8ded7c7c805d9336cfc874da9d8de7d12d99f7525f0540780a1dffc45","src/track/mod.rs":"6af2b831b3a0c91a60a8fd6f141db67695218e0af1735a31b9dee39053703b27","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"fbd5f3cde5161404048131dbea014806cfc210ab1497bfd638f0064969c004f9","src/validation.rs":"a77c592a8de2419a697b06938c9e06bae86a5755fd7b6056be093d8aec474922","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-core/Cargo.toml b/third_party/rust/wgpu-core/Cargo.toml index 2a6e95a9576b..b5acf368cc9e 100644 --- a/third_party/rust/wgpu-core/Cargo.toml +++ b/third_party/rust/wgpu-core/Cargo.toml @@ -11,7 +11,7 @@ [package] edition = "2021" -rust-version = "1.76" +rust-version = "1.82.0" name = "wgpu-core" version = "24.0.0" authors = ["gfx-rs developers"] @@ -108,7 +108,7 @@ version = "0.8" default-features = false [dependencies.bitflags] -version = "2.7" +version = "2.9" [dependencies.bytemuck] version = "1.21" diff --git a/third_party/rust/wgpu-core/src/binding_model.rs b/third_party/rust/wgpu-core/src/binding_model.rs index 111442270473..5f6d52e00b3f 100644 --- a/third_party/rust/wgpu-core/src/binding_model.rs +++ b/third_party/rust/wgpu-core/src/binding_model.rs @@ -188,6 +188,8 @@ pub enum CreateBindGroupError { layout_flt: bool, sampler_flt: bool, }, + #[error("TLAS binding {binding} is required to support vertex returns but is missing flag AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN")] + MissingTLASVertexReturn { binding: u32 }, #[error("Bound texture views can not have both depth and stencil aspects enabled")] DepthStencilAspect, #[error("The adapter does not support read access for storage textures of format {0:?}")] @@ -380,7 +382,7 @@ impl BindingTypeMaxCountValidator { wgt::BindingType::StorageTexture { .. } => { self.storage_textures.add(binding.visibility, count); } - wgt::BindingType::AccelerationStructure => { + wgt::BindingType::AccelerationStructure { .. } => { self.acceleration_structures.add(binding.visibility, count); } } diff --git a/third_party/rust/wgpu-core/src/command/bundle.rs b/third_party/rust/wgpu-core/src/command/bundle.rs index 099446426c01..e192c0b99bc5 100644 --- a/third_party/rust/wgpu-core/src/command/bundle.rs +++ b/third_party/rust/wgpu-core/src/command/bundle.rs @@ -85,7 +85,6 @@ use alloc::{ vec::Vec, }; use core::{ - mem::size_of, num::{NonZeroU32, NonZeroU64}, ops::Range, }; diff --git a/third_party/rust/wgpu-core/src/command/compute.rs b/third_party/rust/wgpu-core/src/command/compute.rs index d973176c61d2..8519e8be82b6 100644 --- a/third_party/rust/wgpu-core/src/command/compute.rs +++ b/third_party/rust/wgpu-core/src/command/compute.rs @@ -2,7 +2,7 @@ use thiserror::Error; use wgt::{BufferAddress, DynamicOffset}; use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec}; -use core::{fmt, mem::size_of, str}; +use core::{fmt, str}; use crate::{ binding_model::{ diff --git a/third_party/rust/wgpu-core/src/command/ray_tracing.rs b/third_party/rust/wgpu-core/src/command/ray_tracing.rs index 868d43ab17e5..f6334d8275f2 100644 --- a/third_party/rust/wgpu-core/src/command/ray_tracing.rs +++ b/third_party/rust/wgpu-core/src/command/ray_tracing.rs @@ -530,6 +530,21 @@ impl Global { }, )); + if tlas + .flags + .contains(wgpu_types::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN) + && !blas.flags.contains( + wgpu_types::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN, + ) + { + return Err( + BuildAccelerationStructureError::TlasDependentMissingVertexReturn( + tlas.error_ident(), + blas.error_ident(), + ), + ); + } + instance_count += 1; dependencies.push(blas.clone()); diff --git a/third_party/rust/wgpu-core/src/command/render.rs b/third_party/rust/wgpu-core/src/command/render.rs index cf14d6b4d0f3..6d59f1b18688 100644 --- a/third_party/rust/wgpu-core/src/command/render.rs +++ b/third_party/rust/wgpu-core/src/command/render.rs @@ -1,5 +1,5 @@ use alloc::{borrow::Cow, sync::Arc, vec::Vec}; -use core::{fmt, mem::size_of, num::NonZeroU32, ops::Range, str}; +use core::{fmt, num::NonZeroU32, ops::Range, str}; use arrayvec::ArrayVec; use thiserror::Error; diff --git a/third_party/rust/wgpu-core/src/device/mod.rs b/third_party/rust/wgpu-core/src/device/mod.rs index 5bb1aad6f21d..30c4daad6d38 100644 --- a/third_party/rust/wgpu-core/src/device/mod.rs +++ b/third_party/rust/wgpu-core/src/device/mod.rs @@ -303,7 +303,7 @@ impl fmt::Display for DeviceMismatch { } } -impl std::error::Error for DeviceMismatch {} +impl core::error::Error for DeviceMismatch {} #[derive(Clone, Debug, Error)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -469,6 +469,10 @@ pub fn create_validator( Caps::SUBGROUP_VERTEX_STAGE, features.contains(wgt::Features::SUBGROUP_VERTEX), ); + caps.set( + Caps::RAY_HIT_VERTEX_POSITION, + features.intersects(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN), + ); naga::valid::Validator::new(flags, caps) } diff --git a/third_party/rust/wgpu-core/src/device/ray_tracing.rs b/third_party/rust/wgpu-core/src/device/ray_tracing.rs index 52d01b6a5838..0146741254ed 100644 --- a/third_party/rust/wgpu-core/src/device/ray_tracing.rs +++ b/third_party/rust/wgpu-core/src/device/ray_tracing.rs @@ -27,6 +27,13 @@ impl Device { self.check_is_valid()?; self.require_features(Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE)?; + if blas_desc + .flags + .contains(wgt::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN) + { + self.require_features(Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN)?; + } + let size_info = match &sizes { wgt::BlasGeometrySizeDescriptors::Triangles { descriptors } => { let mut entries = @@ -139,6 +146,13 @@ impl Device { )); } + if desc + .flags + .contains(wgt::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN) + { + self.require_features(Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN)?; + } + let size_info = unsafe { self.raw().get_acceleration_structure_build_sizes( &hal::GetAccelerationStructureBuildSizesDescriptor { diff --git a/third_party/rust/wgpu-core/src/device/resource.rs b/third_party/rust/wgpu-core/src/device/resource.rs index 69a62ab11914..b61bf1442fb3 100644 --- a/third_party/rust/wgpu-core/src/device/resource.rs +++ b/third_party/rust/wgpu-core/src/device/resource.rs @@ -1905,7 +1905,7 @@ impl Device { }, ) } - Bt::AccelerationStructure => (None, WritableStorage::No), + Bt::AccelerationStructure { .. } => (None, WritableStorage::No), }; // Validate the count parameter @@ -2249,7 +2249,15 @@ impl Device { tlas.same_device(self)?; match decl.ty { - wgt::BindingType::AccelerationStructure => (), + wgt::BindingType::AccelerationStructure { vertex_return } => { + if vertex_return + && !tlas.flags.contains( + wgpu_types::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN, + ) + { + return Err(Error::MissingTLASVertexReturn { binding }); + } + } _ => { return Err(Error::WrongBindingType { binding, diff --git a/third_party/rust/wgpu-core/src/error.rs b/third_party/rust/wgpu-core/src/error.rs index b5881825e697..8c5eb8ab12d4 100644 --- a/third_party/rust/wgpu-core/src/error.rs +++ b/third_party/rust/wgpu-core/src/error.rs @@ -1,6 +1,5 @@ use alloc::{boxed::Box, string::String, sync::Arc, vec::Vec}; -use core::fmt; -use std::error::Error; // TODO(https://github.com/gfx-rs/wgpu/issues/6826): use core::error after MSRV bump +use core::{error::Error, fmt}; use thiserror::Error; diff --git a/third_party/rust/wgpu-core/src/id.rs b/third_party/rust/wgpu-core/src/id.rs index a74b9e9096de..8858e1f89666 100644 --- a/third_party/rust/wgpu-core/src/id.rs +++ b/third_party/rust/wgpu-core/src/id.rs @@ -4,7 +4,6 @@ use core::{ fmt::{self, Debug}, hash::Hash, marker::PhantomData, - mem::size_of, num::NonZeroU64, }; use wgt::WasmNotSendSync; diff --git a/third_party/rust/wgpu-core/src/indirect_validation.rs b/third_party/rust/wgpu-core/src/indirect_validation.rs index 8cce7614bf8d..624ad3f9ece7 100644 --- a/third_party/rust/wgpu-core/src/indirect_validation.rs +++ b/third_party/rust/wgpu-core/src/indirect_validation.rs @@ -1,5 +1,4 @@ use alloc::{boxed::Box, format, string::ToString as _}; -use core::mem::size_of; use core::num::NonZeroU64; use thiserror::Error; diff --git a/third_party/rust/wgpu-core/src/instance.rs b/third_party/rust/wgpu-core/src/instance.rs index 78d2003d0e9e..ab2f62e9a336 100644 --- a/third_party/rust/wgpu-core/src/instance.rs +++ b/third_party/rust/wgpu-core/src/instance.rs @@ -202,6 +202,72 @@ impl Instance { } } + /// Creates a new surface from the given drm configuration. + /// + /// # Safety + /// + /// - All parameters must point to valid DRM values. + /// + /// # Platform Support + /// + /// This function is only available on non-apple Unix-like platforms (Linux, FreeBSD) and + /// currently only works with the Vulkan backend. + #[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))] + #[cfg_attr(not(vulkan), expect(unused_variables))] + pub unsafe fn create_surface_from_drm( + &self, + fd: i32, + plane: u32, + connector_id: u32, + width: u32, + height: u32, + refresh_rate: u32, + ) -> Result { + profiling::scope!("Instance::create_surface_from_drm"); + + let mut errors = HashMap::default(); + let mut surface_per_backend: HashMap> = + HashMap::default(); + + #[cfg(vulkan)] + { + let instance = unsafe { self.as_hal::() } + .ok_or(CreateSurfaceError::BackendNotEnabled(Backend::Vulkan))?; + + // Safety must be upheld by the caller + match unsafe { + instance.create_surface_from_drm( + fd, + plane, + connector_id, + width, + height, + refresh_rate, + ) + } { + Ok(surface) => { + surface_per_backend.insert(Backend::Vulkan, Box::new(surface)); + } + Err(err) => { + errors.insert(Backend::Vulkan, err); + } + } + } + + if surface_per_backend.is_empty() { + Err(CreateSurfaceError::FailedToCreateSurfaceForAnyBackend( + errors, + )) + } else { + let surface = Surface { + presentation: Mutex::new(rank::SURFACE_PRESENTATION, None), + surface_per_backend, + }; + + Ok(surface) + } + } + /// # Safety /// /// `layer` must be a valid pointer. @@ -772,6 +838,42 @@ impl Global { Ok(id) } + /// Creates a new surface from the given drm configuration. + /// + /// # Safety + /// + /// - All parameters must point to valid DRM values. + /// + /// # Platform Support + /// + /// This function is only available on non-apple Unix-like platforms (Linux, FreeBSD) and + /// currently only works with the Vulkan backend. + #[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))] + pub unsafe fn instance_create_surface_from_drm( + &self, + fd: i32, + plane: u32, + connector_id: u32, + width: u32, + height: u32, + refresh_rate: u32, + id_in: Option, + ) -> Result { + let surface = unsafe { + self.instance.create_surface_from_drm( + fd, + plane, + connector_id, + width, + height, + refresh_rate, + ) + }?; + let id = self.surfaces.prepare(id_in).assign(Arc::new(surface)); + + Ok(id) + } + /// # Safety /// /// `layer` must be a valid pointer. diff --git a/third_party/rust/wgpu-core/src/lib.rs b/third_party/rust/wgpu-core/src/lib.rs index ec873852d9a4..db3fcde3887b 100644 --- a/third_party/rust/wgpu-core/src/lib.rs +++ b/third_party/rust/wgpu-core/src/lib.rs @@ -58,6 +58,8 @@ // this doesn't make a difference. // Therefore, this is only really a concern for users targeting WebGL // (the only reason to use wgpu-core on the web in the first place) that have atomics enabled. +// +// NOTE: Keep this in sync with `wgpu`. #![cfg_attr(not(send_sync), allow(clippy::arc_with_non_send_sync))] extern crate alloc; diff --git a/third_party/rust/wgpu-core/src/pipeline_cache.rs b/third_party/rust/wgpu-core/src/pipeline_cache.rs index b206c09ea4f5..0253163f6daf 100644 --- a/third_party/rust/wgpu-core/src/pipeline_cache.rs +++ b/third_party/rust/wgpu-core/src/pipeline_cache.rs @@ -1,5 +1,3 @@ -use core::mem::size_of; - use thiserror::Error; use wgt::AdapterInfo; diff --git a/third_party/rust/wgpu-core/src/ray_tracing.rs b/third_party/rust/wgpu-core/src/ray_tracing.rs index 2d8217dfe642..7810854ee580 100644 --- a/third_party/rust/wgpu-core/src/ray_tracing.rs +++ b/third_party/rust/wgpu-core/src/ray_tracing.rs @@ -130,6 +130,10 @@ pub enum BuildAccelerationStructureError { #[error("Blas {0:?} is missing the flag USE_TRANSFORM but the transform buffer is set")] UseTransformMissing(ResourceErrorIdent), + #[error( + "Tlas {0:?} dependent {1:?} is missing AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN" + )] + TlasDependentMissingVertexReturn(ResourceErrorIdent, ResourceErrorIdent), } #[derive(Clone, Debug, Error)] diff --git a/third_party/rust/wgpu-core/src/registry.rs b/third_party/rust/wgpu-core/src/registry.rs index 753fb0c1e747..e015eb93af3a 100644 --- a/third_party/rust/wgpu-core/src/registry.rs +++ b/third_party/rust/wgpu-core/src/registry.rs @@ -1,5 +1,4 @@ use alloc::sync::Arc; -use core::mem::size_of; use crate::{ id::Id, diff --git a/third_party/rust/wgpu-core/src/validation.rs b/third_party/rust/wgpu-core/src/validation.rs index 274cfab1c19a..175c47a06a6b 100644 --- a/third_party/rust/wgpu-core/src/validation.rs +++ b/third_party/rust/wgpu-core/src/validation.rs @@ -25,7 +25,9 @@ enum ResourceType { Sampler { comparison: bool, }, - AccelerationStructure, + AccelerationStructure { + vertex_return: bool, + }, } #[derive(Clone, Debug)] @@ -42,7 +44,7 @@ impl From<&ResourceType> for BindingTypeName { ResourceType::Buffer { .. } => BindingTypeName::Buffer, ResourceType::Texture { .. } => BindingTypeName::Texture, ResourceType::Sampler { .. } => BindingTypeName::Sampler, - ResourceType::AccelerationStructure => BindingTypeName::AccelerationStructure, + ResourceType::AccelerationStructure { .. } => BindingTypeName::AccelerationStructure, } } } @@ -54,7 +56,7 @@ impl From<&BindingType> for BindingTypeName { BindingType::Texture { .. } => BindingTypeName::Texture, BindingType::StorageTexture { .. } => BindingTypeName::Texture, BindingType::Sampler { .. } => BindingTypeName::Sampler, - BindingType::AccelerationStructure => BindingTypeName::AccelerationStructure, + BindingType::AccelerationStructure { .. } => BindingTypeName::AccelerationStructure, } } } @@ -557,8 +559,10 @@ impl Resource { }); } } - ResourceType::AccelerationStructure => match entry.ty { - BindingType::AccelerationStructure => (), + ResourceType::AccelerationStructure { vertex_return } => match entry.ty { + BindingType::AccelerationStructure { + vertex_return: entry_vertex_return, + } if vertex_return == entry_vertex_return => (), _ => { return Err(BindingError::WrongType { binding: (&entry.ty).into(), @@ -650,7 +654,9 @@ impl Resource { }, } } - ResourceType::AccelerationStructure => BindingType::AccelerationStructure, + ResourceType::AccelerationStructure { vertex_return } => { + BindingType::AccelerationStructure { vertex_return } + } }) } } @@ -949,7 +955,9 @@ impl Interface { class, }, naga::TypeInner::Sampler { comparison } => ResourceType::Sampler { comparison }, - naga::TypeInner::AccelerationStructure => ResourceType::AccelerationStructure, + naga::TypeInner::AccelerationStructure { vertex_return } => { + ResourceType::AccelerationStructure { vertex_return } + } ref other => ResourceType::Buffer { size: wgt::BufferSize::new(other.size(module.to_ctx()) as u64).unwrap(), }, diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index 510f35ce430a..d43166424831 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"315946dd2cfcabf35baa0ecfd7bc34498bc0c1cfb5e144a256fde35d0dc8e2e1","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"cf9e84804a635e4a8a9fefc596be9da6bf7354dde0d105e27d56a12cb20dd8e3","build.rs":"25a0d16603ace556f145da6c7121b5aeca4f33dbbb4b6e655610cbb2fc15b715","examples/halmark/main.rs":"305774a69bffc6fa3f77c1211ef93bc4d107cbc055c237dfa4305cc17a078513","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"288dae4c701aa7e5ba498fdd03ea42e1046a27db0914d93c88a43a7953cb9064","examples/ray-traced-triangle/main.rs":"82ab4f9877c8f8ab6367c82bc939acf7b04b478ee95750885e3ce699bf9a8595","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"c7564baf7142ebcc1135e14f0c2600580edde8903279372bd25767fe532d20d3","src/auxil/dxgi/exception.rs":"7df3597c1fd6e7708f96a342846b87e6c6cc17fb9dbe09f6aec54984809a4818","src/auxil/dxgi/factory.rs":"fbae1cf83f4ac8cd356557fb3caa0da92c3968d68a36f5c8ea18b90b3bcaeeaa","src/auxil/dxgi/mod.rs":"56925eb2801c4abe80254ada791cd6587a97472f50df715534d61a362253e05b","src/auxil/dxgi/result.rs":"a14b8b0dd052e7dde11220043f180d2e8ce7ae522dea6e96536c82db13fc7abc","src/auxil/dxgi/time.rs":"6235cc071b8535b4b58f843dbaf4ff4564a37e80a99c452c4a8988e436192483","src/auxil/mod.rs":"ebb7c070f75a598822ce10c6563c6ffb49e941882c1b435000d71a493bba79f6","src/auxil/renderdoc.rs":"0d106fb77746805c18334d957dcf67f9f547d17471117664b9523232d496c2b9","src/dx12/adapter.rs":"5f5382601d4fec4678bdd73c90b7ed83866a9b86fb58b35e8bef641635a80019","src/dx12/command.rs":"f88073ef59047c38b923e1528726ec1116302e8d8fbf070174d3154b031d232a","src/dx12/conv.rs":"d459258a78e3976843692c2e8f9ebea8ca9385edd84a3b18cb9299ec10fae954","src/dx12/descriptor.rs":"fa523bb069b775065367a71edad7fbbfa2bad6f952a4781b048ecec0d35b70fb","src/dx12/device.rs":"08d68412b191d58a8c75e760fad72926773db27998ab224f700d91b7f19e1a3d","src/dx12/instance.rs":"a3d8a18579b403ce7f9228b15999f1bf8a75ad0c97517426a9c6296011007e16","src/dx12/mod.rs":"4651f29935e5b892d79f0286e002a006c1ad279cc255b9f90a6532dc32cf4e3f","src/dx12/sampler.rs":"402b5850dc64ab23b760fa9ab44c229ed808bc4ab58f78de0b889b68a0e207c0","src/dx12/shader_compilation.rs":"23ac90865f1247556627ed4c7f70a8b5d4fb739f6bb6ab825355852127223f49","src/dx12/suballocation.rs":"ff637f0c1d618ea2abf259c13b7830ba15fba77d026c575835afa459261283b6","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"3f4c23a34b86e3bfbcb11169a9dec5e1c21425e7ecad846b36c159ced0138cee","src/dynamic/adapter.rs":"e93f7d082a3950c9e8ccff8a631d251c7598b4b25dda9fe6347dadfa3ba07829","src/dynamic/command.rs":"6857c98892ba5c8781a529baa96158ef9ab3e94c9cac91306b585cc3a5f0eeb4","src/dynamic/device.rs":"79edfe57569bf999b9abfaf6e84cec27ce9afd8aa6c38c7cd53640a6cda43580","src/dynamic/instance.rs":"7b515c201e1ca24f24439544dbfa1d19ea1412a4f89bd803e009aed13b021e55","src/dynamic/mod.rs":"b02a3c11b22c896cf66ef206f5d4bb4e24988ecadc29972c572baf347f54aa04","src/dynamic/queue.rs":"d76abb4797e90253386d24584f186dbe1909e772560156b2e891fa043cfefbdc","src/dynamic/surface.rs":"4328c2fe86931f50aa00ac3d6982d0879b774eebf7a507903d1b1898c891fb4d","src/gles/adapter.rs":"2ec2d31cc04a00d04904967023f8a679c90b4ab980209c589289d947b61c4e02","src/gles/command.rs":"4eea78b72e612f7894858db5f73ec78a3d5c7d849bc88542c8ee9e9cbd70ac13","src/gles/conv.rs":"7f885dd2bc72641d22f8f2e688ebdd857663bfe315f1b5364ea302f99a05adbf","src/gles/device.rs":"94ec02c783b2f117c60e17a0a69d4d240a152ee3b8596e71706d0eb65c94435e","src/gles/egl.rs":"214384161b21637e1ec5a45aa593735788dc485ab899dd2af19ea17a61096bc6","src/gles/emscripten.rs":"316d2bb6f2a4bb126dbe68a223f7393399080d116b61c39504454acdf4f9cfaf","src/gles/fence.rs":"083cd49747aba6272002aba0b0c37e5768cdbc2a1b8bacd1a244ee905d3f7b0f","src/gles/mod.rs":"712602084bf330228215476d71307191ddf72d1b85d7e77e4e60e7225b2768d5","src/gles/queue.rs":"76024dd5ecee17ebda0f41b5e764cad79871d47e96989916dd13080bc9bc907c","src/gles/shaders/clear.frag":"9133ed8ed97d3641fbb6b5f5ea894a3554c629ccc1b80a5fc9221d7293aa1954","src/gles/shaders/clear.vert":"a543768725f4121ff2e9e1fb5b00644931e9d6f2f946c0ef01968afb5a135abd","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"cb5940bf7b2381811675011b640040274f407a7d1908d0f82c813d6a9d3b00f7","src/gles/wgl.rs":"bffa0fc29e2b2e74ab48742ab3f222a2a453b2e4f3bb4271b60e3f60baba9633","src/lib.rs":"240e178bcf0c9a44fede1a74569550a861d57212866938b8970bc3bd6c7fcb26","src/metal/adapter.rs":"6fef5b86aa923a75495adc5a51f4b9c7fa78da3194e7a58d3c6c527a2032f3f3","src/metal/command.rs":"99b36de2791d83fa5b3753f7b1a8d20d46c3df7faace1c2f4a07ae3aa1e2ba73","src/metal/conv.rs":"17f37cf5fea93b437e5ec9cfff9ae96e2c6a7f23fb2d3890616fb8dbeb5f13c4","src/metal/device.rs":"751e61be66afd5f1746226c76cfc16491581fdede9259aadb4c433ebbda5a810","src/metal/layer_observer.rs":"630a11dbfd67929db67716b5f82f2bdb9ba93366b6f5d1aa8fb3eccd8ef61ee5","src/metal/mod.rs":"967d9d9616c18f79f912a59e58e25a8e849586379383e10f45b0c1f9ef9cb2e2","src/metal/surface.rs":"828cf6f22bb5038afbd471d4164ecc256e832d51b0a845a12be839289f8bded8","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/noop/buffer.rs":"89a938411204b33082200a1306fe589587de15142392d7ec591676512e4cfeb2","src/noop/command.rs":"f804e2cb0011b02cafc063b553d4a320018989f31a989f5fb007f2f1110ed5e4","src/noop/mod.rs":"ed8dabadd35a35dd8f3849b2fb79012402fb87e7b9c4a8e05fbd46ec52ffd50c","src/vulkan/adapter.rs":"e8186d2c002df6833cdf50a4c97eebe7cabf21ff427d22a9a7d8f35310d6e131","src/vulkan/command.rs":"3cbed7e1ed7f38a3915bc204f827d43d36ed6b65d21642097f7d938e9951ea4a","src/vulkan/conv.rs":"4132f37cc738d29d58d47147c57ea980bd3c46ec9a6324620197e3782e358e67","src/vulkan/device.rs":"f9b8ff56ea2a95a95b25629b91030e9407df97b83abab5781e129fe6165feaa7","src/vulkan/instance.rs":"1ba189d00b43d6476016fa0da2aed3d243dfcf1a08d97ada88629a7a2470e674","src/vulkan/mod.rs":"806c54d72e0beb9971054a77adb071bcbe4abfac459f209045e7b199f6284800","src/vulkan/sampler.rs":"77a91ec2e61481256eddcff7c4081d72b5cda09e2824333d77945da9eada8933"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"75c99f62573453c460f6ab67716feb3a98d55bead62449001641596fdb2d6dc6","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","README.md":"cf9e84804a635e4a8a9fefc596be9da6bf7354dde0d105e27d56a12cb20dd8e3","build.rs":"40c99bddda32846afd639d84b9a160ddab338092560b5cb3402112ff37ab4fba","examples/halmark/main.rs":"a16c6902b2ad1a4d8db8d057091b47259d5f59e63058b07a4bada6c7defd9312","examples/halmark/shader.wgsl":"26c256ec36d6f0e9a1647431ca772766bee4382d64eaa718ba7b488dcfb6bcca","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"288dae4c701aa7e5ba498fdd03ea42e1046a27db0914d93c88a43a7953cb9064","examples/ray-traced-triangle/main.rs":"3d702095bd8295a0f762fded0e123845beb4d2c25bda2cf05c2de94a9420023c","examples/ray-traced-triangle/shader.wgsl":"cc10caf92746724a71f6dd0dbc3a71e57b37c7d1d83278556805a535c0728a9d","src/auxil/dxgi/conv.rs":"c7564baf7142ebcc1135e14f0c2600580edde8903279372bd25767fe532d20d3","src/auxil/dxgi/exception.rs":"7df3597c1fd6e7708f96a342846b87e6c6cc17fb9dbe09f6aec54984809a4818","src/auxil/dxgi/factory.rs":"fbae1cf83f4ac8cd356557fb3caa0da92c3968d68a36f5c8ea18b90b3bcaeeaa","src/auxil/dxgi/mod.rs":"56925eb2801c4abe80254ada791cd6587a97472f50df715534d61a362253e05b","src/auxil/dxgi/result.rs":"a14b8b0dd052e7dde11220043f180d2e8ce7ae522dea6e96536c82db13fc7abc","src/auxil/dxgi/time.rs":"1414a57363adf8381d89d9c1efdf9eee471081e1a2a583ae90f0310fd8902fd4","src/auxil/mod.rs":"ebb7c070f75a598822ce10c6563c6ffb49e941882c1b435000d71a493bba79f6","src/auxil/renderdoc.rs":"e687710ea0c9e88c9be0e2acd39d136635b835ffb941886b875811b3ec945080","src/dx12/adapter.rs":"6e419e59202a65ce22b3c64d20a1a22a61ae2d6cafc5d1f3b229d676962fa45f","src/dx12/command.rs":"b348f945b4af33aecf667139c8ec7a697d5cf8cbb686c3220ac655c86164b876","src/dx12/conv.rs":"818bbbac8bb593fe1b0346b69cfd36c68e9a78e8be7e9f1ecac62a19133fc2ff","src/dx12/descriptor.rs":"fa523bb069b775065367a71edad7fbbfa2bad6f952a4781b048ecec0d35b70fb","src/dx12/device.rs":"fbcaafabb8db61541b3dba622fb4d863f04e69b46f4fc0dc350d7854a7e7f888","src/dx12/instance.rs":"626ff3377fae82a356da3ebc66b6c453a6c9bfb0bb0cce51c4c3f20b2d9df964","src/dx12/mod.rs":"9346dbe200189216c2ff88c8a11ec5636eca45afd46920c4c373650935efea53","src/dx12/sampler.rs":"402b5850dc64ab23b760fa9ab44c229ed808bc4ab58f78de0b889b68a0e207c0","src/dx12/shader_compilation.rs":"590fd829ed1e7c55a0373017b5695481895e76f9127588f2966e78502949b371","src/dx12/suballocation.rs":"ff637f0c1d618ea2abf259c13b7830ba15fba77d026c575835afa459261283b6","src/dx12/types.rs":"3fc7619fc09303eb3c936d4ded6889f94ce9e8b9aa62742ce900baa1b1e1cca7","src/dx12/view.rs":"3f4c23a34b86e3bfbcb11169a9dec5e1c21425e7ecad846b36c159ced0138cee","src/dynamic/adapter.rs":"e93f7d082a3950c9e8ccff8a631d251c7598b4b25dda9fe6347dadfa3ba07829","src/dynamic/command.rs":"a67394c333b2f0773717d64d7ca9a900868e7ce46dac832ec09a17a5a84bfa43","src/dynamic/device.rs":"230c48fba8e49cc46c420bcd1621beaf9802be9e65710cbfc2c1aea78e91b573","src/dynamic/instance.rs":"7b515c201e1ca24f24439544dbfa1d19ea1412a4f89bd803e009aed13b021e55","src/dynamic/mod.rs":"b02a3c11b22c896cf66ef206f5d4bb4e24988ecadc29972c572baf347f54aa04","src/dynamic/queue.rs":"d76abb4797e90253386d24584f186dbe1909e772560156b2e891fa043cfefbdc","src/dynamic/surface.rs":"4328c2fe86931f50aa00ac3d6982d0879b774eebf7a507903d1b1898c891fb4d","src/gles/adapter.rs":"e0187c442af127cb3940af9f1c5b27836a290bed706ca2177b7e03e1ae3021ef","src/gles/command.rs":"11becc2f9e6171b0cc90456d9c414b94e7f2152a53e4753c90aca3c42ab0204f","src/gles/conv.rs":"7f885dd2bc72641d22f8f2e688ebdd857663bfe315f1b5364ea302f99a05adbf","src/gles/device.rs":"061a883e5a8c15f20afbda8ab4b4a85482793abdeb49f27433d73865efecc54c","src/gles/egl.rs":"c9737871f276c81f1994ebd55dabf8817cb46bdb4ecd495b1c28b52aba8f74fd","src/gles/emscripten.rs":"316d2bb6f2a4bb126dbe68a223f7393399080d116b61c39504454acdf4f9cfaf","src/gles/fence.rs":"083cd49747aba6272002aba0b0c37e5768cdbc2a1b8bacd1a244ee905d3f7b0f","src/gles/mod.rs":"346cbbe8bd070b24f36aefd3c425d8c255716a675a3ce182f12c39f580f6a077","src/gles/queue.rs":"992099d38a23d1f30292749932e627e74d490b62fbbba945b0349ac04d86dd88","src/gles/shaders/clear.frag":"9133ed8ed97d3641fbb6b5f5ea894a3554c629ccc1b80a5fc9221d7293aa1954","src/gles/shaders/clear.vert":"a543768725f4121ff2e9e1fb5b00644931e9d6f2f946c0ef01968afb5a135abd","src/gles/shaders/srgb_present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/srgb_present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"cb5940bf7b2381811675011b640040274f407a7d1908d0f82c813d6a9d3b00f7","src/gles/wgl.rs":"4242466a745e2263204e61b7de011c4a9a4c559ab06ae4df063685762b0cd042","src/lib.rs":"46ce110c98da4c32a678010f75d0b60bb44e55ed3edc139d8234d9e760d796b9","src/metal/adapter.rs":"6fef5b86aa923a75495adc5a51f4b9c7fa78da3194e7a58d3c6c527a2032f3f3","src/metal/command.rs":"e8af9260abc9852fce35d4dda981750c8f4c4d970ca9959e48442a036414aa8a","src/metal/conv.rs":"17f37cf5fea93b437e5ec9cfff9ae96e2c6a7f23fb2d3890616fb8dbeb5f13c4","src/metal/device.rs":"7874cfb8c865c2e65bfc07489b61a58f67a40974749b705a25172db444064ff5","src/metal/layer_observer.rs":"8370a6e443d01739b951b8538ee719a03b69fc0cbac92c748db418fbcc8837b5","src/metal/mod.rs":"8ea1846700e700e932178093b63955ce31ba7540d16af01dff4da3dcea91b939","src/metal/surface.rs":"828cf6f22bb5038afbd471d4164ecc256e832d51b0a845a12be839289f8bded8","src/metal/time.rs":"c32d69f30e846dfcc0e39e01097fb80df63b2bebb6586143bb62494999850246","src/noop/buffer.rs":"89a938411204b33082200a1306fe589587de15142392d7ec591676512e4cfeb2","src/noop/command.rs":"917b70ac315101633094b3f92744310a60940747a2cc8a9368141200ce0ed1fd","src/noop/mod.rs":"1af00e4b7bd2e57fec3c1dfbd56efd5acf3dfeb9f2d3618f91a6e40cdce6d59d","src/vulkan/adapter.rs":"0d5207d17ed4877da8e09e213e8dc2947dbb28c29716920644da059b51f71690","src/vulkan/command.rs":"571662697bdfd6d8f5dada24a57dd72b6324f9f3abc787025adca67df7455cd4","src/vulkan/conv.rs":"ebb9bd12bfcf2c596d89c515b3d767241d61beb7cc138c61759a627183f23aa7","src/vulkan/device.rs":"f87cdf45597436e70e973fac66cac0bada184e86d663808d1872f0a5b768760f","src/vulkan/drm.rs":"4b067b273d45c54578b419ec6037bc55fa364f0053fd949de07152334ff49fa7","src/vulkan/instance.rs":"c76b5ceaf2be18f8334963114b9e5002c31b8edb375a2fffc6b8eef4cda820ad","src/vulkan/mod.rs":"025833e3521186838a50219ef4a584fd7b388cc88a7901db75a33ad32790d66b","src/vulkan/sampler.rs":"77a91ec2e61481256eddcff7c4081d72b5cda09e2824333d77945da9eada8933"},"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 acfdfe38cd8f..36c54bae43d1 100644 --- a/third_party/rust/wgpu-hal/Cargo.toml +++ b/third_party/rust/wgpu-hal/Cargo.toml @@ -11,7 +11,7 @@ [package] edition = "2021" -rust-version = "1.76" +rust-version = "1.82.0" name = "wgpu-hal" version = "24.0.0" authors = ["gfx-rs developers"] @@ -81,6 +81,7 @@ gles = [ "naga/glsl-out", "dep:arrayvec", "dep:bytemuck", + "dep:cfg-if", "dep:glow", "dep:glutin_wgl_sys", "dep:hashbrown", @@ -89,10 +90,10 @@ gles = [ "dep:libloading", "dep:log", "dep:ndk-sys", + "dep:objc", "dep:profiling", "dep:wasm-bindgen", "dep:web-sys", - "once_cell/std", "windows/Win32_Graphics_OpenGL", "windows/Win32_Graphics_Gdi", "windows/Win32_System_LibraryLoader", @@ -160,7 +161,7 @@ optional = true default-features = false [dependencies.bitflags] -version = "2.7" +version = "2.9" [dependencies.bytemuck] version = "1.21" @@ -171,6 +172,10 @@ features = [ ] optional = true +[dependencies.cfg-if] +version = "1" +optional = true + [dependencies.glow] version = "0.16" optional = true diff --git a/third_party/rust/wgpu-hal/build.rs b/third_party/rust/wgpu-hal/build.rs index d67321a72d8a..960f6453008d 100644 --- a/third_party/rust/wgpu-hal/build.rs +++ b/third_party/rust/wgpu-hal/build.rs @@ -9,6 +9,18 @@ fn main() { Emscripten: { all(target_os = "emscripten", gles) }, dx12: { all(target_os = "windows", feature = "dx12") }, gles: { all(feature = "gles") }, + // Within the GL ES backend, use `std` and be Send + Sync only if we are using a target + // that, among the ones where the GL ES backend is supported, has `std`. + gles_with_std: { all( + feature = "gles", + any( + not(target_arch = "wasm32"), + // Accept wasm32-unknown-unknown, which uniquely has a stub `std` + all(target_vendor = "unknown", target_os = "unknown"), + // Accept wasm32-unknown-emscripten and similar, which has a real `std` + target_os = "emscripten" + ) + ) }, metal: { all(target_vendor = "apple", feature = "metal") }, vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") }, // ⚠️ Keep in sync with target.cfg() definition in Cargo.toml and cfg_alias in `wgpu` crate ⚠️ diff --git a/third_party/rust/wgpu-hal/examples/halmark/main.rs b/third_party/rust/wgpu-hal/examples/halmark/main.rs index 731d9f0f0261..f7ce594d610e 100644 --- a/third_party/rust/wgpu-hal/examples/halmark/main.rs +++ b/third_party/rust/wgpu-hal/examples/halmark/main.rs @@ -14,9 +14,7 @@ use winit::{ use std::{ borrow::{Borrow, Cow}, - iter, - mem::size_of, - ptr, + iter, ptr, time::Instant, }; diff --git a/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs b/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs index 730f6b111cd2..9e2a7771e122 100644 --- a/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs +++ b/third_party/rust/wgpu-hal/examples/ray-traced-triangle/main.rs @@ -8,9 +8,7 @@ use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; use glam::{Affine3A, Mat4, Vec3}; use std::{ borrow::{Borrow, Cow}, - iter, - mem::size_of, - ptr, + iter, ptr, time::Instant, }; use wgpu_types::Dx12BackendOptions; @@ -344,7 +342,9 @@ impl Example { wgpu_types::BindGroupLayoutEntry { binding: 2, visibility: wgpu_types::ShaderStages::COMPUTE, - ty: wgpu_types::BindingType::AccelerationStructure, + ty: wgpu_types::BindingType::AccelerationStructure { + vertex_return: false, + }, count: None, }, ], diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/time.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/time.rs index 1b312fd6518b..752a4845a62f 100644 --- a/third_party/rust/wgpu-hal/src/auxil/dxgi/time.rs +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/time.rs @@ -62,7 +62,11 @@ impl PresentationTimer { let kernelbase = libloading::os::windows::Library::open_already_loaded("kernelbase.dll").unwrap(); // No concerns about lifetimes here as kernelbase is always there. - let ptr = unsafe { kernelbase.get(b"QueryInterruptTimePrecise\0").unwrap() }; + let ptr = unsafe { + kernelbase + .get(c"QueryInterruptTimePrecise".to_bytes()) + .unwrap() + }; Self::IPresentationManager { fnQueryInterruptTimePrecise: *ptr, } diff --git a/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs b/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs index c5fa96c7941f..2770869be582 100644 --- a/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs +++ b/third_party/rust/wgpu-hal/src/auxil/renderdoc.rs @@ -1,6 +1,7 @@ //! RenderDoc integration - #![cfg_attr(not(any(feature = "gles", feature = "vulkan")), allow(dead_code))] +use alloc::format; use alloc::string::String; use core::{ffi, ptr}; @@ -71,7 +72,7 @@ impl RenderDoc { }; let get_api: libloading::Symbol = - match unsafe { renderdoc_lib.get(b"RENDERDOC_GetAPI\0") } { + match unsafe { renderdoc_lib.get(c"RENDERDOC_GetAPI".to_bytes()) } { Ok(api) => api, Err(e) => { return RenderDoc::NotAvailable { diff --git a/third_party/rust/wgpu-hal/src/dx12/adapter.rs b/third_party/rust/wgpu-hal/src/dx12/adapter.rs index bc5c943d88b0..82b62c5161bb 100644 --- a/third_party/rust/wgpu-hal/src/dx12/adapter.rs +++ b/third_party/rust/wgpu-hal/src/dx12/adapter.rs @@ -1,11 +1,4 @@ -use std::{ - mem::{size_of, size_of_val}, - ptr, - string::String, - sync::Arc, - thread, - vec::Vec, -}; +use std::{ptr, string::String, sync::Arc, thread, vec::Vec}; use parking_lot::Mutex; use windows::{ diff --git a/third_party/rust/wgpu-hal/src/dx12/command.rs b/third_party/rust/wgpu-hal/src/dx12/command.rs index 474500d145a5..5ca6b87cdc9f 100644 --- a/third_party/rust/wgpu-hal/src/dx12/command.rs +++ b/third_party/rust/wgpu-hal/src/dx12/command.rs @@ -1179,6 +1179,14 @@ impl crate::CommandEncoder for super::CommandEncoder { ) } } + unsafe fn draw_mesh_tasks( + &mut self, + _group_count_x: u32, + _group_count_y: u32, + _group_count_z: u32, + ) { + unreachable!() + } unsafe fn draw_indirect( &mut self, buffer: &super::Buffer, @@ -1215,6 +1223,14 @@ impl crate::CommandEncoder for super::CommandEncoder { ) } } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _draw_count: u32, + ) { + unreachable!() + } unsafe fn draw_indirect_count( &mut self, buffer: &super::Buffer, @@ -1255,6 +1271,16 @@ impl crate::CommandEncoder for super::CommandEncoder { ) } } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _count_buffer: &::Buffer, + _count_offset: wgt::BufferAddress, + _max_count: u32, + ) { + unreachable!() + } // compute diff --git a/third_party/rust/wgpu-hal/src/dx12/conv.rs b/third_party/rust/wgpu-hal/src/dx12/conv.rs index 3342a6ab06be..b636dbc8d54a 100644 --- a/third_party/rust/wgpu-hal/src/dx12/conv.rs +++ b/third_party/rust/wgpu-hal/src/dx12/conv.rs @@ -114,7 +114,7 @@ pub fn map_binding_type(ty: &wgt::BindingType) -> Direct3D12::D3D12_DESCRIPTOR_R .. } | Bt::StorageTexture { .. } => Direct3D12::D3D12_DESCRIPTOR_RANGE_TYPE_UAV, - Bt::AccelerationStructure => Direct3D12::D3D12_DESCRIPTOR_RANGE_TYPE_SRV, + Bt::AccelerationStructure { .. } => Direct3D12::D3D12_DESCRIPTOR_RANGE_TYPE_SRV, } } diff --git a/third_party/rust/wgpu-hal/src/dx12/device.rs b/third_party/rust/wgpu-hal/src/dx12/device.rs index 9c344fd94d28..87e611a188b2 100644 --- a/third_party/rust/wgpu-hal/src/dx12/device.rs +++ b/third_party/rust/wgpu-hal/src/dx12/device.rs @@ -1,7 +1,6 @@ use std::{ borrow::Cow, - ffi, - mem::{self, size_of, size_of_val}, + ffi, mem, num::NonZeroU32, ptr, slice, string::{String, ToString as _}, @@ -31,7 +30,7 @@ use crate::{ }; // this has to match Naga's HLSL backend, and also needs to be null-terminated -const NAGA_LOCATION_SEMANTIC: &[u8] = b"LOC\0"; +const NAGA_LOCATION_SEMANTIC: &[u8] = c"LOC".to_bytes(); impl super::Device { pub(super) fn new( @@ -774,7 +773,7 @@ impl crate::Device for super::Device { wgt::BindingType::Buffer { .. } | wgt::BindingType::Texture { .. } | wgt::BindingType::StorageTexture { .. } - | wgt::BindingType::AccelerationStructure => num_views += count, + | wgt::BindingType::AccelerationStructure { .. } => num_views += count, wgt::BindingType::Sampler { .. } => has_sampler_in_group = true, } } @@ -1515,7 +1514,7 @@ impl crate::Device for super::Device { sampler_indexes.push(data.index); } } - wgt::BindingType::AccelerationStructure => { + wgt::BindingType::AccelerationStructure { .. } => { let start = entry.resource_index as usize; let end = start + entry.count as usize; for data in &desc.acceleration_structures[start..end] { @@ -1884,6 +1883,18 @@ impl crate::Device for super::Device { vertex_strides, }) } + + unsafe fn create_mesh_pipeline( + &self, + _desc: &crate::MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, crate::PipelineError> { + unreachable!() + } + unsafe fn destroy_render_pipeline(&self, _pipeline: super::RenderPipeline) { self.counters.render_pipelines.sub(1); } diff --git a/third_party/rust/wgpu-hal/src/dx12/instance.rs b/third_party/rust/wgpu-hal/src/dx12/instance.rs index 69f1ac78648c..ef02c8aca7bb 100644 --- a/third_party/rust/wgpu-hal/src/dx12/instance.rs +++ b/third_party/rust/wgpu-hal/src/dx12/instance.rs @@ -1,4 +1,4 @@ -use std::{mem::size_of_val, string::String, sync::Arc, vec::Vec}; +use std::{string::String, sync::Arc, vec::Vec}; use parking_lot::RwLock; use windows::{ diff --git a/third_party/rust/wgpu-hal/src/dx12/mod.rs b/third_party/rust/wgpu-hal/src/dx12/mod.rs index 99e29e87c936..1df48860288c 100644 --- a/third_party/rust/wgpu-hal/src/dx12/mod.rs +++ b/third_party/rust/wgpu-hal/src/dx12/mod.rs @@ -158,7 +158,8 @@ impl D3D12Lib { riid: *const windows_core::GUID, ppdevice: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; - let func: libloading::Symbol = unsafe { self.lib.get(b"D3D12CreateDevice\0") }?; + let func: libloading::Symbol = + unsafe { self.lib.get(c"D3D12CreateDevice".to_bytes()) }?; let mut result__: Option = None; @@ -199,7 +200,7 @@ impl D3D12Lib { pperrorblob: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; let func: libloading::Symbol = - unsafe { self.lib.get(b"D3D12SerializeRootSignature\0") }?; + unsafe { self.lib.get(c"D3D12SerializeRootSignature".to_bytes()) }?; let desc = Direct3D12::D3D12_ROOT_SIGNATURE_DESC { NumParameters: parameters.len() as _, @@ -238,7 +239,8 @@ impl D3D12Lib { riid: *const windows_core::GUID, ppvdebug: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; - let func: libloading::Symbol = unsafe { self.lib.get(b"D3D12GetDebugInterface\0") }?; + let func: libloading::Symbol = + unsafe { self.lib.get(c"D3D12GetDebugInterface".to_bytes()) }?; let mut result__ = None; @@ -275,7 +277,8 @@ impl DxgiLib { riid: *const windows_core::GUID, pdebug: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; - let func: libloading::Symbol = unsafe { self.lib.get(b"DXGIGetDebugInterface1\0") }?; + let func: libloading::Symbol = + unsafe { self.lib.get(c"DXGIGetDebugInterface1".to_bytes()) }?; let mut result__ = None; @@ -304,7 +307,8 @@ impl DxgiLib { riid: *const windows_core::GUID, ppfactory: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; - let func: libloading::Symbol = unsafe { self.lib.get(b"CreateDXGIFactory2\0") }?; + let func: libloading::Symbol = + unsafe { self.lib.get(c"CreateDXGIFactory2".to_bytes()) }?; let mut result__ = None; @@ -326,7 +330,8 @@ impl DxgiLib { riid: *const windows_core::GUID, ppfactory: *mut *mut core::ffi::c_void, ) -> windows_core::HRESULT; - let func: libloading::Symbol = unsafe { self.lib.get(b"CreateDXGIFactory1\0") }?; + let func: libloading::Symbol = + unsafe { self.lib.get(c"CreateDXGIFactory1".to_bytes()) }?; let mut result__ = None; @@ -665,6 +670,12 @@ pub struct Queue { temp_lists: Mutex>>, } +impl Queue { + pub fn as_raw(&self) -> &Direct3D12::ID3D12CommandQueue { + &self.raw + } +} + unsafe impl Send for Queue {} unsafe impl Sync for Queue {} diff --git a/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs b/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs index f9f3a6b74073..4574fac5d40e 100644 --- a/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs +++ b/third_party/rust/wgpu-hal/src/dx12/shader_compilation.rs @@ -112,7 +112,7 @@ impl DxcLib { -> windows_core::HRESULT; let func: libloading::Symbol = - self.lib.get(b"DxcCreateInstance\0")?; + self.lib.get(c"DxcCreateInstance".to_bytes())?; dxc_create_instance::(|clsid, iid, ppv| func(clsid, iid, ppv)) } } diff --git a/third_party/rust/wgpu-hal/src/dynamic/command.rs b/third_party/rust/wgpu-hal/src/dynamic/command.rs index 7b79866ad14d..a33930262740 100644 --- a/third_party/rust/wgpu-hal/src/dynamic/command.rs +++ b/third_party/rust/wgpu-hal/src/dynamic/command.rs @@ -130,6 +130,12 @@ pub trait DynCommandEncoder: DynResource + core::fmt::Debug { first_instance: u32, instance_count: u32, ); + unsafe fn draw_mesh_tasks( + &mut self, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, + ); unsafe fn draw_indirect( &mut self, buffer: &dyn DynBuffer, @@ -142,6 +148,12 @@ pub trait DynCommandEncoder: DynResource + core::fmt::Debug { offset: wgt::BufferAddress, draw_count: u32, ); + unsafe fn draw_mesh_tasks_indirect( + &mut self, + buffer: &dyn DynBuffer, + offset: wgt::BufferAddress, + draw_count: u32, + ); unsafe fn draw_indirect_count( &mut self, buffer: &dyn DynBuffer, @@ -158,6 +170,14 @@ pub trait DynCommandEncoder: DynResource + core::fmt::Debug { count_offset: wgt::BufferAddress, max_count: u32, ); + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + buffer: &dyn DynBuffer, + offset: wgt::BufferAddress, + count_buffer: &dyn DynBuffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ); unsafe fn begin_compute_pass(&mut self, desc: &ComputePassDescriptor); unsafe fn end_compute_pass(&mut self); @@ -473,6 +493,15 @@ impl DynCommandEncoder for C { }; } + unsafe fn draw_mesh_tasks( + &mut self, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, + ) { + unsafe { C::draw_mesh_tasks(self, group_count_x, group_count_y, group_count_z) }; + } + unsafe fn draw_indirect( &mut self, buffer: &dyn DynBuffer, @@ -493,6 +522,16 @@ impl DynCommandEncoder for C { unsafe { C::draw_indexed_indirect(self, buffer, offset, draw_count) }; } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + buffer: &dyn DynBuffer, + offset: wgt::BufferAddress, + draw_count: u32, + ) { + let buffer = buffer.expect_downcast_ref(); + unsafe { C::draw_mesh_tasks_indirect(self, buffer, offset, draw_count) }; + } + unsafe fn draw_indirect_count( &mut self, buffer: &dyn DynBuffer, @@ -530,6 +569,28 @@ impl DynCommandEncoder for C { }; } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + buffer: &dyn DynBuffer, + offset: wgt::BufferAddress, + count_buffer: &dyn DynBuffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ) { + let buffer = buffer.expect_downcast_ref(); + let count_buffer = count_buffer.expect_downcast_ref(); + unsafe { + C::draw_mesh_tasks_indirect_count( + self, + buffer, + offset, + count_buffer, + count_offset, + max_count, + ) + }; + } + unsafe fn begin_compute_pass(&mut self, desc: &ComputePassDescriptor) { let desc = ComputePassDescriptor { label: desc.label, diff --git a/third_party/rust/wgpu-hal/src/dynamic/device.rs b/third_party/rust/wgpu-hal/src/dynamic/device.rs index f0519609cc10..c0de61f88c2d 100644 --- a/third_party/rust/wgpu-hal/src/dynamic/device.rs +++ b/third_party/rust/wgpu-hal/src/dynamic/device.rs @@ -4,10 +4,10 @@ use crate::{ AccelerationStructureBuildSizes, AccelerationStructureDescriptor, Api, BindGroupDescriptor, BindGroupLayoutDescriptor, BufferDescriptor, BufferMapping, CommandEncoderDescriptor, ComputePipelineDescriptor, Device, DeviceError, FenceValue, - GetAccelerationStructureBuildSizesDescriptor, Label, MemoryRange, PipelineCacheDescriptor, - PipelineCacheError, PipelineError, PipelineLayoutDescriptor, RenderPipelineDescriptor, - SamplerDescriptor, ShaderError, ShaderInput, ShaderModuleDescriptor, TextureDescriptor, - TextureViewDescriptor, TlasInstance, + GetAccelerationStructureBuildSizesDescriptor, Label, MemoryRange, MeshPipelineDescriptor, + PipelineCacheDescriptor, PipelineCacheError, PipelineError, PipelineLayoutDescriptor, + RenderPipelineDescriptor, SamplerDescriptor, ShaderError, ShaderInput, ShaderModuleDescriptor, + TextureDescriptor, TextureViewDescriptor, TlasInstance, }; use super::{ @@ -100,6 +100,14 @@ pub trait DynDevice: DynResource { dyn DynPipelineCache, >, ) -> Result, PipelineError>; + unsafe fn create_mesh_pipeline( + &self, + desc: &MeshPipelineDescriptor< + dyn DynPipelineLayout, + dyn DynShaderModule, + dyn DynPipelineCache, + >, + ) -> Result, PipelineError>; unsafe fn destroy_render_pipeline(&self, pipeline: Box); unsafe fn create_compute_pipeline( @@ -393,6 +401,32 @@ impl DynDevice for D { .map(|b| -> Box { Box::new(b) }) } + unsafe fn create_mesh_pipeline( + &self, + desc: &MeshPipelineDescriptor< + dyn DynPipelineLayout, + dyn DynShaderModule, + dyn DynPipelineCache, + >, + ) -> Result, PipelineError> { + let desc = MeshPipelineDescriptor { + label: desc.label, + layout: desc.layout.expect_downcast_ref(), + task_stage: desc.task_stage.clone().map(|f| f.expect_downcast()), + mesh_stage: desc.mesh_stage.clone().expect_downcast(), + primitive: desc.primitive, + depth_stencil: desc.depth_stencil.clone(), + multisample: desc.multisample, + fragment_stage: desc.fragment_stage.clone().map(|f| f.expect_downcast()), + color_targets: desc.color_targets, + multiview: desc.multiview, + cache: desc.cache.map(|c| c.expect_downcast_ref()), + }; + + unsafe { D::create_mesh_pipeline(self, &desc) } + .map(|b| -> Box { Box::new(b) }) + } + unsafe fn destroy_render_pipeline(&self, pipeline: Box) { unsafe { D::destroy_render_pipeline(self, pipeline.unbox()) }; } diff --git a/third_party/rust/wgpu-hal/src/gles/adapter.rs b/third_party/rust/wgpu-hal/src/gles/adapter.rs index 248e7f7a5d2a..ff476645b8a7 100644 --- a/third_party/rust/wgpu-hal/src/gles/adapter.rs +++ b/third_party/rust/wgpu-hal/src/gles/adapter.rs @@ -203,7 +203,9 @@ impl super::Adapter { // emscripten doesn't enable "WEBGL_debug_renderer_info" extension by default. so, we do it manually. // See https://github.com/gfx-rs/wgpu/issues/3245 for context #[cfg(Emscripten)] - if unsafe { super::emscripten::enable_extension("WEBGL_debug_renderer_info\0") } { + if unsafe { + super::emscripten::enable_extension(c"WEBGL_debug_renderer_info".to_str().unwrap()) + } { (GL_UNMASKED_VENDOR_WEBGL, GL_UNMASKED_RENDERER_WEBGL) } else { (glow::VENDOR, glow::RENDERER) diff --git a/third_party/rust/wgpu-hal/src/gles/command.rs b/third_party/rust/wgpu-hal/src/gles/command.rs index 2bff6278f1c8..9644018b371d 100644 --- a/third_party/rust/wgpu-hal/src/gles/command.rs +++ b/third_party/rust/wgpu-hal/src/gles/command.rs @@ -1,9 +1,5 @@ use alloc::string::String; -use core::{ - mem::{self, size_of, size_of_val}, - ops::Range, - slice, -}; +use core::{mem, ops::Range, slice}; use arrayvec::ArrayVec; @@ -1077,6 +1073,14 @@ impl crate::CommandEncoder for super::CommandEncoder { first_instance_location: self.state.first_instance_location.clone(), }); } + unsafe fn draw_mesh_tasks( + &mut self, + _group_count_x: u32, + _group_count_y: u32, + _group_count_z: u32, + ) { + unreachable!() + } unsafe fn draw_indirect( &mut self, buffer: &super::Buffer, @@ -1120,6 +1124,14 @@ impl crate::CommandEncoder for super::CommandEncoder { }); } } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _draw_count: u32, + ) { + unreachable!() + } unsafe fn draw_indirect_count( &mut self, _buffer: &super::Buffer, @@ -1140,6 +1152,16 @@ impl crate::CommandEncoder for super::CommandEncoder { ) { unreachable!() } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _count_buffer: &::Buffer, + _count_offset: wgt::BufferAddress, + _max_count: u32, + ) { + unreachable!() + } // compute diff --git a/third_party/rust/wgpu-hal/src/gles/device.rs b/third_party/rust/wgpu-hal/src/gles/device.rs index 56060de656a4..2cf1de9cdf4c 100644 --- a/third_party/rust/wgpu-hal/src/gles/device.rs +++ b/third_party/rust/wgpu-hal/src/gles/device.rs @@ -2,13 +2,12 @@ use alloc::{ borrow::ToOwned, format, string::String, string::ToString as _, sync::Arc, vec, vec::Vec, }; use core::{cmp::max, convert::TryInto, num::NonZeroU32, ptr, sync::atomic::Ordering}; -use std::sync::Mutex; use arrayvec::ArrayVec; use glow::HasContext; use naga::FastHashMap; -use super::{conv, PrivateCapabilities}; +use super::{conv, lock, MaybeMutex, PrivateCapabilities}; use crate::auxil::map_naga_stage; use crate::TlasInstance; @@ -526,8 +525,8 @@ impl crate::Device for super::Device { target, size: desc.size, map_flags: 0, - data: Some(Arc::new(Mutex::new(vec![0; desc.size as usize]))), - offset_of_current_mapping: Arc::new(Mutex::new(0)), + data: Some(Arc::new(MaybeMutex::new(vec![0; desc.size as usize]))), + offset_of_current_mapping: Arc::new(MaybeMutex::new(0)), }); } @@ -614,7 +613,7 @@ impl crate::Device for super::Device { } let data = if emulate_map && desc.usage.contains(wgt::BufferUses::MAP_READ) { - Some(Arc::new(Mutex::new(vec![0; desc.size as usize]))) + Some(Arc::new(MaybeMutex::new(vec![0; desc.size as usize]))) } else { None }; @@ -627,7 +626,7 @@ impl crate::Device for super::Device { size: desc.size, map_flags, data, - offset_of_current_mapping: Arc::new(Mutex::new(0)), + offset_of_current_mapping: Arc::new(MaybeMutex::new(0)), }) } @@ -652,7 +651,7 @@ impl crate::Device for super::Device { let is_coherent = buffer.map_flags & glow::MAP_COHERENT_BIT != 0; let ptr = match buffer.raw { None => { - let mut vec = buffer.data.as_ref().unwrap().lock().unwrap(); + let mut vec = lock(buffer.data.as_ref().unwrap()); let slice = &mut vec.as_mut_slice()[range.start as usize..range.end as usize]; slice.as_mut_ptr() } @@ -660,12 +659,12 @@ impl crate::Device for super::Device { let gl = &self.shared.context.lock(); unsafe { gl.bind_buffer(buffer.target, Some(raw)) }; let ptr = if let Some(ref map_read_allocation) = buffer.data { - let mut guard = map_read_allocation.lock().unwrap(); + let mut guard = lock(map_read_allocation); let slice = guard.as_mut_slice(); unsafe { self.shared.get_buffer_sub_data(gl, buffer.target, 0, slice) }; slice.as_mut_ptr() } else { - *buffer.offset_of_current_mapping.lock().unwrap() = range.start; + *lock(&buffer.offset_of_current_mapping) = range.start; unsafe { gl.map_buffer_range( buffer.target, @@ -691,7 +690,7 @@ impl crate::Device for super::Device { unsafe { gl.bind_buffer(buffer.target, Some(raw)) }; unsafe { gl.unmap_buffer(buffer.target) }; unsafe { gl.bind_buffer(buffer.target, None) }; - *buffer.offset_of_current_mapping.lock().unwrap() = 0; + *lock(&buffer.offset_of_current_mapping) = 0; } } } @@ -704,8 +703,7 @@ impl crate::Device for super::Device { let gl = &self.shared.context.lock(); unsafe { gl.bind_buffer(buffer.target, Some(raw)) }; for range in ranges { - let offset_of_current_mapping = - *buffer.offset_of_current_mapping.lock().unwrap(); + let offset_of_current_mapping = *lock(&buffer.offset_of_current_mapping); unsafe { gl.flush_mapped_buffer_range( buffer.target, @@ -1191,7 +1189,7 @@ impl crate::Device for super::Device { ty: wgt::BufferBindingType::Storage { .. }, .. } => &mut num_storage_buffers, - wgt::BindingType::AccelerationStructure => unimplemented!(), + wgt::BindingType::AccelerationStructure { .. } => unimplemented!(), }; binding_to_slot[entry.binding as usize] = *counter; @@ -1301,7 +1299,7 @@ impl crate::Device for super::Device { format: format_desc.internal, }) } - wgt::BindingType::AccelerationStructure => unimplemented!(), + wgt::BindingType::AccelerationStructure { .. } => unimplemented!(), }; contents.push(binding); } @@ -1415,6 +1413,16 @@ impl crate::Device for super::Device { alpha_to_coverage_enabled: desc.multisample.alpha_to_coverage_enabled, }) } + unsafe fn create_mesh_pipeline( + &self, + _desc: &crate::MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, crate::PipelineError> { + unreachable!() + } unsafe fn destroy_render_pipeline(&self, pipeline: super::RenderPipeline) { // If the pipeline only has 2 strong references remaining, they're `pipeline` and `program_cache` diff --git a/third_party/rust/wgpu-hal/src/gles/egl.rs b/third_party/rust/wgpu-hal/src/gles/egl.rs index c88abb28c111..6f246cad194c 100644 --- a/third_party/rust/wgpu-hal/src/gles/egl.rs +++ b/third_party/rust/wgpu-hal/src/gles/egl.rs @@ -1,13 +1,19 @@ #![allow(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] use std::{ - ffi, mem::ManuallyDrop, os::raw, ptr, rc::Rc, string::String, sync::Arc, time::Duration, + ffi, + mem::ManuallyDrop, + os::raw, + ptr, + rc::Rc, + string::String, + sync::{Arc, LazyLock}, + time::Duration, vec::Vec, }; use glow::HasContext; use hashbrown::HashMap; -use once_cell::sync::Lazy; use parking_lot::{MappedMutexGuard, Mutex, MutexGuard, RwLock}; /// The amount of time to wait while trying to obtain a lock to the adapter context @@ -147,7 +153,7 @@ impl Drop for DisplayOwner { match self.display { DisplayRef::X11(ptr) => unsafe { let func: libloading::Symbol = - self.library.get(b"XCloseDisplay\0").unwrap(); + self.library.get(c"XCloseDisplay".to_bytes()).unwrap(); func(ptr.as_ptr()); }, DisplayRef::Wayland => {} @@ -159,7 +165,8 @@ fn open_x_display() -> Option { log::debug!("Loading X11 library to get the current display"); unsafe { let library = find_library(&["libX11.so.6", "libX11.so"])?; - let func: libloading::Symbol = library.get(b"XOpenDisplay\0").unwrap(); + let func: libloading::Symbol = + library.get(c"XOpenDisplay".to_bytes()).unwrap(); let result = func(ptr::null()); ptr::NonNull::new(result).map(|ptr| DisplayOwner { display: DisplayRef::X11(ptr), @@ -185,10 +192,12 @@ fn test_wayland_display() -> Option { log::debug!("Loading Wayland library to get the current display"); let library = unsafe { let client_library = find_library(&["libwayland-client.so.0", "libwayland-client.so"])?; - let wl_display_connect: libloading::Symbol = - client_library.get(b"wl_display_connect\0").unwrap(); - let wl_display_disconnect: libloading::Symbol = - client_library.get(b"wl_display_disconnect\0").unwrap(); + let wl_display_connect: libloading::Symbol = client_library + .get(c"wl_display_connect".to_bytes()) + .unwrap(); + let wl_display_disconnect: libloading::Symbol = client_library + .get(c"wl_display_disconnect".to_bytes()) + .unwrap(); let display = ptr::NonNull::new(wl_display_connect(ptr::null()))?; wl_display_disconnect(display.as_ptr()); find_library(&["libwayland-egl.so.1", "libwayland-egl.so"])? @@ -471,7 +480,8 @@ struct Inner { // Different calls to `eglGetPlatformDisplay` may return the same `Display`, making it a global // state of all our `EglContext`s. This forces us to track the number of such context to prevent // terminating the display if it's currently used by another `EglContext`. -static DISPLAYS_REFERENCE_COUNT: Lazy>> = Lazy::new(Default::default); +static DISPLAYS_REFERENCE_COUNT: LazyLock>> = + LazyLock::new(Default::default); fn initialize_display( egl: &EglInstance, @@ -1317,7 +1327,7 @@ impl crate::Surface for Surface { (WindowKind::Wayland, Rwh::Wayland(handle)) => { let library = &self.wsi.display_owner.as_ref().unwrap().library; let wl_egl_window_create: libloading::Symbol = - unsafe { library.get(b"wl_egl_window_create\0") }.unwrap(); + unsafe { library.get(c"wl_egl_window_create".to_bytes()) }.unwrap(); let window = unsafe { wl_egl_window_create(handle.surface.as_ptr(), 640, 480) } .cast(); @@ -1429,7 +1439,7 @@ impl crate::Surface for Surface { if let Some(window) = wl_window { let library = &self.wsi.display_owner.as_ref().unwrap().library; let wl_egl_window_resize: libloading::Symbol = - unsafe { library.get(b"wl_egl_window_resize\0") }.unwrap(); + unsafe { library.get(c"wl_egl_window_resize".to_bytes()) }.unwrap(); unsafe { wl_egl_window_resize( window, @@ -1501,7 +1511,7 @@ impl crate::Surface for Surface { .expect("unsupported window") .library; let wl_egl_window_destroy: libloading::Symbol = - unsafe { library.get(b"wl_egl_window_destroy\0") }.unwrap(); + unsafe { library.get(c"wl_egl_window_destroy".to_bytes()) }.unwrap(); unsafe { wl_egl_window_destroy(window) }; } } diff --git a/third_party/rust/wgpu-hal/src/gles/mod.rs b/third_party/rust/wgpu-hal/src/gles/mod.rs index 756838d776da..ab434b90dd1b 100644 --- a/third_party/rust/wgpu-hal/src/gles/mod.rs +++ b/third_party/rust/wgpu-hal/src/gles/mod.rs @@ -346,8 +346,8 @@ pub struct Buffer { target: BindTarget, size: wgt::BufferAddress, map_flags: u32, - data: Option>>>, - offset_of_current_mapping: Arc>, + data: Option>>>, + offset_of_current_mapping: Arc>, } #[cfg(send_sync)] @@ -1093,3 +1093,26 @@ fn gl_debug_message_callback(source: u32, gltype: u32, id: u32, severity: u32, m crate::VALIDATION_CANARY.add(message.to_string()); } } + +// If we are using `std`, then use `Mutex` to provide `Send` and `Sync` +cfg_if::cfg_if! { + if #[cfg(gles_with_std)] { + type MaybeMutex = std::sync::Mutex; + + fn lock(mutex: &MaybeMutex) -> std::sync::MutexGuard<'_, T> { + mutex.lock().unwrap() + } + } else { + // It should be impossible for any build configuration to trigger this error + // It is intended only as a guard against changes elsewhere causing the use of + // `RefCell` here to become unsound. + #[cfg(all(send_sync, not(feature = "fragile-send-sync-non-atomic-wasm")))] + compile_error!("cannot provide non-fragile Send+Sync without std"); + + type MaybeMutex = core::cell::RefCell; + + fn lock(mutex: &MaybeMutex) -> core::cell::RefMut<'_, T> { + mutex.borrow_mut() + } + } +} diff --git a/third_party/rust/wgpu-hal/src/gles/queue.rs b/third_party/rust/wgpu-hal/src/gles/queue.rs index 73681b7b70af..1d391f7bded6 100644 --- a/third_party/rust/wgpu-hal/src/gles/queue.rs +++ b/third_party/rust/wgpu-hal/src/gles/queue.rs @@ -1,9 +1,12 @@ -use super::{conv::is_layered_target, Command as C, PrivateCapabilities}; use alloc::sync::Arc; +use alloc::vec; +use core::{slice, sync::atomic::Ordering}; + use arrayvec::ArrayVec; -use core::{mem::size_of, slice, sync::atomic::Ordering}; use glow::HasContext; +use super::{conv::is_layered_target, lock, Command as C, PrivateCapabilities}; + const DEBUG_ID: u32 = 0; fn extract_marker<'a>(data: &'a [u8], range: &core::ops::Range) -> &'a str { @@ -340,7 +343,7 @@ impl super::Queue { } } None => { - dst.data.as_ref().unwrap().lock().unwrap().as_mut_slice() + lock(dst.data.as_ref().unwrap()).as_mut_slice() [range.start as usize..range.end as usize] .fill(0); } @@ -382,7 +385,7 @@ impl super::Queue { }; } (Some(src), None) => { - let mut data = dst.data.as_ref().unwrap().lock().unwrap(); + let mut data = lock(dst.data.as_ref().unwrap()); let dst_data = &mut data.as_mut_slice() [copy.dst_offset as usize..copy.dst_offset as usize + size]; @@ -397,7 +400,7 @@ impl super::Queue { }; } (None, Some(dst)) => { - let data = src.data.as_ref().unwrap().lock().unwrap(); + let data = lock(src.data.as_ref().unwrap()); let src_data = &data.as_slice() [copy.src_offset as usize..copy.src_offset as usize + size]; unsafe { gl.bind_buffer(copy_dst_target, Some(dst)) }; @@ -738,7 +741,7 @@ impl super::Queue { glow::PixelUnpackData::BufferOffset(copy.buffer_layout.offset as u32) } None => { - buffer_data = src.data.as_ref().unwrap().lock().unwrap(); + buffer_data = lock(src.data.as_ref().unwrap()); let src_data = &buffer_data.as_slice()[copy.buffer_layout.offset as usize..]; glow::PixelUnpackData::Slice(Some(src_data)) @@ -802,7 +805,7 @@ impl super::Queue { ) } None => { - buffer_data = src.data.as_ref().unwrap().lock().unwrap(); + buffer_data = lock(src.data.as_ref().unwrap()); let src_data = &buffer_data.as_slice() [(offset as usize)..(offset + bytes_in_upload) as usize]; glow::CompressedPixelUnpackData::Slice(src_data) @@ -883,7 +886,7 @@ impl super::Queue { glow::PixelPackData::BufferOffset(offset as u32) } None => { - buffer_data = dst.data.as_ref().unwrap().lock().unwrap(); + buffer_data = lock(dst.data.as_ref().unwrap()); let dst_data = &mut buffer_data.as_mut_slice()[offset as usize..]; glow::PixelPackData::Slice(Some(dst_data)) } @@ -1054,7 +1057,7 @@ impl super::Queue { }; } None => { - let data = &mut dst.data.as_ref().unwrap().lock().unwrap(); + let data = &mut lock(dst.data.as_ref().unwrap()); let len = query_data.len().min(data.len()); data[..len].copy_from_slice(&query_data[..len]); } diff --git a/third_party/rust/wgpu-hal/src/gles/wgl.rs b/third_party/rust/wgpu-hal/src/gles/wgl.rs index 0e7acc1884c6..13e276cfaee6 100644 --- a/third_party/rust/wgpu-hal/src/gles/wgl.rs +++ b/third_party/rust/wgpu-hal/src/gles/wgl.rs @@ -3,13 +3,13 @@ use std::{ borrow::ToOwned as _, ffi::{c_void, CStr, CString}, - mem::{self, size_of, size_of_val, ManuallyDrop}, + mem::{self, ManuallyDrop}, os::raw::c_int, ptr, string::String, sync::{ mpsc::{sync_channel, SyncSender}, - Arc, + Arc, LazyLock, }, thread, time::Duration, @@ -22,7 +22,6 @@ use glutin_wgl_sys::wgl_extra::{ CONTEXT_PROFILE_MASK_ARB, }; use hashbrown::HashSet; -use once_cell::sync::Lazy; use parking_lot::{Mutex, MutexGuard, RwLock}; use raw_window_handle::{RawDisplayHandle, RawWindowHandle}; use wgt::InstanceFlags; @@ -325,8 +324,8 @@ fn create_global_window_class() -> Result { } fn get_global_window_class() -> Result { - static GLOBAL: Lazy> = - Lazy::new(create_global_window_class); + static GLOBAL: LazyLock> = + LazyLock::new(create_global_window_class); GLOBAL.clone() } @@ -440,14 +439,13 @@ impl crate::Instance for Instance { unsafe fn init(desc: &crate::InstanceDescriptor) -> Result { profiling::scope!("Init OpenGL (WGL) Backend"); let opengl_module = - unsafe { LibraryLoader::LoadLibraryA(PCSTR("opengl32.dll\0".as_ptr())) }.map_err( - |e| { + unsafe { LibraryLoader::LoadLibraryA(PCSTR(c"opengl32.dll".as_ptr().cast())) } + .map_err(|e| { crate::InstanceError::with_source( String::from("unable to load the OpenGL library"), e, ) - }, - )?; + })?; let device = create_instance_device()?; let dc = device.dc; diff --git a/third_party/rust/wgpu-hal/src/lib.rs b/third_party/rust/wgpu-hal/src/lib.rs index cd7139b27de2..aa997a2d9dd6 100644 --- a/third_party/rust/wgpu-hal/src/lib.rs +++ b/third_party/rust/wgpu-hal/src/lib.rs @@ -240,8 +240,8 @@ extern crate alloc; extern crate wgpu_types as wgt; -// TODO(https://github.com/gfx-rs/wgpu/issues/6826): disable std except on noop and gles-WebGL. -// Requires Rust 1.81 for core::error::Error. +// Each of these backends needs `std` in some fashion; usually `std::thread` functions. +#[cfg(any(dx12, gles_with_std, metal, vulkan))] #[macro_use] extern crate std; @@ -290,12 +290,12 @@ use alloc::boxed::Box; use alloc::{borrow::Cow, string::String, sync::Arc, vec::Vec}; use core::{ borrow::Borrow, + error::Error, fmt, num::NonZeroU32, ops::{Range, RangeInclusive}, ptr::NonNull, }; -use std::error::Error; // TODO(https://github.com/gfx-rs/wgpu/issues/6826): use core::error after MSRV bump use bitflags::bitflags; use parking_lot::Mutex; @@ -304,7 +304,8 @@ use wgt::WasmNotSendSync; // - Vertex + Fragment // - Compute -pub const MAX_CONCURRENT_SHADER_STAGES: usize = 2; +// Task + Mesh + Fragment +pub const MAX_CONCURRENT_SHADER_STAGES: usize = 3; pub const MAX_ANISOTROPY: u8 = 16; pub const MAX_BIND_GROUPS: usize = 8; pub const MAX_VERTEX_BUFFERS: usize = 16; @@ -900,6 +901,15 @@ pub trait Device: WasmNotSendSync { ::PipelineCache, >, ) -> Result<::RenderPipeline, PipelineError>; + #[allow(clippy::type_complexity)] + unsafe fn create_mesh_pipeline( + &self, + desc: &MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, PipelineError>; unsafe fn destroy_render_pipeline(&self, pipeline: ::RenderPipeline); #[allow(clippy::type_complexity)] @@ -1457,6 +1467,26 @@ pub trait CommandEncoder: WasmNotSendSync + fmt::Debug { count_offset: wgt::BufferAddress, max_count: u32, ); + unsafe fn draw_mesh_tasks( + &mut self, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, + ); + unsafe fn draw_mesh_tasks_indirect( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + draw_count: u32, + ); + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + count_buffer: &::Buffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ); // compute passes @@ -2157,6 +2187,33 @@ pub struct RenderPipelineDescriptor< /// The cache which will be used and filled when compiling this pipeline pub cache: Option<&'a Pc>, } +pub struct MeshPipelineDescriptor< + 'a, + Pl: DynPipelineLayout + ?Sized, + M: DynShaderModule + ?Sized, + Pc: DynPipelineCache + ?Sized, +> { + pub label: Label<'a>, + /// The layout of bind groups for this pipeline. + pub layout: &'a Pl, + pub task_stage: Option>, + pub mesh_stage: ProgrammableStage<'a, M>, + /// The properties of the pipeline at the primitive assembly and rasterization level. + pub primitive: wgt::PrimitiveState, + /// The effect of draw calls on the depth and stencil aspects of the output target, if any. + pub depth_stencil: Option, + /// The multi-sampling properties of the pipeline. + pub multisample: wgt::MultisampleState, + /// The fragment stage for this pipeline. + pub fragment_stage: Option>, + /// The effect of draw calls on the color aspect of the output target. + pub color_targets: &'a [Option], + /// If the pipeline will be used with a multiview render pass, this indicates how many array + /// layers the attachments will have. + pub multiview: Option, + /// The cache which will be used and filled when compiling this pipeline + pub cache: Option<&'a Pc>, +} #[derive(Debug, Clone)] pub struct SurfaceConfiguration { diff --git a/third_party/rust/wgpu-hal/src/metal/command.rs b/third_party/rust/wgpu-hal/src/metal/command.rs index 65e3fafe7346..6f4f2e289ec6 100644 --- a/third_party/rust/wgpu-hal/src/metal/command.rs +++ b/third_party/rust/wgpu-hal/src/metal/command.rs @@ -2,7 +2,6 @@ use super::{conv, AsNative, TimestampQuerySupport}; use crate::CommandEncoder as _; use std::{ borrow::{Cow, ToOwned as _}, - mem::size_of, ops::Range, vec::Vec, }; @@ -1101,6 +1100,15 @@ impl crate::CommandEncoder for super::CommandEncoder { } } + unsafe fn draw_mesh_tasks( + &mut self, + _group_count_x: u32, + _group_count_y: u32, + _group_count_z: u32, + ) { + unreachable!() + } + unsafe fn draw_indirect( &mut self, buffer: &super::Buffer, @@ -1135,6 +1143,15 @@ impl crate::CommandEncoder for super::CommandEncoder { } } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _draw_count: u32, + ) { + unreachable!() + } + unsafe fn draw_indirect_count( &mut self, _buffer: &super::Buffer, @@ -1156,6 +1173,17 @@ impl crate::CommandEncoder for super::CommandEncoder { //TODO } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + _buffer: &::Buffer, + _offset: wgt::BufferAddress, + _count_buffer: &::Buffer, + _count_offset: wgt::BufferAddress, + _max_count: u32, + ) { + unreachable!() + } + // compute unsafe fn begin_compute_pass(&mut self, desc: &crate::ComputePassDescriptor) { @@ -1257,8 +1285,7 @@ impl crate::CommandEncoder for super::CommandEncoder { .zip(pipeline.work_group_memory_sizes.iter()) .enumerate() { - const ALIGN_MASK: u32 = 0xF; // must be a multiple of 16 bytes - let size = ((*pipeline_size - 1) | ALIGN_MASK) + 1; + let size = pipeline_size.next_multiple_of(16); if *cur_size != size { *cur_size = size; encoder.set_threadgroup_memory_length(index as _, size as _); diff --git a/third_party/rust/wgpu-hal/src/metal/device.rs b/third_party/rust/wgpu-hal/src/metal/device.rs index 885772909e4d..6fb172d0072c 100644 --- a/third_party/rust/wgpu-hal/src/metal/device.rs +++ b/third_party/rust/wgpu-hal/src/metal/device.rs @@ -735,7 +735,7 @@ impl crate::Device for super::Device { wgt::StorageTextureAccess::Atomic => true, }; } - wgt::BindingType::AccelerationStructure => unimplemented!(), + wgt::BindingType::AccelerationStructure { .. } => unimplemented!(), } } @@ -960,7 +960,7 @@ impl crate::Device for super::Device { ); counter.textures += 1; } - wgt::BindingType::AccelerationStructure => unimplemented!(), + wgt::BindingType::AccelerationStructure { .. } => unimplemented!(), } } } @@ -1269,6 +1269,17 @@ impl crate::Device for super::Device { }) } + unsafe fn create_mesh_pipeline( + &self, + _desc: &crate::MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, crate::PipelineError> { + unreachable!() + } + unsafe fn destroy_render_pipeline(&self, _pipeline: super::RenderPipeline) { self.counters.render_pipelines.sub(1); } diff --git a/third_party/rust/wgpu-hal/src/metal/layer_observer.rs b/third_party/rust/wgpu-hal/src/metal/layer_observer.rs index 6f1fade72eca..8acd83b53147 100644 --- a/third_party/rust/wgpu-hal/src/metal/layer_observer.rs +++ b/third_party/rust/wgpu-hal/src/metal/layer_observer.rs @@ -23,8 +23,8 @@ const NSKeyValueObservingOptionNew: usize = 0x01; #[allow(non_upper_case_globals)] const NSKeyValueObservingOptionInitial: usize = 0x04; -const CONTENTS_SCALE: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"contentsScale\0") }; -const BOUNDS: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"bounds\0") }; +const CONTENTS_SCALE: &CStr = c"contentsScale"; +const BOUNDS: &CStr = c"bounds"; /// Create a new custom layer that tracks parameters from the given super layer. /// diff --git a/third_party/rust/wgpu-hal/src/metal/mod.rs b/third_party/rust/wgpu-hal/src/metal/mod.rs index d97d67576bde..f8b04591a776 100644 --- a/third_party/rust/wgpu-hal/src/metal/mod.rs +++ b/third_party/rust/wgpu-hal/src/metal/mod.rs @@ -362,6 +362,10 @@ impl Queue { timestamp_period, } } + + pub fn as_raw(&self) -> &Arc> { + &self.raw + } } pub struct Device { diff --git a/third_party/rust/wgpu-hal/src/noop/command.rs b/third_party/rust/wgpu-hal/src/noop/command.rs index 000834109895..36b5c9216808 100644 --- a/third_party/rust/wgpu-hal/src/noop/command.rs +++ b/third_party/rust/wgpu-hal/src/noop/command.rs @@ -207,6 +207,13 @@ impl crate::CommandEncoder for CommandBuffer { instance_count: u32, ) { } + unsafe fn draw_mesh_tasks( + &mut self, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, + ) { + } unsafe fn draw_indirect( &mut self, buffer: &Buffer, @@ -221,6 +228,13 @@ impl crate::CommandEncoder for CommandBuffer { draw_count: u32, ) { } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + draw_count: u32, + ) { + } unsafe fn draw_indirect_count( &mut self, buffer: &Buffer, @@ -239,6 +253,15 @@ impl crate::CommandEncoder for CommandBuffer { max_count: u32, ) { } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + count_buffer: &::Buffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ) { + } // compute diff --git a/third_party/rust/wgpu-hal/src/noop/mod.rs b/third_party/rust/wgpu-hal/src/noop/mod.rs index b9ddb242cba9..f5f98539286f 100644 --- a/third_party/rust/wgpu-hal/src/noop/mod.rs +++ b/third_party/rust/wgpu-hal/src/noop/mod.rs @@ -368,6 +368,16 @@ impl crate::Device for Context { ) -> Result { Ok(Resource) } + unsafe fn create_mesh_pipeline( + &self, + desc: &crate::MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, crate::PipelineError> { + Ok(Resource) + } unsafe fn destroy_render_pipeline(&self, pipeline: Resource) {} unsafe fn create_compute_pipeline( &self, diff --git a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs index 477a7711f9db..e751464c235c 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs @@ -106,6 +106,7 @@ pub struct PhysicalDeviceFeatures { /// to Vulkan 1.3. zero_initialize_workgroup_memory: Option>, + position_fetch: Option>, /// Features provided by `VK_KHR_shader_atomic_int64`, promoted to Vulkan 1.2. shader_atomic_int64: Option>, @@ -118,6 +119,12 @@ pub struct PhysicalDeviceFeatures { /// Features provided by `VK_EXT_subgroup_size_control`, promoted to Vulkan 1.3. subgroup_size_control: Option>, + + /// Features proved by `VK_KHR_maintenance4`, needed for mesh shaders + maintenance4: Option>, + + /// Features proved by `VK_EXT_mesh_shader` + mesh_shader: Option>, } impl PhysicalDeviceFeatures { @@ -142,6 +149,9 @@ impl PhysicalDeviceFeatures { if let Some(ref mut feature) = self.robustness2 { info = info.push_next(feature); } + if let Some(ref mut feature) = self.multiview { + info = info.push_next(feature); + } if let Some(ref mut feature) = self.astc_hdr { info = info.push_next(feature); } @@ -164,6 +174,9 @@ impl PhysicalDeviceFeatures { if let Some(ref mut feature) = self.shader_atomic_int64 { info = info.push_next(feature); } + if let Some(ref mut feature) = self.position_fetch { + info = info.push_next(feature); + } if let Some(ref mut feature) = self.shader_image_atomic_int64 { info = info.push_next(feature); } @@ -173,6 +186,12 @@ impl PhysicalDeviceFeatures { if let Some(ref mut feature) = self.subgroup_size_control { info = info.push_next(feature); } + if let Some(ref mut feature) = self.maintenance4 { + info = info.push_next(feature); + } + if let Some(ref mut feature) = self.mesh_shader { + info = info.push_next(feature); + } info } @@ -203,12 +222,14 @@ impl PhysicalDeviceFeatures { /// [`add_to_device_create`]: PhysicalDeviceFeatures::add_to_device_create /// [`Adapter::required_device_extensions`]: super::Adapter::required_device_extensions fn from_extensions_and_requested_features( - device_api_version: u32, + phd_capabilities: &PhysicalDeviceProperties, + _phd_features: &PhysicalDeviceFeatures, enabled_extensions: &[&'static CStr], requested_features: wgt::Features, downlevel_flags: wgt::DownlevelFlags, private_caps: &super::PrivateCapabilities, ) -> Self { + let device_api_version = phd_capabilities.device_api_version; let needs_bindless = requested_features.intersects( wgt::Features::TEXTURE_BINDING_ARRAY | wgt::Features::BUFFER_BINDING_ARRAY @@ -465,6 +486,32 @@ impl PhysicalDeviceFeatures { } else { None }, + position_fetch: if enabled_extensions.contains(&khr::ray_tracing_position_fetch::NAME) { + Some( + vk::PhysicalDeviceRayTracingPositionFetchFeaturesKHR::default() + .ray_tracing_position_fetch(true), + ) + } else { + None + }, + mesh_shader: if enabled_extensions.contains(&ext::mesh_shader::NAME) { + let needed = requested_features.contains(wgt::Features::MESH_SHADER); + Some( + vk::PhysicalDeviceMeshShaderFeaturesEXT::default() + .mesh_shader(needed) + .task_shader(needed) + // Multiview needs some special work https://github.com/gfx-rs/wgpu/issues/7262 + .multiview_mesh_shader(false), + ) + } else { + None + }, + maintenance4: if enabled_extensions.contains(&khr::maintenance4::NAME) { + let needed = requested_features.contains(wgt::Features::MESH_SHADER); + Some(vk::PhysicalDeviceMaintenance4FeaturesKHR::default().maintenance4(needed)) + } else { + None + }, } } @@ -609,6 +656,10 @@ impl PhysicalDeviceFeatures { F::CONSERVATIVE_RASTERIZATION, caps.supports_extension(ext::conservative_rasterization::NAME), ); + features.set( + F::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN, + caps.supports_extension(khr::ray_tracing_position_fetch::NAME), + ); if let Some(ref descriptor_indexing) = self.descriptor_indexing { // We use update-after-bind descriptors for all bind groups containing binding arrays. @@ -784,7 +835,10 @@ impl PhysicalDeviceFeatures { F::VULKAN_EXTERNAL_MEMORY_WIN32, caps.supports_extension(khr::external_memory_win32::NAME), ); - + features.set( + F::MESH_SHADER, + caps.supports_extension(ext::mesh_shader::NAME), + ); (features, dl_flags) } } @@ -846,6 +900,10 @@ pub struct PhysicalDeviceProperties { /// `VK_EXT_robustness2` extension. robustness2: Option>, + /// Additional `vk::PhysicalDevice` properties from the + /// `VK_EXT_mesh_shader` extension. + _mesh_shader: Option>, + /// The device API version. /// /// Which is the version of Vulkan supported for device-level functionality. @@ -947,6 +1005,10 @@ impl PhysicalDeviceProperties { } } + if requested_features.intersects(wgt::Features::MESH_SHADER) { + extensions.push(khr::spirv_1_4::NAME); + } + //extensions.push(khr::sampler_mirror_clamp_to_edge::NAME); //extensions.push(ext::sampler_filter_minmax::NAME); } @@ -961,6 +1023,10 @@ impl PhysicalDeviceProperties { if requested_features.contains(wgt::Features::SUBGROUP) { extensions.push(ext::subgroup_size_control::NAME); } + + if requested_features.intersects(wgt::Features::MESH_SHADER) { + extensions.push(khr::maintenance4::NAME); + } } // Optional `VK_KHR_swapchain_mutable_format` @@ -999,6 +1065,10 @@ impl PhysicalDeviceProperties { extensions.push(khr::ray_query::NAME); } + if requested_features.contains(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN) { + extensions.push(khr::ray_tracing_position_fetch::NAME) + } + // Require `VK_EXT_conservative_rasterization` if the associated feature was requested if requested_features.contains(wgt::Features::CONSERVATIVE_RASTERIZATION) { extensions.push(ext::conservative_rasterization::NAME); @@ -1035,6 +1105,10 @@ impl PhysicalDeviceProperties { extensions.push(google::display_timing::NAME); } + if requested_features.contains(wgt::Features::MESH_SHADER) { + extensions.push(ext::mesh_shader::NAME); + } + extensions } @@ -1216,6 +1290,8 @@ impl super::InstanceShared { let supports_acceleration_structure = capabilities.supports_extension(khr::acceleration_structure::NAME); + let supports_mesh_shader = capabilities.supports_extension(ext::mesh_shader::NAME); + let mut properties2 = vk::PhysicalDeviceProperties2KHR::default(); if supports_maintenance3 { let next = capabilities @@ -1266,6 +1342,13 @@ impl super::InstanceShared { properties2 = properties2.push_next(next); } + if supports_mesh_shader { + let next = capabilities + ._mesh_shader + .insert(vk::PhysicalDeviceMeshShaderPropertiesEXT::default()); + properties2 = properties2.push_next(next); + } + unsafe { get_device_properties.get_physical_device_properties2(phd, &mut properties2) }; @@ -1392,6 +1475,13 @@ impl super::InstanceShared { features2 = features2.push_next(next); } + if capabilities.supports_extension(khr::ray_tracing_position_fetch::NAME) { + let next = features + .position_fetch + .insert(vk::PhysicalDeviceRayTracingPositionFetchFeaturesKHR::default()); + features2 = features2.push_next(next); + } + // `VK_KHR_zero_initialize_workgroup_memory` is promoted to 1.3 if capabilities.device_api_version >= vk::API_VERSION_1_3 || capabilities.supports_extension(khr::zero_initialize_workgroup_memory::NAME) @@ -1412,6 +1502,13 @@ impl super::InstanceShared { features2 = features2.push_next(next); } + if capabilities.supports_extension(ext::mesh_shader::NAME) { + let next = features + .mesh_shader + .insert(vk::PhysicalDeviceMeshShaderFeaturesEXT::default()); + features2 = features2.push_next(next); + } + unsafe { get_device_properties.get_physical_device_features2(phd, &mut features2) }; features2.features } else { @@ -1471,7 +1568,6 @@ impl super::Instance { }, backend: wgt::Backend::Vulkan, }; - let (available_features, downlevel_flags) = phd_features.to_wgpu(&self.shared.raw, phd, &phd_capabilities); let mut workarounds = super::Workarounds::empty(); @@ -1626,7 +1722,7 @@ impl super::Instance { | vk::MemoryPropertyFlags::HOST_CACHED | vk::MemoryPropertyFlags::LAZILY_ALLOCATED, phd_capabilities, - //phd_features, + phd_features, downlevel_flags, private_caps, workarounds, @@ -1691,7 +1787,8 @@ impl super::Adapter { features: wgt::Features, ) -> PhysicalDeviceFeatures { PhysicalDeviceFeatures::from_extensions_and_requested_features( - self.phd_capabilities.device_api_version, + &self.phd_capabilities, + &self.phd_features, enabled_extensions, features, self.downlevel_flags, @@ -1780,6 +1877,14 @@ impl super::Adapter { } else { None }; + let mesh_shading_fns = if enabled_extensions.contains(&ext::mesh_shader::NAME) { + Some(ext::mesh_shader::Device::new( + &self.instance.raw, + &raw_device, + )) + } else { + None + }; let naga_options = { use naga::back::spv; @@ -1881,6 +1986,9 @@ impl super::Adapter { if features.contains(wgt::Features::EXPERIMENTAL_RAY_QUERY) { capabilities.push(spv::Capability::RayQueryKHR); } + if features.contains(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN) { + capabilities.push(spv::Capability::RayQueryPositionFetchKHR) + } spv::Options { lang_version: if features .intersects(wgt::Features::SUBGROUP | wgt::Features::SUBGROUP_VERTEX) @@ -1955,6 +2063,7 @@ impl super::Adapter { draw_indirect_count: indirect_count_fn, timeline_semaphore: timeline_semaphore_fn, ray_tracing: ray_tracing_fns, + mesh_shading: mesh_shading_fns, }, pipeline_cache_validation_key, vendor_id: self.phd_capabilities.properties.vendor_id, @@ -2083,6 +2192,10 @@ impl super::Adapter { Ok(crate::OpenDevice { device, queue }) } + + pub fn texture_format_as_raw(&self, texture_format: wgt::TextureFormat) -> vk::Format { + self.private_caps.map_texture_format(texture_format) + } } impl crate::Adapter for super::Adapter { diff --git a/third_party/rust/wgpu-hal/src/vulkan/command.rs b/third_party/rust/wgpu-hal/src/vulkan/command.rs index ca19d0dcaecf..03659efba33c 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/command.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/command.rs @@ -3,11 +3,7 @@ use super::conv; use arrayvec::ArrayVec; use ash::vk; -use std::{ - mem::{self, size_of}, - ops::Range, - slice, -}; +use std::{mem, ops::Range, slice}; const ALLOCATION_GRANULARITY: u32 = 16; const DST_IMAGE_LAYOUT: vk::ImageLayout = vk::ImageLayout::TRANSFER_DST_OPTIMAL; @@ -1051,6 +1047,20 @@ impl crate::CommandEncoder for super::CommandEncoder { ) }; } + unsafe fn draw_mesh_tasks( + &mut self, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, + ) { + if let Some(ref t) = self.device.extension_fns.mesh_shading { + unsafe { + t.cmd_draw_mesh_tasks(self.active, group_count_x, group_count_y, group_count_z); + }; + } else { + panic!("Feature `MESH_SHADING` not enabled"); + } + } unsafe fn draw_indirect( &mut self, buffer: &super::Buffer, @@ -1083,6 +1093,26 @@ impl crate::CommandEncoder for super::CommandEncoder { ) }; } + unsafe fn draw_mesh_tasks_indirect( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + draw_count: u32, + ) { + if let Some(ref t) = self.device.extension_fns.mesh_shading { + unsafe { + t.cmd_draw_mesh_tasks_indirect( + self.active, + buffer.raw, + offset, + draw_count, + size_of::() as u32, + ); + }; + } else { + panic!("Feature `MESH_SHADING` not enabled"); + } + } unsafe fn draw_indirect_count( &mut self, buffer: &super::Buffer, @@ -1135,6 +1165,33 @@ impl crate::CommandEncoder for super::CommandEncoder { None => panic!("Feature `DRAW_INDIRECT_COUNT` not enabled"), } } + unsafe fn draw_mesh_tasks_indirect_count( + &mut self, + buffer: &::Buffer, + offset: wgt::BufferAddress, + count_buffer: &super::Buffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ) { + if self.device.extension_fns.draw_indirect_count.is_none() { + panic!("Feature `DRAW_INDIRECT_COUNT` not enabled"); + } + if let Some(ref t) = self.device.extension_fns.mesh_shading { + unsafe { + t.cmd_draw_mesh_tasks_indirect_count( + self.active, + buffer.raw, + offset, + count_buffer.raw, + count_offset, + max_count, + size_of::() as u32, + ); + }; + } else { + panic!("Feature `MESH_SHADING` not enabled"); + } + } // compute diff --git a/third_party/rust/wgpu-hal/src/vulkan/conv.rs b/third_party/rust/wgpu-hal/src/vulkan/conv.rs index 204d20adae2d..e1d5cb30e867 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/conv.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/conv.rs @@ -771,7 +771,9 @@ pub fn map_binding_type(ty: wgt::BindingType) -> vk::DescriptorType { wgt::BindingType::Sampler { .. } => vk::DescriptorType::SAMPLER, wgt::BindingType::Texture { .. } => vk::DescriptorType::SAMPLED_IMAGE, wgt::BindingType::StorageTexture { .. } => vk::DescriptorType::STORAGE_IMAGE, - wgt::BindingType::AccelerationStructure => vk::DescriptorType::ACCELERATION_STRUCTURE_KHR, + wgt::BindingType::AccelerationStructure { .. } => { + vk::DescriptorType::ACCELERATION_STRUCTURE_KHR + } } } @@ -953,6 +955,10 @@ pub fn map_acceleration_structure_flags( vk_flags |= vk::BuildAccelerationStructureFlagsKHR::ALLOW_COMPACTION } + if flags.contains(crate::AccelerationStructureBuildFlags::ALLOW_RAY_HIT_VERTEX_RETURN) { + vk_flags |= vk::BuildAccelerationStructureFlagsKHR::ALLOW_DATA_ACCESS + } + vk_flags } diff --git a/third_party/rust/wgpu-hal/src/vulkan/device.rs b/third_party/rust/wgpu-hal/src/vulkan/device.rs index 9fce6b37e46a..d12748fcfd4d 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/device.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/device.rs @@ -2,7 +2,7 @@ use std::{ borrow::{Cow, ToOwned as _}, collections::BTreeMap, ffi::{CStr, CString}, - mem::{self, size_of, MaybeUninit}, + mem::{self, MaybeUninit}, num::NonZeroU32, ptr, slice, sync::Arc, @@ -1446,7 +1446,7 @@ impl crate::Device for super::Device { wgt::BindingType::StorageTexture { .. } => { desc_count.storage_image += count; } - wgt::BindingType::AccelerationStructure => { + wgt::BindingType::AccelerationStructure { .. } => { desc_count.acceleration_structure += count; } } @@ -2120,6 +2120,237 @@ impl crate::Device for super::Device { Ok(super::RenderPipeline { raw }) } + unsafe fn create_mesh_pipeline( + &self, + desc: &crate::MeshPipelineDescriptor< + ::PipelineLayout, + ::ShaderModule, + ::PipelineCache, + >, + ) -> Result<::RenderPipeline, crate::PipelineError> { + let dynamic_states = [ + vk::DynamicState::VIEWPORT, + vk::DynamicState::SCISSOR, + vk::DynamicState::BLEND_CONSTANTS, + vk::DynamicState::STENCIL_REFERENCE, + ]; + let mut compatible_rp_key = super::RenderPassKey { + sample_count: desc.multisample.count, + multiview: desc.multiview, + ..Default::default() + }; + let mut stages = ArrayVec::<_, { crate::MAX_CONCURRENT_SHADER_STAGES }>::new(); + + let vk_input_assembly = vk::PipelineInputAssemblyStateCreateInfo::default() + .topology(conv::map_topology(desc.primitive.topology)) + .primitive_restart_enable(desc.primitive.strip_index_format.is_some()); + + let compiled_ts = match desc.task_stage { + Some(ref stage) => { + // TODO: add proper naga stages + let mut compiled = self.compile_stage( + stage, + naga::ShaderStage::Compute, + &desc.layout.binding_arrays, + )?; + compiled.create_info.stage = vk::ShaderStageFlags::TASK_EXT; + stages.push(compiled.create_info); + Some(compiled) + } + None => None, + }; + + // TODO: add proper naga stages + let mut compiled_ms = self.compile_stage( + &desc.mesh_stage, + naga::ShaderStage::Compute, + &desc.layout.binding_arrays, + )?; + compiled_ms.create_info.stage = vk::ShaderStageFlags::MESH_EXT; + stages.push(compiled_ms.create_info); + let compiled_fs = match desc.fragment_stage { + Some(ref stage) => { + let compiled = self.compile_stage( + stage, + naga::ShaderStage::Fragment, + &desc.layout.binding_arrays, + )?; + stages.push(compiled.create_info); + Some(compiled) + } + None => None, + }; + + let mut vk_rasterization = vk::PipelineRasterizationStateCreateInfo::default() + .polygon_mode(conv::map_polygon_mode(desc.primitive.polygon_mode)) + .front_face(conv::map_front_face(desc.primitive.front_face)) + .line_width(1.0) + .depth_clamp_enable(desc.primitive.unclipped_depth); + if let Some(face) = desc.primitive.cull_mode { + vk_rasterization = vk_rasterization.cull_mode(conv::map_cull_face(face)) + } + let mut vk_rasterization_conservative_state = + vk::PipelineRasterizationConservativeStateCreateInfoEXT::default() + .conservative_rasterization_mode( + vk::ConservativeRasterizationModeEXT::OVERESTIMATE, + ); + if desc.primitive.conservative { + vk_rasterization = vk_rasterization.push_next(&mut vk_rasterization_conservative_state); + } + + let mut vk_depth_stencil = vk::PipelineDepthStencilStateCreateInfo::default(); + if let Some(ref ds) = desc.depth_stencil { + let vk_format = self.shared.private_caps.map_texture_format(ds.format); + let vk_layout = if ds.is_read_only(desc.primitive.cull_mode) { + vk::ImageLayout::DEPTH_STENCIL_READ_ONLY_OPTIMAL + } else { + vk::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL + }; + compatible_rp_key.depth_stencil = Some(super::DepthStencilAttachmentKey { + base: super::AttachmentKey::compatible(vk_format, vk_layout), + stencil_ops: crate::AttachmentOps::all(), + }); + + if ds.is_depth_enabled() { + vk_depth_stencil = vk_depth_stencil + .depth_test_enable(true) + .depth_write_enable(ds.depth_write_enabled) + .depth_compare_op(conv::map_comparison(ds.depth_compare)); + } + if ds.stencil.is_enabled() { + let s = &ds.stencil; + let front = conv::map_stencil_face(&s.front, s.read_mask, s.write_mask); + let back = conv::map_stencil_face(&s.back, s.read_mask, s.write_mask); + vk_depth_stencil = vk_depth_stencil + .stencil_test_enable(true) + .front(front) + .back(back); + } + + if ds.bias.is_enabled() { + vk_rasterization = vk_rasterization + .depth_bias_enable(true) + .depth_bias_constant_factor(ds.bias.constant as f32) + .depth_bias_clamp(ds.bias.clamp) + .depth_bias_slope_factor(ds.bias.slope_scale); + } + } + + let vk_viewport = vk::PipelineViewportStateCreateInfo::default() + .flags(vk::PipelineViewportStateCreateFlags::empty()) + .scissor_count(1) + .viewport_count(1); + + let vk_sample_mask = [ + desc.multisample.mask as u32, + (desc.multisample.mask >> 32) as u32, + ]; + let vk_multisample = vk::PipelineMultisampleStateCreateInfo::default() + .rasterization_samples(vk::SampleCountFlags::from_raw(desc.multisample.count)) + .alpha_to_coverage_enable(desc.multisample.alpha_to_coverage_enabled) + .sample_mask(&vk_sample_mask); + + let mut vk_attachments = Vec::with_capacity(desc.color_targets.len()); + for cat in desc.color_targets { + let (key, attarchment) = if let Some(cat) = cat.as_ref() { + let mut vk_attachment = vk::PipelineColorBlendAttachmentState::default() + .color_write_mask(vk::ColorComponentFlags::from_raw(cat.write_mask.bits())); + if let Some(ref blend) = cat.blend { + let (color_op, color_src, color_dst) = conv::map_blend_component(&blend.color); + let (alpha_op, alpha_src, alpha_dst) = conv::map_blend_component(&blend.alpha); + vk_attachment = vk_attachment + .blend_enable(true) + .color_blend_op(color_op) + .src_color_blend_factor(color_src) + .dst_color_blend_factor(color_dst) + .alpha_blend_op(alpha_op) + .src_alpha_blend_factor(alpha_src) + .dst_alpha_blend_factor(alpha_dst); + } + + let vk_format = self.shared.private_caps.map_texture_format(cat.format); + ( + Some(super::ColorAttachmentKey { + base: super::AttachmentKey::compatible( + vk_format, + vk::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, + ), + resolve: None, + }), + vk_attachment, + ) + } else { + (None, vk::PipelineColorBlendAttachmentState::default()) + }; + + compatible_rp_key.colors.push(key); + vk_attachments.push(attarchment); + } + + let vk_color_blend = + vk::PipelineColorBlendStateCreateInfo::default().attachments(&vk_attachments); + + let vk_dynamic_state = + vk::PipelineDynamicStateCreateInfo::default().dynamic_states(&dynamic_states); + + let raw_pass = self.shared.make_render_pass(compatible_rp_key)?; + + let vk_infos = [{ + vk::GraphicsPipelineCreateInfo::default() + .layout(desc.layout.raw) + .stages(&stages) + .input_assembly_state(&vk_input_assembly) + .rasterization_state(&vk_rasterization) + .viewport_state(&vk_viewport) + .multisample_state(&vk_multisample) + .depth_stencil_state(&vk_depth_stencil) + .color_blend_state(&vk_color_blend) + .dynamic_state(&vk_dynamic_state) + .render_pass(raw_pass) + }]; + + let pipeline_cache = desc + .cache + .map(|it| it.raw) + .unwrap_or(vk::PipelineCache::null()); + + let mut raw_vec = { + profiling::scope!("vkCreateGraphicsPipelines"); + unsafe { + self.shared + .raw + .create_graphics_pipelines(pipeline_cache, &vk_infos, None) + .map_err(|(_, e)| super::map_pipeline_err(e)) + }? + }; + + let raw = raw_vec.pop().unwrap(); + if let Some(label) = desc.label { + unsafe { self.shared.set_object_name(raw, label) }; + } + // NOTE: this could leak shaders in case of an error. + if let Some(CompiledStage { + temp_raw_module: Some(raw_module), + .. + }) = compiled_ts + { + unsafe { self.shared.raw.destroy_shader_module(raw_module, None) }; + } + if let Some(raw_module) = compiled_ms.temp_raw_module { + unsafe { self.shared.raw.destroy_shader_module(raw_module, None) }; + } + if let Some(CompiledStage { + temp_raw_module: Some(raw_module), + .. + }) = compiled_fs + { + unsafe { self.shared.raw.destroy_shader_module(raw_module, None) }; + } + + self.counters.render_pipelines.add(1); + + Ok(super::RenderPipeline { raw }) + } unsafe fn destroy_render_pipeline(&self, pipeline: super::RenderPipeline) { unsafe { self.shared.raw.destroy_pipeline(pipeline.raw, None) }; diff --git a/third_party/rust/wgpu-hal/src/vulkan/drm.rs b/third_party/rust/wgpu-hal/src/vulkan/drm.rs new file mode 100644 index 000000000000..fdbda046181d --- /dev/null +++ b/third_party/rust/wgpu-hal/src/vulkan/drm.rs @@ -0,0 +1,147 @@ +#![cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))] + +use core::mem::MaybeUninit; +use std::{string::ToString, vec::Vec}; + +use ash::{ext, khr, vk}; + +impl super::Instance { + /// Creates a new surface from the given drm configuration. + /// + /// # Safety + /// + /// - All parameters must point to valid DRM values. + pub unsafe fn create_surface_from_drm( + &self, + fd: i32, + plane: u32, + connector_id: u32, + width: u32, + height: u32, + refresh_rate: u32, + ) -> Result { + if !self.shared.extensions.contains(&khr::display::NAME) { + return Err(crate::InstanceError::new( + "Vulkan driver does not support VK_KHR_display".to_string(), + )); + } + + let drm_stat = { + let mut stat = MaybeUninit::::uninit(); + + if unsafe { libc::fstat(fd, stat.as_mut_ptr()) } != 0 { + return Err(crate::InstanceError::new( + "Unable to fstat drm device".to_string(), + )); + } + + unsafe { stat.assume_init() } + }; + + let raw_devices = match unsafe { self.shared.raw.enumerate_physical_devices() } { + Ok(devices) => devices, + Err(err) => { + log::error!("enumerate_adapters: {}", err); + Vec::new() + } + }; + + let mut physical_device = None; + + for device in raw_devices { + let properties2 = vk::PhysicalDeviceProperties2KHR::default(); + + let mut drm_props = vk::PhysicalDeviceDrmPropertiesEXT::default(); + let mut properties2 = properties2.push_next(&mut drm_props); + + unsafe { + self.shared + .raw + .get_physical_device_properties2(device, &mut properties2) + }; + + /* + The makedev call is just bit manipulation to combine major and minor device numbers into a Unix device ID. + It doesn't perform any filesystem operations, only bitshifting. + See: https://github.com/rust-lang/libc/blob/268e1b3810ac07ed637d9005bc1a54e49218c958/src/unix/linux_like/linux/mod.rs#L6049 + We use the resulting device IDs to check if the Vulkan raw device from enumerate_physical_devices + matches the DRM device referred to by our file descriptor. + */ + + let primary_devid = + libc::makedev(drm_props.primary_major as _, drm_props.primary_minor as _); + let render_devid = + libc::makedev(drm_props.render_major as _, drm_props.render_minor as _); + + // Various platforms use different widths between `dev_t` and `c_int`, so just + // force-convert to `u64` to keep things portable. + #[allow(clippy::useless_conversion)] + if [primary_devid, render_devid] + .map(u64::from) + .contains(&drm_stat.st_rdev) + { + physical_device = Some(device) + } + } + + let physical_device = physical_device.ok_or(crate::InstanceError::new( + "Failed to find suitable drm device".to_string(), + ))?; + + let acquire_drm_display_instance = + ext::acquire_drm_display::Instance::new(&self.shared.entry, &self.shared.raw); + + let display = unsafe { + acquire_drm_display_instance + .get_drm_display(physical_device, fd, connector_id) + .expect("Failed to get drm display") + }; + + unsafe { + acquire_drm_display_instance + .acquire_drm_display(physical_device, fd, display) + .expect("Failed to acquire drm display") + } + + let display_instance = khr::display::Instance::new(&self.shared.entry, &self.shared.raw); + + let modes = unsafe { + display_instance + .get_display_mode_properties(physical_device, display) + .expect("Failed to get display modes") + }; + + let mut mode = None; + + for current_mode in modes { + log::trace!( + "Comparing mode {}x{}@{} with {width}x{height}@{refresh_rate}", + current_mode.parameters.visible_region.width, + current_mode.parameters.visible_region.height, + current_mode.parameters.refresh_rate + ); + if current_mode.parameters.refresh_rate == refresh_rate + && current_mode.parameters.visible_region.width == width + && current_mode.parameters.visible_region.height == height + { + mode = Some(current_mode) + } + } + + let mode = mode.ok_or(crate::InstanceError::new( + "Failed to find suitable display mode".to_string(), + ))?; + + let create_info = vk::DisplaySurfaceCreateInfoKHR::default() + .display_mode(mode.display_mode) + .image_extent(mode.parameters.visible_region) + .transform(vk::SurfaceTransformFlagsKHR::IDENTITY) + .alpha_mode(vk::DisplayPlaneAlphaFlagsKHR::OPAQUE) + .plane_index(plane); + + let surface = unsafe { display_instance.create_display_plane_surface(&create_info, None) } + .expect("Failed to create DRM surface"); + + Ok(self.create_surface_from_vk_surface_khr(surface)) + } +} diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs index a67781dba730..073f438c2ea6 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/instance.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -34,10 +34,8 @@ unsafe extern "system" fn debug_utils_messenger_callback( // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5671 // Versions 1.3.240 through 1.3.250 return a spurious error here if // the debug range start and end appear in different command buffers. - const KHRONOS_VALIDATION_LAYER: &CStr = - unsafe { CStr::from_bytes_with_nul_unchecked(b"Khronos Validation Layer\0") }; if let Some(layer_properties) = user_data.validation_layer_properties.as_ref() { - if layer_properties.layer_description.as_ref() == KHRONOS_VALIDATION_LAYER + if layer_properties.layer_description.as_ref() == c"Khronos Validation Layer" && layer_properties.layer_spec_version >= vk::make_api_version(0, 1, 3, 240) && layer_properties.layer_spec_version <= vk::make_api_version(0, 1, 3, 250) { @@ -259,6 +257,13 @@ impl super::Instance { // VK_KHR_surface extensions.push(khr::surface::NAME); + // Extensions needed for drm support + extensions.push(khr::display::NAME); + extensions.push(ext::physical_device_drm::NAME); + extensions.push(khr::get_display_properties2::NAME); + extensions.push(ext::direct_mode_display::NAME); + extensions.push(ext::acquire_drm_display::NAME); + // Platform-specific WSI extensions if cfg!(all( unix, @@ -552,7 +557,10 @@ impl super::Instance { Ok(self.create_surface_from_vk_surface_khr(surface)) } - fn create_surface_from_vk_surface_khr(&self, surface: vk::SurfaceKHR) -> super::Surface { + pub(super) fn create_surface_from_vk_surface_khr( + &self, + surface: vk::SurfaceKHR, + ) -> super::Surface { let functor = khr::surface::Instance::new(&self.shared.entry, &self.shared.raw); super::Surface { raw: surface, @@ -611,7 +619,7 @@ impl crate::Instance for super::Instance { let app_info = vk::ApplicationInfo::default() .application_name(app_name.as_c_str()) .application_version(1) - .engine_name(CStr::from_bytes_with_nul(b"wgpu-hal\0").unwrap()) + .engine_name(c"wgpu-hal") .engine_version(2) .api_version( // Vulkan 1.0 doesn't like anything but 1.0 passed in here... @@ -653,8 +661,7 @@ impl crate::Instance for super::Instance { .find(|inst_layer| inst_layer.layer_name_as_c_str() == Ok(name)) } - let validation_layer_name = - CStr::from_bytes_with_nul(b"VK_LAYER_KHRONOS_validation\0").unwrap(); + let validation_layer_name = c"VK_LAYER_KHRONOS_validation"; let validation_layer_properties = find_layer(&instance_layers, validation_layer_name); // Determine if VK_EXT_validation_features is available, so we can enable @@ -678,11 +685,9 @@ impl crate::Instance for super::Instance { .intersects(wgt::InstanceFlags::GPU_BASED_VALIDATION) && validation_features_are_enabled; - let nv_optimus_layer = CStr::from_bytes_with_nul(b"VK_LAYER_NV_optimus\0").unwrap(); - let has_nv_optimus = find_layer(&instance_layers, nv_optimus_layer).is_some(); + let has_nv_optimus = find_layer(&instance_layers, c"VK_LAYER_NV_optimus").is_some(); - let obs_layer = CStr::from_bytes_with_nul(b"VK_LAYER_OBS_HOOK\0").unwrap(); - let has_obs_layer = find_layer(&instance_layers, obs_layer).is_some(); + let has_obs_layer = find_layer(&instance_layers, c"VK_LAYER_OBS_HOOK").is_some(); let mut layers: Vec<&'static CStr> = Vec::new(); diff --git a/third_party/rust/wgpu-hal/src/vulkan/mod.rs b/third_party/rust/wgpu-hal/src/vulkan/mod.rs index f052d1c25a31..ef349c7b2666 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/mod.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/mod.rs @@ -30,6 +30,7 @@ mod adapter; mod command; mod conv; mod device; +mod drm; mod instance; mod sampler; @@ -464,7 +465,7 @@ pub struct Adapter { //queue_families: Vec, known_memory_flags: vk::MemoryPropertyFlags, phd_capabilities: adapter::PhysicalDeviceProperties, - //phd_features: adapter::PhysicalDeviceFeatures, + phd_features: adapter::PhysicalDeviceFeatures, downlevel_flags: wgt::DownlevelFlags, private_caps: PrivateCapabilities, workarounds: Workarounds, @@ -483,6 +484,7 @@ struct DeviceExtensionFunctions { draw_indirect_count: Option, timeline_semaphore: Option>, ray_tracing: Option, + mesh_shading: Option, } struct RayTracingDeviceExtensionFunctions { @@ -771,6 +773,12 @@ pub struct Queue { signal_semaphores: Mutex<(Vec, Vec)>, } +impl Queue { + pub fn as_raw(&self) -> vk::Queue { + self.raw + } +} + impl Drop for Queue { fn drop(&mut self) { unsafe { self.relay_semaphores.lock().destroy(&self.device.raw) }; diff --git a/third_party/rust/wgpu-types/.cargo-checksum.json b/third_party/rust/wgpu-types/.cargo-checksum.json index 166f98258d96..f11b00b2656e 100644 --- a/third_party/rust/wgpu-types/.cargo-checksum.json +++ b/third_party/rust/wgpu-types/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2dbf2882e87978e2e8b136dc5e6752c4c184308eb8cdefd5d668246b1700a1c1","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"e4d2d40bc1e870a59637f4b9574743e19565a62f6dbcc21cb18a76b666b796eb","src/counters.rs":"ded6ed268bfd7161f06509aae3947650507ba69d72394f68b019b6fa8b324d2d","src/env.rs":"26ffc91867625784159bcf391881187aa92cf92b81b1f40959ce1b96ae6d554d","src/features.rs":"7ea54e481422fcc185feaa316c2e42b30c5d257933f14d604fe19938be61315d","src/instance.rs":"ac6dfd5377e0f43d3261f55b4a6c969d7a7c79e5da5ec11d0d0deb0f461e2269","src/lib.rs":"d0f8a545b3fa7007a1e55cda50fd6ca7a18c1ac6b8042eff5b80b95e35496a38","src/math.rs":"3046121800bded318b7d219aea401907e7d3bba3b998df6745a71e76f0734de2"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"f15aa3cb2e106f34630ff279f9dbb19021e1303266966bbac2e943abe712e73e","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"c7fea58d1cfe49634cd92e54fc10a9d871f4b275321a4cd8c09e449122caaeb4","src/assertions.rs":"e4d2d40bc1e870a59637f4b9574743e19565a62f6dbcc21cb18a76b666b796eb","src/counters.rs":"ded6ed268bfd7161f06509aae3947650507ba69d72394f68b019b6fa8b324d2d","src/env.rs":"26ffc91867625784159bcf391881187aa92cf92b81b1f40959ce1b96ae6d554d","src/features.rs":"ac55c10a32ae85f763a96a87775270a0187fac4e927f112e454044ca92c965f2","src/instance.rs":"ac6dfd5377e0f43d3261f55b4a6c969d7a7c79e5da5ec11d0d0deb0f461e2269","src/lib.rs":"a66ff638390e3864e1d915b110993a72566de8cc495e9b92e169b7068e06a998","src/math.rs":"3046121800bded318b7d219aea401907e7d3bba3b998df6745a71e76f0734de2"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-types/Cargo.toml b/third_party/rust/wgpu-types/Cargo.toml index 8d3044231644..1fd8182f0565 100644 --- a/third_party/rust/wgpu-types/Cargo.toml +++ b/third_party/rust/wgpu-types/Cargo.toml @@ -11,7 +11,7 @@ [package] edition = "2021" -rust-version = "1.76" +rust-version = "1.82.0" name = "wgpu-types" version = "24.0.0" authors = ["gfx-rs developers"] @@ -61,7 +61,7 @@ name = "wgpu_types" path = "src/lib.rs" [dependencies.bitflags] -version = "2.7" +version = "2.9" features = ["serde"] [dependencies.log] diff --git a/third_party/rust/wgpu-types/src/features.rs b/third_party/rust/wgpu-types/src/features.rs index 9724c6dd2a50..1ffe3a016d2d 100644 --- a/third_party/rust/wgpu-types/src/features.rs +++ b/third_party/rust/wgpu-types/src/features.rs @@ -1153,6 +1153,32 @@ bitflags_array! { /// /// This is a native only feature. const UNIFORM_BUFFER_BINDING_ARRAYS = 1 << 46; + + /// Enables mesh shaders and task shaders in mesh shader pipelines. + /// + /// Supported platforms: + /// - Vulkan (with [VK_EXT_mesh_shader](https://registry.khronos.org/vulkan/specs/latest/man/html/VK_EXT_mesh_shader.html)) + /// + /// Potential Platforms: + /// - DX12 + /// - Metal + /// + /// This is a native only feature. + const MESH_SHADER = 1 << 47; + /// ***THIS IS EXPERIMENTAL:*** Features enabled by this may have + /// major bugs in them and are expected to be subject to breaking changes, suggestions + /// for the API exposed by this should be posted on [the ray-tracing issue](https://github.com/gfx-rs/wgpu/issues/6762) + /// + /// Allows for returning of the hit triangle's vertex position when tracing with an + /// acceleration structure marked with [`AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN`]. + /// + /// Supported platforms: + /// - Vulkan + /// + /// This is a native only feature + /// + /// [`AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN`]: super::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN + const EXPERIMENTAL_RAY_HIT_VERTEX_RETURN = 1 << 48; } /// Features that are not guaranteed to be supported. diff --git a/third_party/rust/wgpu-types/src/lib.rs b/third_party/rust/wgpu-types/src/lib.rs index 9587216deea8..e88773348711 100644 --- a/third_party/rust/wgpu-types/src/lib.rs +++ b/third_party/rust/wgpu-types/src/lib.rs @@ -17,7 +17,6 @@ extern crate alloc; use alloc::{string::String, vec, vec::Vec}; use core::{ hash::{Hash, Hasher}, - mem::size_of, num::NonZeroU32, ops::Range, }; @@ -6496,12 +6495,24 @@ pub enum BindingType { /// var as: acceleration_structure; /// ``` /// + /// or with vertex return enabled + /// ```rust,ignore + /// @group(0) @binding(0) + /// var as: acceleration_structure; + /// ``` + /// /// Example GLSL syntax: /// ```cpp,ignore /// layout(binding = 0) /// uniform accelerationStructureEXT as; /// ``` - AccelerationStructure, + AccelerationStructure { + /// Whether this acceleration structure can be used to + /// create a ray query that has flag vertex return in the shader + /// + /// If enabled requires [`Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN`] + vertex_return: bool, + }, } impl BindingType { @@ -7284,6 +7295,8 @@ bitflags::bitflags!( /// Use `BlasTriangleGeometry::transform_buffer` when building a BLAS (only allowed in /// BLAS creation) const USE_TRANSFORM = 1 << 5; + /// Allow retrieval of the vertices of the triangle hit by a ray. + const ALLOW_RAY_HIT_VERTEX_RETURN = 1 << 6; } );