Class TextureUploadBatch#

Class Documentation#

class TextureUploadBatch#

Records many textures’ uploads into one command buffer through one staging ring, a host-visible buffer filled front to back and reused after each submit: one fence wait per fill instead of one per texture. A staged Texture must stay where it is until finish(), which writes or, on a failed submit, empties it.

Public Functions

TextureUploadBatch(std::shared_ptr<VulkanDevice> device, vk::CommandPool command_pool, vk::DeviceSize expected_bytes)#
TextureUploadBatch(const TextureUploadBatch&) = delete#
TextureUploadBatch &operator=(const TextureUploadBatch&) = delete#
TextureUploadBatch(TextureUploadBatch&&) = delete#
TextureUploadBatch &operator=(TextureUploadBatch&&) = delete#
~TextureUploadBatch()#
bool finish()#

Submits what is recorded and waits for it; false when that submit failed.

inline std::size_t stagedCount() const#
inline std::size_t submitCount() const#
inline vk::DeviceSize ringBytes() const#

Public Static Attributes

static constexpr vk::DeviceSize kMaxRingBytes = vk::DeviceSize{64} << 20U#

The ring never holds more than this unless one texture needs more.