A disk cache makes room for an entry at the end of what it will write
(LinearDiskCache::AppendBegin), and the backend writes its pipeline data
straight there: GL's program binary from glGetProgramBinary, D3D12's
blob copied once out of the driver's. The Vulkan pipeline cache is built
in place too, vkGetPipelineCacheData writing into the store written to
disk. No vector in between, no copy of it.
SPIR-V and DXBC stay in the block rslc returns instead of being copied
into vectors, and the disk cache is lent the code to write. Code read
back from the cache is copied once into a block of its own.
Where GL has buffer storage, sync objects and texture storage, a 32 MiB
unpack buffer mapped for good in client memory is what loads of
uncompressed 2D and array textures are decoded into; glTexSubImage
uploads them from it.
AbstractTexture::LendLoad lends the upload stream's memory for a level,
and CommitLoad uploads it: Vulkan for any rows, Direct3D 12 for rows at
its pitch alignment. The texture cache decodes textures and XFBs into
it; it decodes into its own buffer and Loads that where the backend
lends none, or when the arbitrary mipmap detection reads the levels
back. The detector keeps its levels in a fixed array.
AbstractGfx calls into the Gfx of the backend in use, by
g_video_backend_kind; each backend's Gfx is final, so these are direct
calls, and what a backend does not do itself falls to the defaults,
which a backend may also call as the Base* functions. The Gfx is deleted
as its own class. The unused fullscreen calls are gone, and BackendObjects
follows the tree's formatting.
Shaders, pipelines, textures, staging textures and framebuffers call
into the classes of the backend in use, which each backend's Gfx sets
as g_video_backend_kind; those classes are final, so the calls are
direct. A std::default_delete specialization deletes them as their own
class. The Null and Software renderers use the base shader and pipeline
types.