84{
86 if (it !=
m_staging_buffers.end() && it->second->get_size_bytes() >=
source->get_size_bytes() && it->second->is_initialized()) {
87 return;
88 }
89
90 auto staging_buffer = std::make_shared<VKBuffer>(
92 VKBuffer::Usage::STAGING,
94
96 error<std::runtime_error>(
99 std::source_location::current(),
100 "No processing context available for staging buffer initialization");
101 }
102
103 if (!staging_buffer->is_initialized()) {
104 try {
106 } catch (const std::exception& e) {
110 std::source_location::current(),
111 "Failed to initialize staging buffer: {}", e.what());
112 }
113 }
114
116
118 "Created staging buffer for download: {} bytes", staging_buffer->get_size_bytes());
119}
#define MF_INFO(comp, ctx,...)
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< VKBuffer > > m_staging_buffers
Maps source VKBuffer -> staging buffer (for device-local transfers)
Registry::Service::BufferService * m_buffer_service
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Buffers
Buffers, Managers, processors and processing chains.
@ UNKNOWN
Unknown or undefined modality.
std::function< void(const std::shared_ptr< void > &)> initialize_buffer
Initialize a buffer object.