What: on a device without unified memory, BlitCommandEncoder::synchronize_texture
now copies a Managed texture's bytes over a buffer from the buffer's device copy to
its host copy (the caller's pages, or the runtime's own host copy), as
synchronize_resource of the texture already did. A level that lies in the image
alone (a tiled texture's past its first) copies nothing; a texture of an image
alone still records nothing, its CPU access reading its image. The copy is shared
code: synchronize_resource's buffer and texture arms now call synchronize_bytes and
synchronize_texels.
Why: synchronize_texture recorded nothing on every device, its doc saying Managed
memory behaves as shared memory. Without unified memory a Managed buffer is two
copies (managed.rs, managed_copy.rs), and a texture over one serves get_bytes, and
the buffer its contents, from the host copy (buffer_texture.rs Texels::read). So a
program that synchronized with synchronizeTexture:slice:level: read the CPU copy as
of its last didModifyRange: stale texels. Found reading the read-back paths for a
benchmark that fails validation on an RX 7900 XTX.
Docs: the stale doc is replaced; API.md and FAST-PATHS.md name synchronize_texture
beside synchronize_resource for the copy out; the managed counters' docs count it.
Verified: the lane test runtime_lane::device_copies::
a_synchronize_texture_copies_the_texels_out (a blit into rows of a Managed texture
over pages and over a runtime-made Managed buffer, then synchronize_texture: the
contents and get_bytes hold the rows; the copy out counted for the pages with two
copies) is run on a discrete NVIDIA GPU with this change and once without the
runtime fix (negative control); job ids in the report.