79{
81 if (it !=
m_staging_buffers.end() && it->second->get_size_bytes() >= source->get_size_bytes() && it->second->is_initialized()) {
82 return;
83 }
84
85 auto staging_buffer = std::make_shared<VKBuffer>(
86 source->get_size_bytes(),
89
91 error<std::runtime_error>(
94 std::source_location::current(),
95 "No processing context available for staging buffer initialization");
96 }
97
98 if (!staging_buffer->is_initialized()) {
99 try {
101 } catch (const std::exception& e) {
105 std::source_location::current(),
106 "Failed to initialize staging buffer: {}", e.what());
107 }
108 }
109
111
113 "Created staging buffer for download: {} bytes", staging_buffer->get_size_bytes());
114}
#define MF_INFO(comp, ctx,...)
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< VKBuffer > > m_staging_buffers
Registry::Service::BufferService * m_buffer_service
@ STAGING
Host-visible staging buffer (CPU-writable)
@ 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.