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

◆ initialize()

bool MayaFlux::Portal::Graphics::ShaderFoundry::initialize ( const std::shared_ptr< Core::VulkanBackend > &  backend,
const ShaderCompilerConfig &  config = {} 
)

Initialize shader compiler.

Parameters
backendShared pointer to VulkanBackend
configCompiler configuration
Returns
True if initialization succeeded

Must be called before compiling any shaders.

Definition at line 34 of file ShaderFoundry.cpp.

37{
38 if (s_initialized) {
40 "ShaderFoundry already initialized (static flag)");
41 return true;
42 }
43
44 if (!backend) {
46 "Cannot initialize ShaderFoundry with null backend");
47 return false;
48 }
49
50 if (m_backend) {
52 "ShaderFoundry already initialized");
53 return true;
54 }
55
56 m_backend = backend;
57 m_config = config;
58
59 append_default_include_directories(m_config);
60
61 m_global_descriptor_manager = std::make_shared<Core::VKDescriptorManager>();
62 m_global_descriptor_manager->initialize(get_device(), 1024);
63
64 m_graphics_queue = m_backend->get_context().get_graphics_queue();
65 m_compute_queue = m_backend->get_context().get_compute_queue();
66 m_transfer_queue = m_backend->get_context().get_transfer_queue();
67
68 s_initialized = true;
69
71 "ShaderFoundry initialized");
72 return true;
73}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
vk::Device get_device() const
Get logical device handle.
std::shared_ptr< Core::VKDescriptorManager > m_global_descriptor_manager
std::shared_ptr< Core::VulkanBackend > m_backend
@ ShaderCompilation
Shader compilation tasks (Portal::Graphics::ShaderCompiler)
@ Portal
High-level user-facing API layer.

References get_device(), m_backend, m_compute_queue, m_config, m_global_descriptor_manager, m_graphics_queue, m_transfer_queue, MF_ERROR, MF_INFO, MF_WARN, MayaFlux::Journal::Portal, s_initialized, and MayaFlux::Journal::ShaderCompilation.

+ Here is the call graph for this function: