Files
metal2vulkan/crates/metal2vulkan-runtime/src/recorder
Anees Iqbal 7bb1358224 Runtime: record a rate-mapped pass's regions several at a time through VK_EXT_multi_draw
Where the device enables multiDraw, multiViewport, shaderOutputViewportIndex and
shaderDrawParameters, a direct draw of one amplification in a rate-mapped pass whose map may
plan several regions (not the identity), of a vertex+fragment pipeline whose vertex function
chooses no slice or viewport and takes no compensation or band, asks for the region variant
(BindState::region_viewports). The binder keeps the request only for a vertex pipeline drawn
in one pass of no views, and the runtime follows the settled plan's VariantKey.

Each batch of k regions (k = min(regions, maxViewports, maxMultiDrawCount - 1); the spec's
"drawCount must be less than" maxMultiDrawCount) sets k viewports and scissors, the last
batch padded with its first viewport through empty scissors, and records one
vkCmdDrawMulti[Indexed]EXT of as many identical draws as regions; the VkPipeline takes k
viewports (FixedState::viewports). DrawIndex selects each region's viewport and scissor.

- recorder: vkCmdDrawMultiEXT / vkCmdDrawMultiIndexedEXT routed and counted (MultiDraws).
- device: MultiDraws loaded with the batch from VkPhysicalDeviceMultiDrawPropertiesEXT.
- render: DrawState::draws, region_states, Recording::multi; execution settles ask alike.
- lane rate_mapped_passes: a direct draw (batched) and the same draw from an indirect buffer
  (region by region) shade the same bytes over 36 regions, plain and indexed; the counts show
  each route ran. rate_map_costs counts multi-draws.
- binder: a mesh, tessellated or amplified draw keeps the plain variant.

Verified: not yet built; the next commits fix forward what the build reports.
2026-11-12 12:37:46 -08:00
..