From e2964480ba75cb2101698f481f23e7caae752bf4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 4 Dec 2026 22:23:04 -0800 Subject: [PATCH] Runtime docs: Metrics::translations_at_encode lists the 4:2:2 content among its makes The count's doc named five kinds of make at encode and left out the content a compute or render state makes for the 4:2:2 textures a dispatch or draw reaches, which Metrics::chroma_contents counts and which the same make at encode also counts and times (render_pipeline_state and PipelineInner::variant call Counters::translation_at_encode for it). It now names six. The runtime README's known gap of makes at encode names that make and the depth range twin too, and the new total translation_at_encode_nanos beside the count and the longest. --- crates/metal2vulkan-runtime/README.md | 10 ++++++---- crates/metal2vulkan-runtime/src/counters.rs | 15 ++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 89ebde766..2a6c34b01 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -4799,10 +4799,12 @@ cache is answered compile-required on both. its 8-bit sRGB textures' UNORM twins; a render state's content for a draw's buffers bound so, or for its 8-bit sRGB textures' UNORM twins; and a render state's content for a pass it does not render into as made (a colour attachment the pass lacks, or a fetched colour in a 2D - array). Each is made once and kept, with its content or in the device's map of contents, so a - reuse makes nothing; a content the map forgot is made again. `Metrics::translations_at_encode` - counts these makes, made or refused, and `translation_at_encode_max_nanos` holds the longest - one. Only the first kind has a pre-pass that moves it off the encoding thread. + array); a compute or render state's content for the 4:2:2 textures a dispatch or draw reaches; + and a render content's depth range twin. Each is made once and kept, with its content or in the + device's map of contents, so a reuse makes nothing; a content the map forgot is made again. + `Metrics::translations_at_encode` counts these makes, made or refused, + `translation_at_encode_nanos` sums their time and `translation_at_encode_max_nanos` holds the + longest one. Only the first kind has a pre-pass that moves it off the encoding thread. - On Intel's Windows driver (101.2145) for the UHD 630, the driver's compile of a tiling kernel's `VkPipeline`, the state's main one, took medians of 6,680 to 6,853 µs for the harness's `create_state` kernel, in three processes of 40 compiles each with no driver cache hit. The diff --git a/crates/metal2vulkan-runtime/src/counters.rs b/crates/metal2vulkan-runtime/src/counters.rs index 4e5347310..b0e91680e 100644 --- a/crates/metal2vulkan-runtime/src/counters.rs +++ b/crates/metal2vulkan-runtime/src/counters.rs @@ -3122,7 +3122,7 @@ pub struct Metrics { /// Translations made at encode, on the encoding thread, which the draw or dispatch that needs /// one waits for: each the make of a module or content the state's creation did not make, /// whether the translator lowers it or the cache directory holds its lowering, and whether it - /// is made or refused. Five makes count: an observing kernel's partial-threadgroups variant + /// is made or refused. Six makes count: an observing kernel's partial-threadgroups variant /// on emulated SIMD groups (`KernelVariant::EmulatedPartialThreadgroups`) that a dispatch /// lowers because no /// [`ComputePipelineState::prepare_dispatch`](crate::ComputePipelineState::prepare_dispatch) @@ -3131,12 +3131,13 @@ pub struct Metrics { /// render state's content for a draw's buffers bound at a multiple of 4 below their /// alignment or its 8-bit sRGB textures' UNORM twins; a render state's content for a pass it /// does not render into as made (a colour attachment the pass lacks, or a fetched colour in a - /// 2D array); and a render content's depth range twin, for a draw under a viewport depth range - /// past `[0, 1]` that reads the depth ([`depth_range_twins`](Self::depth_range_twins)). Each is - /// made once and - /// kept in the device's map of contents, or with its content, so a reuse counts nothing; a - /// content the map forgot counts again when it is made again. A consumer whose pre-pass - /// prepares every dispatch reads none of the first kind; the other three have no pre-pass. + /// 2D array); a compute or render state's content for the 4:2:2 textures a dispatch or draw + /// reaches ([`chroma_contents`](Self::chroma_contents)); and a render content's depth range + /// twin, for a draw under a viewport depth range past `[0, 1]` that reads the depth + /// ([`depth_range_twins`](Self::depth_range_twins)). Each is made once and kept in the + /// device's map of contents, or with its content, so a reuse counts nothing; a content the map + /// forgot counts again when it is made again. A consumer whose pre-pass prepares every + /// dispatch reads none of the first kind; the other five have no pre-pass. /// No Metal counterpart: Metal compiles a state whole when it is made. pub translations_at_encode: u64, /// The nanoseconds of [`host_time`](crate::host_time) the