From 275be5c367ea30e8a2b2a78fab6185e2df1f2802 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 21 Nov 2026 06:21:11 -0800 Subject: [PATCH] rt: occlusionQueryPrecise stays out of the translator's profile; the floor test's 61 cases; the ledger's visibility rows What: the floor requires occlusionQueryPrecise without naming it to the translator (no shader reads it), so shader_enables, and with it the translator profile rt's Device::new derives and every key it makes, stay as they were; the_translator_sees_only_what_device_creation_enables asserts it. The floor test's missing-feature cases are 61 with occlusionQueryPrecise's. known-gaps-rt.tsv drops the 19 rows of the old VisibilityResults gap (the visibility cases that now draw and the host-page-writes-visibility-writable sites) and lists the cut's refusals: the offset taken twice (Metal's own refusal) in the four revisit cases, and Accumulate in its five sites. Why: check m3-max-63457 on b5ac9fd07b read clippy's E0308 at the floor test's case array, and the lavapipe replay m3-max-63459 listed the ledger's drift (28 lines, all visibility rows). Verified: cargo fmt; the compile and lavapipe jobs on this commit are named in the lane's report. --- .../known-gaps-rt.tsv | 30 +++++++------------ crates/metal2vulkan-runtime/src/floor.rs | 4 +-- .../metal2vulkan-runtime/src/tests/floor.rs | 6 +++- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/crates/metal2vulkan-conformance/known-gaps-rt.tsv b/crates/metal2vulkan-conformance/known-gaps-rt.tsv index 11aaa075d..c7c587e5d 100644 --- a/crates/metal2vulkan-conformance/known-gaps-rt.tsv +++ b/crates/metal2vulkan-conformance/known-gaps-rt.tsv @@ -2847,13 +2847,9 @@ pipeline-facts-render-multisampled-direct * refused case/facts/required_threads_ pipeline-facts-render-multisampled-direct * refused case/facts/threadgroup_size_matches_tile_size Err(Unavailable({call: "threadgroupSizeMatchesTileSize"})) refused: no stream uses it yet (libs census 11-19, m3-max-51379..51431: 0 tile pipelines). A tile getter of a drawing state: rt makes no tile render state, so it has no tile getters (its README, the render state's getters; tile functions are not built), and the field is refused while the state's other getters compare. # # Refusals the same on every venue run (lavapipe, the RX 7900 XTX, RTX 2080 and 3090, both 780Ms, -# the Iris Xe and the RX 550): a draw of points, a visibility result mode, a pass with no +# the Iris Xe and the RX 550): a draw of points, a pass with no # attachment, and the FloatRGB9E5 vertex format. Each row cites the README sentence that records # its gap. -host-page-writes-visibility-writable * refused case/bytes-in-a-later-command-buffer-bytes Err(Error::Unsupported("a draw with VisibilityResults is not built")) Gap::Draw (VisibilityResults): the rt README, Known gaps of render encoders, "a visibility result mode but `Disabled` (`VisibilityResults`, `set_visibility_result_mode`), each refused where it is set". -host-page-writes-visibility-writable * refused case/bytes-in-the-same-command-buffer-bytes Err(Error::Unsupported("a draw with VisibilityResults is not built")) Gap::Draw (VisibilityResults): the rt README, Known gaps of render encoders, "a visibility result mode but `Disabled` (`VisibilityResults`, `set_visibility_result_mode`), each refused where it is set". -host-page-writes-visibility-writable * refused case/bytes-the-cpu-reads-bytes Err(Error::Unsupported("a draw with VisibilityResults is not built")) Gap::Draw (VisibilityResults): the rt README, Known gaps of render encoders, "a visibility result mode but `Disabled` (`VisibilityResults`, `set_visibility_result_mode`), each refused where it is set". -host-page-writes-visibility-writable * refused case/write-program/renderCommandEncoder Err(Error::Unsupported("a draw with VisibilityResults is not built")) Gap::Draw (VisibilityResults): the rt README, Known gaps of render encoders, "a visibility result mode but `Disabled` (`VisibilityResults`, `set_visibility_result_mode`), each refused where it is set". point-viewport-coverage llvmpipe divergent case/v0/x/3f000000/coverage we recorded DrewNothing, Metal observed {"5,3"} An accepted difference (docs/API.md section 10, Draws and index buffers): Metal states no clipping rule for a point (`MTLPrimitiveType.point`; the MSL specification's `[[point_size]]`), so a point near the viewport's edge or the clip volume is clipped or culled by the device's own rule, its `pointClippingBehavior` and the driver's handling of the viewport. Metal on the Apple M3 Max keeps a point whose centre lies within 1.5 w of the viewport's centre and covers its square whole, past the viewport's edge; lavapipe, in this case's rows, covers no pixel whose centre lies on or past the viewport's edge, and culls no point at the clip volume. point-viewport-coverage llvmpipe divergent case/v0/x/3f666666/coverage we recorded DrewNothing, Metal observed {"5,3"} An accepted difference (docs/API.md section 10, Draws and index buffers): Metal states no clipping rule for a point (`MTLPrimitiveType.point`; the MSL specification's `[[point_size]]`), so a point near the viewport's edge or the clip volume is clipped or culled by the device's own rule, its `pointClippingBehavior` and the driver's handling of the viewport. Metal on the Apple M3 Max keeps a point whose centre lies within 1.5 w of the viewport's centre and covers its square whole, past the viewport's edge; lavapipe, in this case's rows, covers no pixel whose centre lies on or past the viewport's edge, and culls no point at the clip volume. point-viewport-coverage llvmpipe divergent case/v0/x/3f7d70a4/coverage we recorded DrewNothing, Metal observed {"5,3"} An accepted difference (docs/API.md section 10, Draws and index buffers): Metal states no clipping rule for a point (`MTLPrimitiveType.point`; the MSL specification's `[[point_size]]`), so a point near the viewport's edge or the clip volume is clipped or culled by the device's own rule, its `pointClippingBehavior` and the driver's handling of the viewport. Metal on the Apple M3 Max keeps a point whose centre lies within 1.5 w of the viewport's centre and covers its square whole, past the viewport's edge; lavapipe, in this case's rows, covers no pixel whose centre lies on or past the viewport's edge, and culls no point at the clip volume. @@ -6474,21 +6470,15 @@ two-plane-announced-row-blits * refused case/work/0 Err({refused: Error::Unsuppo two-plane-heap-blits * refused case/work/a48 Err({refused: Error::Unsupported("a heap texture of RGB10A82PXR10 is not placed in this heap on this device"), resource: 1 (0x1)}) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no texture or view of MTLPixelFormatRGB10A8_2P_XR10). rt makes no texture of MTLPixelFormatRGB10A8_2P_XR10 for the usage the case asks on any venue (Gap::TextureFormat, or the creator's NotMade). two-plane-pad-fills * refused case/work/0 Err({refused: Error::Unsupported("no texture of RGB10A82PXR10 is made on this device for the usage"), resource: 0 (0x0)}) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no texture or view of MTLPixelFormatRGB10A8_2P_XR10). rt makes no texture of MTLPixelFormatRGB10A8_2P_XR10 for the usage the case asks on any venue (Gap::TextureFormat, or the creator's NotMade). two-plane-row-blits * refused case/work/0 Err({refused: Error::Unsupported("no texture of RGB10A82PXR10 is made on this device for the usage"), resource: 0 (0x0)}) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no texture or view of MTLPixelFormatRGB10A8_2P_XR10). rt makes no texture of MTLPixelFormatRGB10A8_2P_XR10 for the usage the case asks on any venue (Gap::TextureFormat, or the creator's NotMade). -visibility-boolean-accumulate * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-boolean-indirect-no-instances * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-boolean-occluded * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-boolean-offsets * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-boolean-revisit-after-covering * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-boolean-revisit-after-nothing * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-accumulate * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-accumulate-one-command-buffer * refused case/pass-1/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-accumulate-one-command-buffer * refused case/pass-1/calls/1-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-accumulate-revisit * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-four-samples * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-occluded * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-offsets * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-revisit * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. -visibility-counting-revisit-after-disabled * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with VisibilityResults is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no setVisibilityResultMode:offset:). rt refuses it (a draw with VisibilityResults is not built), and no replay stream asks it. +visibility-boolean-accumulate * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with AccumulatedVisibilityResults is not built")) Gap::Draw (AccumulatedVisibilityResults): the rt README, Known gaps of render encoders, "a `Boolean` or `Counting` visibility result mode in a pass whose `visibility_result_type` is `Accumulate`", refused where it is set and counted in Metrics::accumulated_visibility_refused. Metal on the M3 Max adds each result into its word; Metal on the 5300M and the UHD 630 answers Accumulate as Reset (values.rs, VisibilityResultType). Adding a result to a word is not built. +visibility-boolean-revisit-after-covering * refused case/pass-0/calls/0-render Err(Error::Refused("the visibility result offset 0 is taken a second time in one encoder")) Metal's own refusal (Refusal::VisibilityResultOffsetTaken): Apple's page for setVisibilityResultMode(_:offset:) says "You can set a specific offset value only once per render pass", and Metal's validation stops the second set. Plain Metal on the M3 Max adds the later draws to the word; rt refuses the second mode set at the offset, the encoder's mode unchanged (the rt README, Known gaps of render encoders, visibility results). Adding a second query's count into a word is not built. +visibility-boolean-revisit-after-nothing * refused case/pass-0/calls/0-render Err(Error::Refused("the visibility result offset 0 is taken a second time in one encoder")) Metal's own refusal (Refusal::VisibilityResultOffsetTaken): Apple's page for setVisibilityResultMode(_:offset:) says "You can set a specific offset value only once per render pass", and Metal's validation stops the second set. Plain Metal on the M3 Max adds the later draws to the word; rt refuses the second mode set at the offset, the encoder's mode unchanged (the rt README, Known gaps of render encoders, visibility results). Adding a second query's count into a word is not built. +visibility-counting-accumulate * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with AccumulatedVisibilityResults is not built")) Gap::Draw (AccumulatedVisibilityResults): the rt README, Known gaps of render encoders, "a `Boolean` or `Counting` visibility result mode in a pass whose `visibility_result_type` is `Accumulate`", refused where it is set and counted in Metrics::accumulated_visibility_refused. Metal on the M3 Max adds each result into its word; Metal on the 5300M and the UHD 630 answers Accumulate as Reset (values.rs, VisibilityResultType). Adding a result to a word is not built. +visibility-counting-accumulate-one-command-buffer * refused case/pass-1/calls/0-render Err(Error::Unsupported("a draw with AccumulatedVisibilityResults is not built")) Gap::Draw (AccumulatedVisibilityResults): the rt README, Known gaps of render encoders, "a `Boolean` or `Counting` visibility result mode in a pass whose `visibility_result_type` is `Accumulate`", refused where it is set and counted in Metrics::accumulated_visibility_refused. Metal on the M3 Max adds each result into its word; Metal on the 5300M and the UHD 630 answers Accumulate as Reset (values.rs, VisibilityResultType). Adding a result to a word is not built. +visibility-counting-accumulate-one-command-buffer * refused case/pass-1/calls/1-render Err(Error::Unsupported("a draw with AccumulatedVisibilityResults is not built")) Gap::Draw (AccumulatedVisibilityResults): the rt README, Known gaps of render encoders, "a `Boolean` or `Counting` visibility result mode in a pass whose `visibility_result_type` is `Accumulate`", refused where it is set and counted in Metrics::accumulated_visibility_refused. Metal on the M3 Max adds each result into its word; Metal on the 5300M and the UHD 630 answers Accumulate as Reset (values.rs, VisibilityResultType). Adding a result to a word is not built. +visibility-counting-accumulate-revisit * refused case/pass-0/calls/0-render Err(Error::Unsupported("a draw with AccumulatedVisibilityResults is not built")) Gap::Draw (AccumulatedVisibilityResults): the rt README, Known gaps of render encoders, "a `Boolean` or `Counting` visibility result mode in a pass whose `visibility_result_type` is `Accumulate`", refused where it is set and counted in Metrics::accumulated_visibility_refused. Metal on the M3 Max adds each result into its word; Metal on the 5300M and the UHD 630 answers Accumulate as Reset (values.rs, VisibilityResultType). Adding a result to a word is not built. +visibility-counting-revisit * refused case/pass-0/calls/0-render Err(Error::Refused("the visibility result offset 0 is taken a second time in one encoder")) Metal's own refusal (Refusal::VisibilityResultOffsetTaken): Apple's page for setVisibilityResultMode(_:offset:) says "You can set a specific offset value only once per render pass", and Metal's validation stops the second set. Plain Metal on the M3 Max adds the later draws to the word; rt refuses the second mode set at the offset, the encoder's mode unchanged (the rt README, Known gaps of render encoders, visibility results). Adding a second query's count into a word is not built. +visibility-counting-revisit-after-disabled * refused case/pass-0/calls/0-render Err(Error::Refused("the visibility result offset 0 is taken a second time in one encoder")) Metal's own refusal (Refusal::VisibilityResultOffsetTaken): Apple's page for setVisibilityResultMode(_:offset:) says "You can set a specific offset value only once per render pass", and Metal's validation stops the second set. Plain Metal on the M3 Max adds the later draws to the word; rt refuses the second mode set at the offset, the encoder's mode unchanged (the rt README, Known gaps of render encoders, visibility results). Adding a second query's count into a word is not built. visible-tables-compute-a-private-function-has-no-handle * refused case/outcome Err(Error::Unsupported("the kernel reads an input the compute encoder does not supply yet: Slot")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no visible function table). rt refuses it (the kernel reads an input the compute encoder does not supply yet), and no replay stream asks it. visible-tables-compute-an-unlinked-function-has-no-handle * refused case/outcome Err(Error::Unsupported("the kernel reads an input the compute encoder does not supply yet: Slot")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no visible function table). rt refuses it (the kernel reads an input the compute encoder does not supply yet), and no replay stream asks it. visible-tables-compute-count-3-two-entries-written * refused case/outcome Err(Error::Unsupported("the kernel reads an input the compute encoder does not supply yet: Slot")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no visible function table). rt refuses it (the kernel reads an input the compute encoder does not supply yet), and no replay stream asks it. diff --git a/crates/metal2vulkan-runtime/src/floor.rs b/crates/metal2vulkan-runtime/src/floor.rs index ebb7254af..b280633c5 100644 --- a/crates/metal2vulkan-runtime/src/floor.rs +++ b/crates/metal2vulkan-runtime/src/floor.rs @@ -532,8 +532,8 @@ pub(crate) const REQUIRED: &[Feature] = &[ feature!(core.vertex_pipeline_stores_and_atomics => VertexPipelineStoresAndAtomics), // A `Counting` visibility result is the count of samples that passed: a precise occlusion // query's, which `Boolean` takes too. Roadmap 2022 requires it of every device, and every - // venue's driver reports it. - feature!(core.occlusion_query_precise => OcclusionQueryPrecise), + // venue's driver reports it. No shader uses it, so the translator is not told of it. + feature!(core.occlusion_query_precise), // What Vulkan 1.1 to 1.3 require of every device and the translator's shaders use where they // are enabled: multiview, subgroup operations on 8-, 16- and 64-bit values, a fragment's // demotion to a helper and its termination, and workgroup memory zeroed at its declaration. diff --git a/crates/metal2vulkan-runtime/src/tests/floor.rs b/crates/metal2vulkan-runtime/src/tests/floor.rs index 599928361..2076275fe 100644 --- a/crates/metal2vulkan-runtime/src/tests/floor.rs +++ b/crates/metal2vulkan-runtime/src/tests/floor.rs @@ -369,6 +369,10 @@ fn the_translator_sees_only_what_device_creation_enables() { .features .contains(&VkFeature::ShaderZeroInitializeWorkgroupMemory)); assert!(enables.features.contains(&VkFeature::NullDescriptor)); + // Enabled for the visibility results' occlusion queries, which no shader reads: the + // translator's profile, and so every key it makes, stays as it was without it. + assert_eq!(capabilities.features.core.occlusion_query_precise, vk::TRUE); + assert!(!enables.features.contains(&VkFeature::OcclusionQueryPrecise)); for reported in [ VkFeature::GeometryShader, VkFeature::RobustBufferAccess2, @@ -454,7 +458,7 @@ fn each_missing_feature_is_named() { const CORE: &str = "VkPhysicalDeviceFeatures"; const ROBUSTNESS2: &str = "VkPhysicalDeviceRobustness2FeaturesEXT"; type Clear = fn(&mut Features); - let cases: [(Clear, Missing); 60] = [ + let cases: [(Clear, Missing); 61] = [ ( |f| f.vulkan12.buffer_device_address = vk::FALSE, feature(V12, "bufferDeviceAddress"),