MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ fallback_renderer()

void MayaFlux::Buffers::PresentProcessor::fallback_renderer ( const std::shared_ptr< RootGraphicsBuffer > &  root)
private

Definition at line 199 of file RootGraphicsBuffer.cpp.

200{
201 auto& foundry = Portal::Graphics::get_shader_foundry();
203
204 const auto& renderable_buffers = root->get_renderable_buffers();
205
206 if (renderable_buffers.empty()) {
208 "No renderable buffers found in fallback renderer");
209 return;
210 }
211
213 "PresentProcessor submitting {} renderable buffers",
214 renderable_buffers.size());
215
216 std::unordered_map<Core::Window*, std::vector<const RootGraphicsBuffer::RenderableBufferInfo*>> buffers_by_window;
217
218 for (const auto& renderable : renderable_buffers) {
219 buffers_by_window[renderable.target_window.get()].push_back(&renderable);
220 }
221
222 for (const auto& [window_ptr, buffer_infos] : buffers_by_window) {
223 auto window = buffer_infos[0]->target_window;
224
225 if (!window) {
227 "Skipping present: window no longer valid");
228 continue;
229 }
230
231 try {
232 for (const auto* info : buffer_infos) {
233 if (info->command_buffer_id != Portal::Graphics::INVALID_COMMAND_BUFFER) {
234 flow.present_rendered_image(
235 info->command_buffer_id,
236 window);
237 }
238 }
239
241 "Presented {} buffers to window '{}'",
242 buffer_infos.size(),
243 window->get_create_info().title);
244
245 } catch (const std::exception& e) {
247 "Failed to submit/present for window '{}': {}",
248 window->get_create_info().title,
249 e.what());
250 }
251
252 for (const auto* info : buffer_infos) {
253 info->buffer->clear_pipeline_commands();
254 }
255 }
256
257 root->clear_renderable_buffers();
258}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
#define MF_RT_DEBUG(comp, ctx,...)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
MAYAFLUX_API RenderFlow & get_render_flow()
Get the global render flow instance.
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
constexpr CommandBufferID INVALID_COMMAND_BUFFER

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Portal::Graphics::get_render_flow(), MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::INVALID_COMMAND_BUFFER, MF_RT_DEBUG, MF_RT_ERROR, and MF_RT_WARN.

Referenced by processing_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: