METAL2VULKAN_LOG_PASSES: a default-off log of the render passes that name a watched texture

A diagnostic to find which pass draws the white at a widget's glass edges in the 27.0.1 guest:
the runtime sees every pass's attachments, which the consumer's own logs cannot name.

The switch's value is the textures to watch, a comma-separated list of FORMAT:WIDTHxHEIGHT
(the format as the notices print it or as Metal names it, `*` for any format or size). At the end
of each render encoder that renders into a watched texture, binds one to its fragment stage or
makes one resident, the device logs one line (id name metal2vulkan-passes, Info): the render area,
its Vulkan render pass instances and draw calls, each attachment (format, size, object ID, label,
whether it took its storage form, level, slice, load and store actions as the pass ends, its
stand-in and cause), the depth/stencil aspects' actions, the pipeline states its draws drew with,
the textures bound to the fragment stage at a draw, the watched resident textures with their
stages, and what it watched. A line the same as one printed before is not printed again; a process
prints at most 256. Off (unset, empty or 0, or a value it cannot read, said once on stderr), an
encoder notes nothing; no behaviour reads it.

- crates/metal2vulkan/src/env_vars.rs: the registry row and `log_passes()`, the raw value.
- crates/metal2vulkan-runtime/src/pass_log.rs: the filter, the notes, the line and its bound.
- render.rs: an encoder's notes, made where the log is on, noted at each draw call, logged at
  the pass's end once its store actions are settled.
- texture.rs: `Texture::took_storage_form`, which the line names.
- docs/API.md and the artifact test's list of the runtime's variables name it.

Verified: cargo fmt; the build, clippy and the tests run on potluck after this commit
(tests::pass_log: the filter's parse and refusals, an entry's match, the once-and-bound rule).
This commit is contained in:
Anees Iqbal committed 2026-11-11 01:49:25 -08:00
1 parent fc261c9f31
commit 5a21f6d3f3
9 files changed
+504 -1

No files matched your search

+12
View File
@@ -1641,6 +1641,18 @@ texture's image of its stored frame and its twin, a two-plane extended-range tex
depth or stencil texture's tiled twin over a surface plane, and a YCbCr texture's converted image
and render shadow. A heap texture's shadow, a view's shadow of an image and a texture buffer's
staging are not logged.
With `METAL2VULKAN_LOG_PASSES` set to a comma-separated list of `FORMAT:WIDTHxHEIGHT` (the format
as the notices print it or as Metal names it, `*` for any format or any size, for example
`RGBA16Float:128x128`), a device logs a line at the end of each render pass that renders into a
texture of the list, binds one to its fragment stage or makes one resident (id name
`metal2vulkan-passes`, `Info` severity): its render area, Vulkan render pass instances and draw
calls; each attachment's format, size, object ID, label, level, slice, load and store actions,
whether its texture took its storage form, and the stand-in it renders through with its cause;
the pipeline states its draws drew with (label and functions); the textures bound to the fragment
stage at a draw; the watched textures among those it made resident, with their stages; and what
it watched. A line the same as one printed before is not printed again, and a process prints at
most 256. Empty or `0` is off; a value the runtime cannot read turns the log off and says why on
stderr.
With `METAL2VULKAN_PENDING_AUDIT` set (or `DeviceOptions::pending_audit`), a device checks, at each
`vkBeginCommandBuffer`, each `vkResetCommandPool` of a spare command pool, each command pool given
back to its spares and each submission of a command buffer submitted before (one not begun for