From d12ea9bbe761140d67e48ecc4c3d981ed9fbe299 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 26 Oct 2026 02:58:38 +0200 Subject: [PATCH] Name the merge's planned dispatches and examined words in the API guide Content: the tree of `development` at 27935d575e, unchanged. --- crates/metal2vulkan/tests/api_signatures.tsv | 8 +++++--- docs/API.md | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/metal2vulkan/tests/api_signatures.tsv b/crates/metal2vulkan/tests/api_signatures.tsv index 2a337eb27..83ed96a16 100644 --- a/crates/metal2vulkan/tests/api_signatures.tsv +++ b/crates/metal2vulkan/tests/api_signatures.tsv @@ -325,7 +325,7 @@ assoc-const metal2vulkan::bind::ShadowMergeImageModule::KEPT_BINDING pub const K assoc-const metal2vulkan::bind::ShadowMergeImageModule::LOCAL_SIZE pub const LOCAL_SIZE: u32 assoc-const metal2vulkan::bind::ShadowMergeImageModule::PUSH_BYTES pub const PUSH_BYTES: u32 assoc-const metal2vulkan::bind::ShadowMergeImageModule::SET pub const SET: u32 -assoc-const metal2vulkan::bind::ShadowMergeImageModule::TEXELS pub const TEXELS: u32 +assoc-const metal2vulkan::bind::ShadowMergeImageModule::WORDS pub const WORDS: u32 assoc-const metal2vulkan::bind::ShadowMergeModule::CHANGED_BINDING pub const CHANGED_BINDING: u32 assoc-const metal2vulkan::bind::ShadowMergeModule::CURRENT_BINDING pub const CURRENT_BINDING: u32 assoc-const metal2vulkan::bind::ShadowMergeModule::KEPT_BINDING pub const KEPT_BINDING: u32 @@ -823,7 +823,7 @@ assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::KEPT_BINDING 1 assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::LOCAL_SIZE 64 assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::PUSH_BYTES 16 assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::SET 0 -assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::TEXELS 4 +assoc-const-value metal2vulkan::bind::ShadowMergeImageModule::WORDS 4 assoc-const-value metal2vulkan::bind::ShadowMergeModule::CHANGED_BINDING 1 assoc-const-value metal2vulkan::bind::ShadowMergeModule::CURRENT_BINDING 2 assoc-const-value metal2vulkan::bind::ShadowMergeModule::KEPT_BINDING 0 @@ -2796,11 +2796,13 @@ field metal2vulkan-runtime::WorkCounts.shadow_copies_back_dispatched pub shadow_ field metal2vulkan-runtime::WorkCounts.shadow_copies_in_dispatched pub shadow_copies_in_dispatched: u64 field metal2vulkan-runtime::WorkCounts.shadow_keeps pub shadow_keeps: super::churn_counts::ShadowKeeps field metal2vulkan-runtime::WorkCounts.shadow_merge_copies_dispatched pub shadow_merge_copies_dispatched: u64 +field metal2vulkan-runtime::WorkCounts.shadow_merge_dispatches_planned pub shadow_merge_dispatches_planned: u64 field metal2vulkan-runtime::WorkCounts.shadow_merge_kept_images_followed pub shadow_merge_kept_images_followed: u64 field metal2vulkan-runtime::WorkCounts.shadow_merge_kept_images_live pub shadow_merge_kept_images_live: u64 field metal2vulkan-runtime::WorkCounts.shadow_merge_kept_images_made pub shadow_merge_kept_images_made: u64 field metal2vulkan-runtime::WorkCounts.shadow_merge_scratches_reused pub shadow_merge_scratches_reused: u64 field metal2vulkan-runtime::WorkCounts.shadow_merge_scratches_zeroed pub shadow_merge_scratches_zeroed: u64 +field metal2vulkan-runtime::WorkCounts.shadow_merge_words_examined pub shadow_merge_words_examined: u64 field metal2vulkan-runtime::WorkCounts.shadow_merges_fetched pub shadow_merges_fetched: u64 field metal2vulkan-runtime::WorkCounts.shadow_merges_kept_in_images pub shadow_merges_kept_in_images: u64 field metal2vulkan-runtime::WorkCounts.shadow_texels_bounded_copied_in pub shadow_texels_bounded_copied_in: u64 @@ -8580,7 +8582,7 @@ method metal2vulkan::bind::ShadowCopyBackModule::groups pub fn groups([width, he method metal2vulkan::bind::ShadowCopyBackModule::shape pub fn shape([x0, y0]: [u32; 2], width: u32, row_words: u32, first_word: u32) -> [u8; 16] method metal2vulkan::bind::ShadowCopyInModule::groups pub fn groups([width, height]: [u32; 2]) -> [u32; 2] method metal2vulkan::bind::ShadowCopyInModule::shape pub fn shape([x0, y0]: [u32; 2], width: u32, row_words: u32, first_word: u32) -> [u8; 16] -method metal2vulkan::bind::ShadowMergeImageModule::groups pub fn groups([width, height]: [u32; 2]) -> [u32; 2] +method metal2vulkan::bind::ShadowMergeImageModule::groups pub fn groups(read: ShadowMergeRead, [width, height]: [u32; 2]) -> [u32; 2] method metal2vulkan::bind::ShadowMergeImageModule::shape pub fn shape([x0, y0]: [u32; 2], width: u32, row_words: u32, first_word: u32) -> [u8; 16] method metal2vulkan::bind::ShadowMergeModule::groups pub fn groups(count: u32) -> u32 method metal2vulkan::bind::ShadowMergeModule::shape pub fn shape(width: u32, count: u32, row_words: u32, first_word: u32) -> [u8; 16] diff --git a/docs/API.md b/docs/API.md index 5dc0022ac..215ef1fd0 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1197,7 +1197,12 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound. shadow's texels are kept in a scratch buffer of one to three times the texture's bytes (or an image of the texture's size) before the command, and after it a dispatch merges the bytes it changed through the texture into the buffer's, in place where the texture's bytes start and end in whole words of the buffer: one to - three copies and a dispatch in place of one copy back. + three copies and a dispatch in place of one copy back. The merge's dispatches are counted as the + runtime plans them, in windows of at most the device's storage-buffer range and workgroup count + (`WorkCounts::shadow_merge_dispatches_planned`), together with the words they examine + (`shadow_merge_words_examined`): a dispatch reads each word of the region before the commands and + after them and stores only where the two differ, so the words it stores are at most the words it + examined and only the GPU knows them. - `metal2vulkan-degrade-copied-draw-bytes` (performance). `CopiedDrawBytes`: A draw's index buffer or indirect arguments start where Vulkan reads neither. Cost: they are copied into a buffer of the command buffer before the pass, and the draw reads the copy.