Files
metal2vulkan/docs
Anees Iqbal 5e020e43bd fd blocks: buffers that declare their padding unobserved stay in plain blocks
A texture over a buffer whose rows lie apart is in place only where the buffer declares
its padding unobserved, and there, over a plain block, it may take a DRM_FORMAT_MOD_LINEAR
image at Metal's pitch, which RADV makes for exportable memory only as a dedicated
allocation. The placement test at b48d8fae41 counted 15276 such textures lost over
exportable blocks for padding-unobserved buffers and 0 for padding-kept ones. So the split:

- BufferDescriptor's padding_unobserved reaches the placement (Made, buffer_of_length,
  NewBufferOf::Unobserved): such a buffer lies in a plain block (Holds::Buffers) wherever;
  every other buffer of the runtime's buffer path lies where the device's own buffers do.
- The recycler's BufferMaking keys on the block kind, so a parked buffer in an exportable
  block is never handed to a padding-unobserved one.
- fd_blocks_cover's second guard asks what a padding-kept texture can take: rows one after
  another at a multiple of 16 bytes where the device's own linear image lies otherwise, at
  every width of linear_alignment::WIDTHS, every backed format and usage; any
  DRM_FORMAT_MOD_LINEAR image of its own memory made there refuses the blocks. The linear
  layout comparison runs at every width too.
- WorkCounts::plain_buffer_blocks_made counts plain blocks of buffers, beside
  fd_buffer_blocks_made, so a lane can read the share of block makes on each side; the bench
  prints it.
- The placement test tries rows rounded to 16 too, makes the program's buffer through
  new_buffer_with_descriptor for each padding, asserts where it lies, and asserts 0 lost for
  both kinds. The nv12 test checks a padding-unobserved picture lies in a plain block while a
  parked exportable one of its making exists.
- Docs: memory.rs, in_place_check.rs, the FAST-PATHS in-place row, the descriptor field and
  the runtime README.

Verified: cargo fmt only; builds and device tests are dispatched next.
(cherry picked from commit 6e5c80ac3caaa2ad26c0456ecfc0801bca4ccd42)
2026-11-09 01:44:41 -08:00
..