Skip to content
12 changes: 12 additions & 0 deletions .github/upstream-sync-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"upstream_repo": "x86sim/metal2vulkan",
"upstream_branch": "x86sim",
"upstream_sha": "4329b35edb8709dd07af75bcbf14190fc492878b",
"maintained_branch": "drill/sync-clean-20261206",
"maintained_base_sha": "881c20164ac323c0220dea6d630b6b94d64e3a72",
"commits_merged": 6,
"latest_upstream_release": "",
"recent_upstream_releases": [],
"synced_at_utc": "2026-12-06T13:08:58.014953+00:00",
"status": "pending_review"
}
41 changes: 28 additions & 13 deletions crates/metal2vulkan-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,8 @@ made, with no lock, and never rewritten for layouts.
slot that binds it reads Metal's nil texture, and writes only its second element (Set 1). The
image moves from undefined to home in the upload of the next commit, ahead of every command
buffer committed after the call, or ahead of its first copy; until then nothing holds it, so a
texture released first is freed at once, with nothing submitted.
texture released first is freed at once, with nothing submitted. A heap texture placed over
another resource's bytes is the exception (below): its first use moves it.
- A texture's image lists the formats Metal views the texture as that the device holds in a
viewed form of the image format's compatibility class, and is then mutable
(`VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT` with a `VkImageFormatListCreateInfo`, its own format
Expand Down Expand Up @@ -1800,6 +1801,11 @@ made, with no lock, and never rewritten for layouts.
alias one another and the heap's buffers. A heap texture whose bytes another resource of its
heap wrote since its last write moves from undefined before its next write, a GPU command's or
`Texture::replace_region`'s copy (`Metrics::heap_moves`), as Vulkan's memory aliasing asks. A
heap texture placed over another resource's bytes moves from undefined at its first use, and no
upload moves it, as the move may write its memory, which the other's earlier reads still need:
a GPU command that reads or writes it, after every earlier command of its command buffer that
read those bytes; a `use_heap` of its heap, where that use is; or a `replace_region` or
`get_bytes` copy (`Metrics::heap_moves`). A
placement past the heap's end, an offset in the block off the image's alignment, or a heap
range past its block is refused
(`Refusal::HeapTexturePlace`); the image is never bound outside its heap. The texture holds
Expand Down Expand Up @@ -2187,16 +2193,23 @@ made, with no lock, and never rewritten for layouts.
- A heap texture whose bytes another resource of its heap wrote moves out of
`VK_IMAGE_LAYOUT_UNDEFINED` before its next use that writes it (`Metrics::heap_moves`), as
Vulkan's memory aliasing asks: "each of those image subresources must have its layout
transitioned from `VK_IMAGE_LAYOUT_UNDEFINED` to a valid layout before it is used". What remains:
a read of such a texture before its next write takes no move; a write rt cannot name, through a
resource ID or an address outside the encoder's slots and `use_resource` declarations, leaves no
texture stale; a declared write (`use_resource` with a usage that writes) counts as a write of
the whole resource; a texture placed over another's bytes moves home from undefined at its
making, which on a device whose move writes memory may change a live alias's bytes; a move is
of the whole image, so where an alias's write met only part of it, the move takes the rest too;
and a draw's write of a texture that nothing earlier in its command buffer wrote, nor an alias
of it, is checked where the pass's part of the command buffer starts, so its move may go ahead
of a read of an alias there.
transitioned from `VK_IMAGE_LAYOUT_UNDEFINED` to a valid layout before it is used"; a texture
placed over another's bytes moves out of it at its first use, read or write. What remains: a
read of such a texture before its next write takes no move, but for its first use; a write rt
cannot name, through a resource ID or an address outside the encoder's slots and `use_resource`
declarations, leaves no texture stale, and a first use rt cannot name (no slot, `use_resource`
or `use_heap` reaches the texture) does not move a texture placed over another's bytes; a
declared write (`use_resource` with a usage that writes) counts as a write of the whole
resource; a move is of the whole image, so where an alias's write met only part of it, the move
takes the rest too; and a draw's first use of a
texture placed over another's bytes, or its write of a texture that nothing earlier in its
command buffer wrote, nor an alias of it, is checked where the pass's part of the command buffer
starts, so its move may go ahead of a read of an alias there. A move from undefined may write
the texture's memory, as AMDVLK's does on a Radeon 780M (RADV's and ANV's left an alias's texels
as written), so an older texture's bytes may change where a newer texture placed over them is
read before it is ever written, and where the older one is read through a heap declaration
(`use_heap`, which moves the heap's unmoved textures where it is) after the newer one was made
and before that one is written.
- A heap buffer's use that may write it (a bound slot its kernel or draw does not read only, or a
declared write) makes every heap texture over its bytes stale, though the use wrote other bytes
or none: that texture's next write moves its whole image from undefined, so on a device whose
Expand Down Expand Up @@ -2987,7 +3000,9 @@ while the driver's exit handler waited on a lock, with every runtime thread alre
- `use_heap` is `useHeap:`, for the block a heap's memory is: the command buffer keeps the block
until it retires, as it keeps a used buffer's block, so a heap given back while the work runs
stays valid under it. It declares no access (Metal states no retention for it; keeping is the
safe reading).
safe reading). It is a first use of each texture of the heap placed over another resource's
bytes and not yet moved from undefined (Textures), which a kernel may reach next through an
address: those move there.
- A dispatch of a kernel that writes no memory (the translator's `PipelineInterface::writes_memory`:
no store to a buffer or through a device address, no texture write and no atomic update, in the
kernel or any function it calls) records nothing, binds nothing and reads no indirect buffer,
Expand Down Expand Up @@ -5246,7 +5261,7 @@ cache is answered compile-required on both.
state that enables the scale, which is refused) and `drawIndexedPatches:` (whose control-point
index buffer only a state of a control-point index type reads, which is refused).
`useHeap:stages:` is `use_heap`, in the compute encoder's form: the command buffer keeps the
block and declares no access.
block, declares no access, and moves each texture of the heap not yet moved from undefined.
- Refused by `Gap::RenderPass`, naming its `RenderPassKind`: a depth and a stencil attachment
that are not one texture's same level and slice (`DepthStencilViews`: Vulkan's rendering takes
one view for both), a `Clear` load of a depth attachment whose clear depth is outside `[0, 1]`
Expand Down
Loading