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

◆ compile_from_source()

std::shared_ptr< Core::VKShaderModule > MayaFlux::Portal::Graphics::ShaderFoundry::compile_from_source ( const std::string &  source,
ShaderStage  stage,
const std::string &  entry_point = "main" 
)
private

Definition at line 165 of file ShaderFoundry.cpp.

169{
170 if (!is_initialized()) {
172 "ShaderFoundry not initialized");
173 return nullptr;
174 }
175
176 auto shader = create_shader_module();
177 auto vk_stage = to_vulkan_stage(stage);
178
179 if (!shader->create_from_glsl(
180 get_device(), source, vk_stage, entry_point,
182 m_config.defines)) {
184 "Failed to compile GLSL source");
185 return nullptr;
186 }
187
189 "Compiled shader from source ({})", vk::to_string(vk_stage));
190 return shader;
191}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
vk::Device get_device() const
Get logical device handle.
std::shared_ptr< Core::VKShaderModule > create_shader_module()
static vk::ShaderStageFlagBits to_vulkan_stage(ShaderStage stage)
Convert Portal ShaderStage to Vulkan ShaderStageFlagBits.
bool is_initialized() const
Check if compiler is initialized.
@ ShaderCompilation
Shader compilation tasks (Portal::Graphics::ShaderCompiler)
@ Portal
High-level user-facing API layer.
bool enable_reflection
Extract descriptor bindings and metadata.
std::vector< std::string > include_directories
Paths for #include resolution.
std::unordered_map< std::string, std::string > defines
Preprocessor macros.

References create_shader_module(), MayaFlux::Portal::Graphics::ShaderCompilerConfig::defines, MayaFlux::Portal::Graphics::ShaderCompilerConfig::enable_reflection, get_device(), MayaFlux::Portal::Graphics::ShaderCompilerConfig::include_directories, is_initialized(), m_config, MF_DEBUG, MF_ERROR, MayaFlux::Journal::Portal, MayaFlux::Journal::ShaderCompilation, and to_vulkan_stage().

Referenced by compile(), compile_from_source_cached(), and load_shader().

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