Expand description
This module contains the convoluted logic that goes into uploading content into the texture cache’s textures.
We need to support various combinations of code paths depending on the quirks of each hardware/driver configuration:
- direct upload,
- staged upload via a pixel buffer object,
- staged upload via a direct upload to a staging texture where PBO’s aren’t supported,
- copy from the staging to destination textures, either via blits or batched draw calls.
Conceptually a lot of this logic should probably be in the device module, but some code here relies on submitting draw calls via the renderer.
Structs§
- Batch
Upload 🔒Buffer - Batch
Upload 🔒Copy - Upload
Stats 🔒 - Upload
Texture Pool - A very basic pool to avoid reallocating staging textures as well as staging CPU side buffers.
Enums§
Constants§
Functions§
- copy_
from_ 🔒staging_ to_ cache - Copy from the staging PBOs or textures to texture cache textures using blit commands.
- copy_
from_ 🔒staging_ to_ cache_ using_ draw_ calls - Generate and submit composite shader batches to copy from the staging textures to the destination cache textures.
- copy_
into_ 🔒staging_ buffer - Copy an item into a batched upload staging buffer.
- skip_
staging_ 🔒buffer - Take this code path instead of copying into a staging CPU buffer when the image we would copy is large enough that it’s unlikely anything else would fit in the buffer, therefore we might as well copy directly from the source image’s pixels.
- upload_
to_ texture_ cache - Upload a number of items to texture cache textures.