A Managed buffer was guest malloc alone and didModifyRange: did nothing, so the
GPU never saw what the CPU wrote, and a Managed texture had no replaceRegion: or
getBytes: at all. Managed resources now follow Decided 4.
- The CPU copy is a region block of the process's. A buffer is made by
BUFFER_OVER_HOST_MEMORY with Managed options; a texture by the new
MANAGED_TEXTURE_CREATE, which names a Shared buffer over its block and its
format's texel block. Both sides compute the copy's linear layout from that
(reims_graphics::managed, RgfxManagedLayout.hpp).
- On a GPU that does not share the CPU's memory the object is two copies: the
platform's own Managed buffer or texture, and the block beside it.
BUFFER_DID_MODIFY_RANGE copies exactly the named range into the platform
buffer's host copy and calls its didModifyRange:, which copies it to the GPU's
before the next submission. TEXTURE_REPLACE_REGION is the platform's
replaceRegion: from the block. synchronizeResource: and synchronizeTexture:
copy the GPU's copy into the block inside the blit encoder.
- On a GPU that shares it the object lies over its block, a buffer always and a
texture where a texture over a buffer can have its shape, and the range
messages order nothing more.
- Both range messages ride ring 0, which is carried out before any later command
buffer of the process on any queue.
- In the guest, replaceRegion: and getBytes: of a Managed texture are memcpys of
the block, and replaceRegion: posts its region; neither waits for the host. A
Managed buffer or texture with no room in the region is nil.
The host takes the two copies on every GPU until the device's identity answers
carry the platform's hasUnifiedMemory. tools/managed_probe.m checks each path
through a GPU copy.