MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
RenderProcessor.cpp
Go to the documentation of this file.
1#include "RenderProcessor.hpp"
2
7
12
14
15namespace MayaFlux::Buffers {
16
18 std::unordered_map<std::shared_ptr<VKBuffer>, RenderProcessor::VertexInfo>& buffer_info,
19 const std::shared_ptr<VKBuffer>& buffer)
20{
21 auto info_it = buffer_info.find(buffer);
22 if (info_it == buffer_info.end()) {
23 if (buffer->has_vertex_layout()) {
24 auto vertex_layout = buffer->get_vertex_layout();
25 if (vertex_layout.has_value()) {
26 buffer_info[buffer] = { .semantic_layout = vertex_layout.value(), .use_reflection = false };
27 info_it = buffer_info.find(buffer);
28 }
29 }
30 if (info_it == buffer_info.end()) {
31 return nullptr;
32 }
33 }
34 return &info_it->second.semantic_layout;
35}
36
43
44void RenderProcessor::set_fragment_shader(const std::string& fragment_path)
45{
47 m_fragment_shader_id = foundry.load_shader(fragment_path, Portal::Graphics::ShaderStage::FRAGMENT);
49}
50
51void RenderProcessor::set_geometry_shader(const std::string& geometry_path)
52{
54 m_geometry_shader_id = foundry.load_shader(geometry_path, Portal::Graphics::ShaderStage::GEOMETRY);
56}
57
58void RenderProcessor::set_tess_control_shader(const std::string& tess_control_path)
59{
61 m_tess_control_shader_id = foundry.load_shader(tess_control_path, Portal::Graphics::ShaderStage::TESS_CONTROL);
63}
64
65void RenderProcessor::set_tess_eval_shader(const std::string& tess_eval_path)
66{
68 m_tess_eval_shader_id = foundry.load_shader(tess_eval_path, Portal::Graphics::ShaderStage::TESS_EVALUATION);
70}
71
72void RenderProcessor::set_target_window(const std::shared_ptr<Core::Window>& window, const std::shared_ptr<VKBuffer>& buffer)
73{
74 m_target_window = window;
75 window->register_rendering_buffer(buffer);
76}
77
82
89
91{
92 if (enabled) {
94 } else {
96 }
97}
98
105
114
126
138
140 uint32_t binding,
141 const std::shared_ptr<Core::VKImage>& texture,
142 vk::Sampler sampler)
143{
144 if (!texture || !texture->is_initialized() || !texture->get_image_view()) {
146 "Cannot bind null texture to binding {}", binding);
147 return;
148 }
149
150 if (!sampler) {
152 sampler = loom.get_default_sampler();
153 }
154
155 m_texture_bindings[binding] = { .texture = texture, .sampler = sampler };
157
159
160 auto& foundry = Portal::Graphics::get_shader_foundry();
161 auto cfg_it = std::ranges::find_if(m_config.bindings,
162 [binding](const auto& pair) {
163 return binding >= pair.second.binding
164 && binding < pair.second.binding + pair.second.count;
165 });
166
167 if (cfg_it != m_config.bindings.end() && !m_descriptor_set_ids.empty()) {
168 const uint32_t cfg_set = cfg_it->second.set;
169 if (cfg_set == 0) {
171 uint32_t array_idx = 0;
172 if (cfg_it->second.count > 1 && binding >= cfg_it->second.binding) {
173 array_idx = binding - cfg_it->second.binding;
174 }
175 foundry.update_descriptor_image(
177 cfg_it->second.binding,
178 texture->get_image_view(),
179 sampler,
180 vk::ImageLayout::eShaderReadOnlyOptimal,
181 array_idx);
182 }
183 } else {
184 auto ds_index = resolve_ds_index(cfg_set);
185 if (ds_index && *ds_index < m_descriptor_set_ids.size()) {
186 foundry.update_descriptor_image(
187 m_descriptor_set_ids[*ds_index],
188 cfg_it->second.binding,
189 texture->get_image_view(),
190 sampler,
191 vk::ImageLayout::eShaderReadOnlyOptimal);
192 }
193 }
194 }
195 }
196
198 "Bound texture to binding {}", binding);
199}
200
202 const std::string& descriptor_name,
203 const std::shared_ptr<Core::VKImage>& texture,
204 vk::Sampler sampler)
205{
206 auto binding_it = m_config.bindings.find(descriptor_name);
207 if (binding_it == m_config.bindings.end()) {
209 "No binding configured for descriptor '{}'", descriptor_name);
210 return;
211 }
212
213 bind_texture(binding_it->second.binding, texture, sampler);
214}
215
216void RenderProcessor::initialize_pipeline(const std::shared_ptr<VKBuffer>& buffer)
217{
220 "Vertex shader not loaded");
221 return;
222 }
223
226 "Fragment shader not loaded");
227 return;
228 }
229
230 if (!m_target_window) {
232 "Target window not set");
233 return;
234 }
235
237
239
241 pipeline_config.vertex_shader = m_shader_id;
242 pipeline_config.fragment_shader = m_fragment_shader_id;
243 pipeline_config.geometry_shader = m_geometry_shader_id;
245 pipeline_config.tess_eval_shader = m_tess_eval_shader_id;
246
247 pipeline_config.topology = m_primitive_topology;
248 pipeline_config.rasterization.polygon_mode = m_polygon_mode;
249 pipeline_config.rasterization.cull_mode = m_cull_mode;
250
251 if (m_blend_attachment.has_value()) {
252 pipeline_config.blend_attachments.push_back(m_blend_attachment.value());
253 } else {
254 pipeline_config.blend_attachments.emplace_back();
255 }
256
257 pipeline_config.depth_stencil = m_depth_stencil;
258
259 if (m_buffer_info.find(buffer) == m_buffer_info.end()) {
260 if (buffer->has_vertex_layout()) {
261 auto vertex_layout = buffer->get_vertex_layout();
262 if (vertex_layout.has_value()) {
263 m_buffer_info[buffer] = {
264 .semantic_layout = vertex_layout.value(),
265 .use_reflection = false
266 };
267 }
268 }
269 }
270
272 if (!local_layout) {
274 "initialize_pipeline: layout not yet available, deferring");
275 return;
276 }
277
278 pipeline_config.semantic_vertex_layout = *local_layout;
279 pipeline_config.use_vertex_shader_reflection = m_buffer_info[buffer].use_reflection;
280
281 pipeline_config.push_constant_size = resolve_push_constant_size(buffer);
282
283 auto& descriptor_bindings = buffer->get_pipeline_context().descriptor_buffer_bindings;
284 std::map<std::pair<uint32_t, uint32_t>, Portal::Graphics::DescriptorBindingInfo> unified_bindings;
285
286 for (const auto& binding : descriptor_bindings) {
287 unified_bindings[{ binding.set, binding.binding }] = binding;
288 }
289
290 for (const auto& [name, binding] : m_config.bindings) {
291 auto key = std::make_pair(binding.set, binding.binding);
292 if (unified_bindings.find(key) == unified_bindings.end()) {
293 unified_bindings[key] = Portal::Graphics::DescriptorBindingInfo {
294 .set = binding.set,
295 .binding = binding.binding,
296 .type = binding.type,
297 .buffer_info = {},
298 .name = name,
299 .count = binding.count
300 };
301 }
302 }
303
304 std::map<uint32_t, std::vector<Portal::Graphics::DescriptorBindingInfo>> bindings_by_set;
305 for (const auto& [key, binding] : unified_bindings) {
306 bindings_by_set[binding.set].push_back(binding);
307 }
308
309 for (const auto& [set_index, set_bindings] : bindings_by_set) {
310 pipeline_config.descriptor_sets.push_back(set_bindings);
311 }
312
313 vk::Format swapchain_format = static_cast<vk::Format>(
315
316 vk::Format depth_format = m_depth_enabled
317 ? vk::Format::eD32Sfloat
318 : vk::Format::eUndefined;
319
320 m_pipeline_id = flow.create_pipeline(pipeline_config, { swapchain_format }, depth_format);
321
324 "Failed to create render pipeline");
325 return;
326 }
327
328 if (m_depth_enabled) {
329 buffer->set_needs_depth_attachment(true);
330 }
331
334
336}
337
338void RenderProcessor::initialize_descriptors(const std::shared_ptr<VKBuffer>& buffer)
339{
342 "Cannot allocate descriptor sets without pipeline");
343 return;
344 }
345
347
349 auto& foundry = Portal::Graphics::get_shader_foundry();
350
351 auto vt_layout = flow.get_view_transform_layout(m_pipeline_id);
352 if (vt_layout) {
353 m_view_transform_descriptor_set_id = foundry.allocate_descriptor_set(vt_layout);
354
355 m_view_transform_ubo = std::make_shared<VKBuffer>(
357 VKBuffer::Usage::UNIFORM,
360
361 foundry.update_descriptor_buffer(
363 0,
364 vk::DescriptorType::eUniformBuffer,
365 m_view_transform_ubo->get_buffer(),
366 0,
367 sizeof(Kinesis::ViewTransform));
368
370 "ViewTransform UBO allocated (pipeline {})", m_pipeline_id);
371 }
372
373 m_descriptor_set_ids = flow.allocate_pipeline_descriptors(m_pipeline_id, 1);
374
375 for (const auto& [binding, tex_binding] : m_texture_bindings) {
376 if (!tex_binding.texture
377 || !tex_binding.texture->is_initialized()
378 || !tex_binding.texture->get_image_view()) {
379 continue;
380 }
381
382 auto config_it = std::ranges::find_if(m_config.bindings,
383 [binding](const auto& pair) {
384 return binding >= pair.second.binding
385 && binding < pair.second.binding + pair.second.count;
386 });
387
388 if (config_it == m_config.bindings.end()) {
390 "No config for binding {}", binding);
391 continue;
392 }
393
394 const uint32_t set_index = config_it->second.set;
395
396 if (set_index == 0) {
399 "Engine descriptor set not allocated for set=0 texture binding {}", binding);
400 continue;
401 }
402 foundry.update_descriptor_image(
404 config_it->second.binding,
405 tex_binding.texture->get_image_view(),
406 tex_binding.sampler,
407 vk::ImageLayout::eShaderReadOnlyOptimal,
408 binding - config_it->second.binding);
409 continue;
410 }
411
412 auto ds_index = resolve_ds_index(set_index);
413 if (!ds_index) {
415 "Descriptor set index {} out of range", binding);
416 continue;
417 }
418
419 foundry.update_descriptor_image(
420 m_descriptor_set_ids[*ds_index],
421 config_it->second.binding,
422 tex_binding.texture->get_image_view(),
423 tex_binding.sampler,
424 vk::ImageLayout::eShaderReadOnlyOptimal,
425 binding - config_it->second.binding);
426 }
427
429 "Allocated {} descriptor sets and updated {} texture bindings",
431
432 update_descriptors(buffer);
434}
435
436void RenderProcessor::set_vertex_range(uint32_t first_vertex, uint32_t vertex_count)
437{
438 m_first_vertex = first_vertex;
439 m_vertex_count = vertex_count;
440
442 "RenderProcessor: Set vertex range [offset={}, count={}]",
443 first_vertex, vertex_count);
444}
445
447 const std::shared_ptr<VKBuffer>& buffer,
448 const Kakshya::VertexLayout& layout)
449{
450 m_buffer_info[buffer] = {
451 .semantic_layout = layout,
452 .use_reflection = false
453 };
455}
456
457bool RenderProcessor::on_before_execute(Portal::Graphics::CommandBufferID /*cmd_id*/, const std::shared_ptr<VKBuffer>& /*buffer*/)
458{
459 if (!m_target_window) {
461 "Target window not set");
462 return false;
463 }
464 return m_target_window->is_graphics_registered();
465}
466
467void RenderProcessor::execute_shader(const std::shared_ptr<VKBuffer>& buffer)
468{
469 if (m_buffer_info.find(buffer) == m_buffer_info.end()) {
470 if (buffer->has_vertex_layout()) {
471 auto vertex_layout = buffer->get_vertex_layout();
472 if (vertex_layout.has_value()) {
473 m_buffer_info[buffer] = {
474 .semantic_layout = vertex_layout.value(),
475 .use_reflection = false
476 };
477 }
478 }
479 }
480
481 if (!m_target_window->is_graphics_registered()) {
482 return;
483 }
484
486 return;
487 }
488
490 if (!local_layout) {
492 "VKBuffer has no vertex layout set. Use buffer->set_vertex_layout()");
493 return;
494 }
495
496 buffer->set_pipeline_window(m_pipeline_id, m_target_window);
497
498 auto& foundry = Portal::Graphics::get_shader_foundry();
500
501 vk::Format color_format = static_cast<vk::Format>(
503
504 vk::Format depth_format = m_depth_enabled
505 ? vk::Format::eD32Sfloat
506 : vk::Format::eUndefined;
507
508 auto cmd_id = foundry.begin_secondary_commands(color_format, depth_format);
509 auto cmd = foundry.get_command_buffer(cmd_id);
510
511 uint32_t width = 0, height = 0;
513
514 if (width > 0 && height > 0) {
515 auto cmd = foundry.get_command_buffer(cmd_id);
516
517 vk::Viewport viewport {
518 0.0F,
519 static_cast<float>(height),
520 static_cast<float>(width),
521 -static_cast<float>(height),
522 0.0F,
523 1.0F
524 };
525 cmd.setViewport(0, 1, &viewport);
526
527 vk::Rect2D scissor { { 0, 0 }, { width, height } };
528 cmd.setScissor(0, 1, &scissor);
529 }
530
531 flow.bind_pipeline(cmd_id, m_pipeline_id);
532
533 auto& engine_bindings = buffer->get_engine_context().ssbo_bindings;
534 for (const auto& binding : engine_bindings) {
535 if (binding.set == 0 && binding.binding == 0) {
537 "Engine SSBO at binding=0 is reserved for ViewTransform UBO");
538 continue;
539 }
542 "Engine SSBO binding {} skipped: engine descriptor set not allocated", binding.binding);
543 continue;
544 }
545 foundry.update_descriptor_buffer(
547 binding.binding,
548 binding.type,
549 binding.buffer_info.buffer,
550 binding.buffer_info.offset,
551 binding.buffer_info.range);
552 }
553
554 auto& descriptor_bindings = buffer->get_pipeline_context().descriptor_buffer_bindings;
555 if (!descriptor_bindings.empty()) {
556 for (const auto& binding : descriptor_bindings) {
557 auto ds_index = resolve_ds_index(binding.set);
558 if (!ds_index) {
560 "Descriptor set index {} out of range or reserved", binding.set);
561 continue;
562 }
563
564 foundry.update_descriptor_buffer(
565 m_descriptor_set_ids[*ds_index],
566 binding.binding,
567 binding.type,
568 binding.buffer_info.buffer,
569 binding.buffer_info.offset,
570 binding.buffer_info.range);
571 }
572 }
573
574 if (!m_descriptor_set_ids.empty()) {
575 flow.bind_descriptor_sets(cmd_id, m_pipeline_id, m_descriptor_set_ids);
576 }
577
578 {
584 }
585
586 if (m_view_transform_ubo && m_view_transform_ubo->get_mapped_ptr()) {
587 std::memcpy(
588 m_view_transform_ubo->get_mapped_ptr(),
589 &vt,
590 sizeof(Kinesis::ViewTransform));
591 }
592 }
593
595 flow.bind_descriptor_sets(
596 cmd_id, m_pipeline_id,
598 0);
599 }
600
601 if (!m_descriptor_set_ids.empty()) {
602 flow.bind_descriptor_sets(
603 cmd_id, m_pipeline_id,
605 1);
606 }
607
608 const auto push_data = resolve_push_constants(buffer);
609 if (!push_data.empty()) {
610 flow.push_constants(
611 cmd_id, m_pipeline_id, push_data.data(), push_data.size());
612 }
613
614 on_before_execute(cmd_id, buffer);
615
616 flow.bind_vertex_buffers(cmd_id, { buffer });
617
618 uint32_t draw_count = 0;
619 if (m_vertex_count > 0) {
620 draw_count = m_vertex_count;
621 } else {
622 auto current_layout = buffer->get_vertex_layout();
623 if (!current_layout.has_value() || current_layout->vertex_count == 0) {
625 "Vertex layout has zero vertices, skipping draw");
626 return;
627 }
628 draw_count = current_layout->vertex_count;
629 }
630
631 if (buffer->has_index_buffer()) {
632 const auto index_count = static_cast<uint32_t>(
633 buffer->get_index_buffer_size() / sizeof(uint32_t));
634 flow.bind_index_buffer(cmd_id, buffer);
635 flow.draw_indexed(cmd_id, index_count, m_instance_count, 0, 0, 0);
636 } else {
637 flow.draw(cmd_id, draw_count, m_instance_count, m_first_vertex, 0);
638 }
639
640 foundry.end_commands(cmd_id);
641
642 buffer->set_pipeline_command(m_pipeline_id, cmd_id);
643 m_target_window->track_frame_command(cmd_id);
644
646 "Recorded secondary command buffer {} for window '{}'",
647 cmd_id, m_target_window->get_create_info().title);
648}
649
650void RenderProcessor::on_attach(const std::shared_ptr<Buffer>& buffer)
651{
652 auto vk_buffer = std::dynamic_pointer_cast<VKBuffer>(buffer);
653 if (!vk_buffer)
654 return;
655
657 "RenderProcessor attached to VKBuffer (size: {} bytes, modality: {})",
658 vk_buffer->get_size_bytes(),
659 static_cast<int>(vk_buffer->get_modality()));
660
661 if (vk_buffer && vk_buffer->has_vertex_layout()) {
662 auto vertex_layout = vk_buffer->get_vertex_layout();
663 if (vertex_layout.has_value()) {
665 "RenderProcessor: Auto-injecting vertex layout "
666 "({} vertices, {} attributes)",
667 vertex_layout->vertex_count,
668 vertex_layout->attributes.size());
669
671 m_buffer_info[vk_buffer] = { .semantic_layout = vertex_layout.value(), .use_reflection = false };
672 }
673 }
674
675 if (m_depth_enabled) {
676 vk_buffer->set_needs_depth_attachment(true);
677 }
678
679 if (!m_display_service) {
682 }
683}
684
686{
687 auto& foundry = Portal::Graphics::get_shader_foundry();
689
691 flow.destroy_pipeline(m_pipeline_id);
693 }
694
696 foundry.destroy_shader(m_geometry_shader_id);
698 }
699
701 foundry.destroy_shader(m_tess_control_shader_id);
703 }
704
706 foundry.destroy_shader(m_tess_eval_shader_id);
708 }
709
711 foundry.destroy_shader(m_fragment_shader_id);
713 }
714
715 m_view_transform_ubo.reset();
718
719 if (m_target_window) {
720 flow.unregister_window(m_target_window);
721 m_target_window.reset();
722 }
723
725
727 "RenderProcessor cleanup complete");
728}
729
730} // namespace MayaFlux::Buffers
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
#define MF_RT_TRACE(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
#define MF_RT_DEBUG(comp, ctx,...)
vk::CommandBuffer cmd
uint32_t width
Definition Decoder.cpp:66
uint32_t height
void bind_texture(uint32_t binding, const std::shared_ptr< Core::VKImage > &texture, vk::Sampler sampler=nullptr)
Bind a texture to a descriptor binding point.
Portal::Graphics::DescriptorSetID m_view_transform_descriptor_set_id
void set_blend_attachment(const Portal::Graphics::BlendAttachmentConfig &config)
Set blend mode for color attachment.
Portal::Graphics::ShaderID m_fragment_shader_id
std::unordered_map< std::shared_ptr< VKBuffer >, VertexInfo > m_buffer_info
void disable_alpha_blending()
Disable blending on the color attachment, restoring opaque writes.
void set_buffer_vertex_layout(const std::shared_ptr< VKBuffer > &buffer, const Kakshya::VertexLayout &layout)
Override the vertex layout used when building the pipeline for buffer.
std::optional< Portal::Graphics::BlendAttachmentConfig > m_blend_attachment
Registry::Service::DisplayService * m_display_service
Portal::Graphics::ShaderID m_geometry_shader_id
void set_tess_eval_shader(const std::string &tess_eval_path)
bool on_before_execute(Portal::Graphics::CommandBufferID cmd_id, const std::shared_ptr< VKBuffer > &buffer) override
Called before each process callback.
void enable_alpha_blending()
Enable standard alpha blending (src_alpha, one_minus_src_alpha).
std::function< Kinesis::ViewTransform()> m_view_transform_source
void set_tess_control_shader(const std::string &tess_control_path)
Portal::Graphics::RenderPipelineID m_pipeline_id
void enable_depth_test(Portal::Graphics::CompareOp compare_op=Portal::Graphics::CompareOp::LESS)
Enable depth testing for this processor's pipeline.
Portal::Graphics::ShaderID m_tess_control_shader_id
void on_attach(const std::shared_ptr< Buffer > &buffer) override
Called when this processor is attached to a buffer.
void initialize_descriptors(const std::shared_ptr< VKBuffer > &buffer) override
std::optional< Kinesis::ViewTransform > m_view_transform
Portal::Graphics::DepthStencilConfig m_depth_stencil
void initialize_pipeline(const std::shared_ptr< VKBuffer > &buffer) override
std::unordered_map< uint32_t, TextureBinding > m_texture_bindings
void disable_depth_test()
Disable depth testing and depth writes for this processor's pipeline.
void set_geometry_shader(const std::string &geometry_path)
void set_vertex_range(uint32_t first_vertex, uint32_t vertex_count)
Set vertex range for drawing subset of buffer.
Portal::Graphics::PrimitiveTopology m_primitive_topology
void set_view_transform(const Kinesis::ViewTransform &vt)
Set static view transform (evaluated once)
RenderProcessor(const ShaderConfig &config)
void set_fragment_shader(const std::string &fragment_path)
Portal::Graphics::PolygonMode m_polygon_mode
void execute_shader(const std::shared_ptr< VKBuffer > &buffer) override
void set_target_window(const std::shared_ptr< Core::Window > &window, const std::shared_ptr< VKBuffer > &buffer)
void set_alpha_blending(bool enabled)
Toggle standard alpha blending.
Portal::Graphics::CullMode m_cull_mode
const Kakshya::VertexLayout * get_or_cache_vertex_layout(std::unordered_map< std::shared_ptr< VKBuffer >, VertexInfo > &buffer_info, const std::shared_ptr< VKBuffer > &buffer)
std::shared_ptr< Core::Window > m_target_window
Portal::Graphics::ShaderID m_tess_eval_shader_id
std::shared_ptr< VKBuffer > m_view_transform_ubo
void set_view_transform_source(std::function< Kinesis::ViewTransform()> fn)
Set dynamic view transform source (evaluated every frame)
std::optional< uint32_t > resolve_ds_index(uint32_t set) const
Resolve logical descriptor set index to actual index.
Portal::Graphics::ShaderID m_shader_id
virtual void on_descriptors_created()
Called after descriptor sets are created.
size_t resolve_push_constant_size(const std::shared_ptr< VKBuffer > &buffer) const
Byte width of this processor's push constant block, extended to cover any fragment staged on the buff...
virtual void update_descriptors(const std::shared_ptr< VKBuffer > &buffer)
virtual void on_pipeline_created(Portal::Graphics::ComputePipelineID pipeline_id)
Called after pipeline is created.
virtual void on_before_descriptors_create()
Called before descriptor sets are created.
bool m_engine_owns_set_zero
Whether the engine reserves set=0 for global resources.
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
std::vector< uint8_t > resolve_push_constants(const std::shared_ptr< VKBuffer > &buffer) const
This processor's push constant data with buffer-staged fragments overlaid at their declared offsets.
Abstract base class for shader-based buffer processing.
void ensure_initialized(const std::shared_ptr< VKBuffer > &buffer)
Definition VKBuffer.cpp:448
void register_window_for_rendering(const std::shared_ptr< Core::Window > &window)
Register a window for dynamic rendering.
ShaderID load_shader(const std::string &content, std::optional< ShaderStage > stage=std::nullopt, const std::string &entry_point="main")
Universal shader loader - auto-detects source type.
Interface * get_service()
Query for a backend service.
static BackendRegistry & instance()
Get the global registry instance.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
@ UNKNOWN
Unknown or undefined modality.
constexpr RenderPipelineID INVALID_RENDER_PIPELINE
MAYAFLUX_API TextureLoom & get_texture_manager()
Get the global texture manager instance.
constexpr ShaderID INVALID_SHADER
MAYAFLUX_API RenderFlow & get_render_flow()
Get the global render flow instance.
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
CompareOp
Depth/stencil comparison operation.
constexpr DescriptorSetID INVALID_DESCRIPTOR_SET
std::string shader_path
Path to shader file.
std::unordered_map< std::string, ShaderBinding > bindings
Complete description of vertex data layout in a buffer.
View and projection matrices as a named push constant slot.
static BlendAttachmentConfig alpha_blend()
Create standard alpha blending configuration.
Per-attachment blend configuration.
std::vector< std::vector< DescriptorBindingInfo > > descriptor_sets
std::optional< Kakshya::VertexLayout > semantic_vertex_layout
std::vector< BlendAttachmentConfig > blend_attachments
Complete render pipeline configuration.
std::function< int(const std::shared_ptr< void > &)> get_swapchain_format
Get actual swapchain format for a window.
std::function< void(const std::shared_ptr< void > &, uint32_t &, uint32_t &)> get_swapchain_extent
Get swapchain extent for a window.
Backend display and presentation service interface.