Pipeline creation log: a state's first line names its descriptor; METAL2VULKAN_DUMP_PIPELINES writes each pipeline's SPIR-V

A live pipeline the log names could not be made again from its library: the line names the
state's functions and its key, not the constant values the functions were made with, nor the
blend and write masks, nor which library's bitcode. A state's first line now names the descriptor
(`StateDescriptor::logged`): each function's name, the SHA-256 of its bitcode
(`FunctionInfo::air_hash`; a precompiled function's key) and its constant values by index and by
name as type and bytes, each color attachment's format, blend and write mask (the notices' words,
`blend_text`, which `draw_at` now shares), the depth and stencil formats and the raster samples.

METAL2VULKAN_DUMP_PIPELINES names a directory (made where missing) each device writes every render
pipeline's SPIR-V modules into, one file per module, `<hash>.spv`, the hash the line names it by,
each written once; a failed write is named in the line. Setting it turns the log on too. Both are
default-off diagnostics: no pipeline, key or path changes with them.

Test: tests::pipeline_dump (device test) runs a child process that makes one state with a
constant and a blended color: with the dump directory set and the log variable unset, the first
line names each function's bitcode hash, the constant's type and bytes, the color's format, blend
and mask, and every module a line names is in the directory as SPIR-V of the words the line
counts; with the dump variable empty and the log unset, no line and no file.
This commit is contained in:
Anees Iqbal committed 2026-11-11 06:14:20 -08:00
1 parent 22749e28d6
commit 27b9cedd7a
8 files changed
+386 -29

No files matched your search

+6 -1
View File
@@ -1638,7 +1638,12 @@ How a notice reaches you:
With `METAL2VULKAN_LOG_PIPELINES` set, a device also logs one line per render `VkPipeline` it
makes (id name `metal2vulkan-pipeline-creation`, `Info` severity), with where its time went: the
wait for its turn, the digests that name its parts, each library (made by this making, from its
driver cache record or not, or another caller's) and the link; and, once per reason, why a draw
driver cache record or not, or another caller's) and the link; a state's first line also names
the descriptor it was made from (each function's name, the SHA-256 of its bitcode and the constant
values it was made with, each color attachment's format, blend and write mask, the depth and
stencil formats and the raster samples). With `METAL2VULKAN_DUMP_PIPELINES` naming a directory, a
device writes each such pipeline's SPIR-V modules there, one file per module named by the hash
the line prints it by (`<hash>.spv`), and the log is on too. And, once per reason, why a draw
that reads its own pass's color attachment after a barrier took the split rather than a snapshot
(id name `metal2vulkan-snapshot-fallback`, `Info` severity; `WorkCounts::reading_draws_snapshotted`
counts those that took a snapshot), and now and then a count of the draws the snapshot's area rule