Files
metal2vulkan/docs
Anees Iqbal 5a1e043784 A driver cache record names its pass without the attachments' formats
A render making's record of the driver's data, and the libraries of its
pre-rasterization and fragment shader parts, were named by the pass
shape whole, formats included. A program that makes one state against
passes that differ only in a colour attachment's format (RGBA8Unorm,
RGBA16Float, BGRA8Unorm) so got one VkPipelineCache per format, and the
driver compiled the same fragment module once in each: on the Iris Xe
(ANV, Mesa 26.2.6) 3.3 to 3.7 s per compile for one large module, three
times over at a cold start.

No stage's conversion reads an attachment's format through the pass: a
format the translation reads is in the stage's own words and constants,
which name the part's record too. So a part's record now names the pass
by PassShape::without_formats (which attachments it has, its samples,
fetch inputs, unread inputs, storage attachments, view mask and
locations), and the depth bias is left out of it as before. The library
names the runtime keys its own library objects by keep the formats (the
libraries are made against VkRenderPasses, which must be compatible);
only the driver cache record is shared. A driver that does key a stage
by format keys that entry apart in the one cache: a compile, never a
wrong pipeline.

The record-naming version (shader_cache/driver.rs VERSION) goes to 3.
METAL2VULKAN_LOG_PIPELINES now says, per library, whether its record
was loaded, missed or its cache shared with an earlier making, and
whether the driver found it in that cache or compiled it (from
VK_EXT_pipeline_creation_feedback).

Measured before the change (a harness making the module's fragment
library against three passes on the Iris Xe, MESA_SHADER_CACHE_DISABLE):
a cache per format, 3.5 s, 3.7 s, 3.3 s; one shared cache, 3.5 s then
0.0 ms and 0.0 ms, the second and third APPLICATION_PIPELINE_CACHE_HIT.

Tests: record_pass_formats (a pass's record name drops formats, keeps
presence, samples, fetch inputs and view mask);
driver_pipeline_compile::creations_over_colour_formats_take_the_first_s_records
(two makings over BGRA8Unorm and RGBA16Float share the first's record,
caches_shared grows by the makings, one fragment library compiled,
while a constant that changes the module keeps its own record);
creation_log's text test.
2026-11-11 17:03:23 -08:00
..