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

◆ compile()

std::shared_ptr< Core::VKShaderModule > MayaFlux::Portal::Graphics::ShaderFoundry::compile ( const ShaderSource shader_source)

Compile shader from ShaderSource descriptor.

Parameters
shader_sourceShader descriptor (path or source + type + stage)
Returns
Compiled shader module, or nullptr on failure

Unified interface that dispatches to appropriate compile method. Useful for abstracted shader loading pipelines.

Definition at line 266 of file ShaderFoundry.cpp.

267{
268 switch (shader_source.type) {
270 return compile_from_file(shader_source.content, shader_source.stage, shader_source.entry_point);
271
273 return compile_from_source(shader_source.content, shader_source.stage, shader_source.entry_point);
274
276 return compile_from_spirv(shader_source.content, shader_source.stage, shader_source.entry_point);
277
279 return compile_from_spirv_asm(shader_source.content, shader_source.stage, shader_source.entry_point);
280
281 default:
283 "Unknown shader source type");
284 return nullptr;
285 }
286}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< Core::VKShaderModule > compile_from_source(const std::string &source, ShaderStage stage, const std::string &entry_point="main")
std::shared_ptr< Core::VKShaderModule > compile_from_spirv_asm(const std::string &spirv_asm, ShaderStage stage, const std::string &entry_point="main")
std::shared_ptr< Core::VKShaderModule > compile_from_file(const std::string &filepath, std::optional< ShaderStage > stage=std::nullopt, const std::string &entry_point="main")
std::shared_ptr< Core::VKShaderModule > compile_from_spirv(const std::string &spirv_path, ShaderStage stage, const std::string &entry_point="main")
@ ShaderCompilation
Shader compilation tasks (Portal::Graphics::ShaderCompiler)
@ Portal
High-level user-facing API layer.
@ SPIRV_ASM
In-memory SPIR-V assembly text (assembled via SPIRV-Tools, no shaderc)

References compile_from_file(), compile_from_source(), compile_from_spirv(), compile_from_spirv_asm(), MayaFlux::Portal::Graphics::ShaderSource::content, MayaFlux::Portal::Graphics::ShaderSource::entry_point, MayaFlux::Portal::Graphics::ShaderSource::GLSL_FILE, MayaFlux::Portal::Graphics::ShaderSource::GLSL_STRING, MF_ERROR, MayaFlux::Journal::Portal, MayaFlux::Journal::ShaderCompilation, MayaFlux::Portal::Graphics::ShaderSource::SPIRV_ASM, MayaFlux::Portal::Graphics::ShaderSource::SPIRV_FILE, MayaFlux::Portal::Graphics::ShaderSource::stage, and MayaFlux::Portal::Graphics::ShaderSource::type.

+ Here is the call graph for this function: