68{
70 if (it !=
m_staging_buffers.end() && it->second->get_size_bytes() >= target->get_size_bytes() && it->second->is_initialized()) {
71 return;
72 }
73
74 auto staging_buffer = std::make_shared<VKBuffer>(
75 target->get_size_bytes(),
78
80 error<std::runtime_error>(
83 std::source_location::current(),
84 "No processing context available for staging buffer initialization");
85 }
86
87 if (!staging_buffer->is_initialized()) {
88 try {
90 } catch (const std::exception& e) {
94 std::source_location::current(),
95 "Failed to initialize staging buffer: {}", e.what());
96 }
97 }
98
100
102 "Created staging buffer: {} bytes", staging_buffer->get_size_bytes());
103}
#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.