MayaFlux 0.1.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 161 of file ShaderFoundry.cpp.

165{
166 if (!is_initialized()) {
168 "ShaderFoundry not initialized");
169 return nullptr;
170 }
171
172 auto shader = create_shader_module();
173 auto vk_stage = to_vulkan_stage(stage);
174
175 if (!shader->create_from_glsl(
176 get_device(), source, vk_stage, entry_point,
178 m_config.defines)) {
180 "Failed to compile GLSL source");
181 return nullptr;
182 }
183
185 "Compiled shader from source ({})", vk::to_string(vk_stage));
186 return shader;
187}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
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: