Files
reims-vgpu/guest/bundle
Anees Iqbal 2fb018a8e1 🐛 Make tiled textures over Shared buffers as WindowServer asks
With the display on the accelerated model, the first WindowServer's first
Metal composite builds a MetalTiledBacking for the display's backing and
calls newTiledTextureWithDescriptor:offset:bytesPerRow: on its buffer. The
bundle answered no such selector, and WindowServer died raising it (pm14 with
"ReimsGraphicsAMD", pm16 with "ReimsGraphicsIntel": the vendor does not
decide the call). Its arguments (pm15): a 2D BGRA8Unorm descriptor of
1024 x 1024, usage ShaderRead | RenderTarget, storage Managed, at offset 0
with a pitch of 15360 bytes, on a Shared buffer of 36864000 bytes, the
3840 x 2400 display's backing: one tile of it at the backing's pitch.

The buffer now makes a texture over its bytes from the offset, rows
bytesPerRow apart, as newTextureWithDescriptor:offset:bytesPerRow: does,
with the buffer's storage. Measured on the M3 Max under macOS 27.0.1: Metal's
validation layer's buffer (MTLDebugBuffer, type `@40@0:8@16Q24Q32`) answers
the selector and asserts that the descriptor is Managed, the buffer Shared
and offset + bytesPerRow x (height - 1) + a row's bytes within the buffer,
with no alignment of offset or pitch; the M3's own buffers answer no such
selector. Those three rules answer nil here, logged. What a Managed-storage
GPU's driver answers is not measured, as no such GPU is on hand.

Measured on a cold boot of the x86 guest on the effort tip's host (pm17): the
first WindowServer builds its tiled backing, renders through it twice, tears
it down, and stays up through the login to the desktop, compositing with
CompositorMetal at 23-49 frames a second; nothing on the tiled path is
refused or unrecognized.
2026-11-05 21:59:19 -08:00
..