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

◆ create_shader_module()

std::shared_ptr< VKShaderModule > MayaFlux::Core::BackendPipelineManager::create_shader_module ( const std::string &  spirv_path,
uint32_t  stage 
)

Create a shader module from SPIR-V binary.

Parameters
spirv_pathPath to the SPIR-V binary file
stageShader stage (e.g., vertex, fragment, compute)
Returns
Shared pointer to the created VKShaderModule

Definition at line 51 of file BackendPipelineManager.cpp.

52{
53 auto shader = std::make_shared<VKShaderModule>();
54 if (!shader->create_from_spirv_file(m_context.get_device(), spirv_path, vk::ShaderStageFlagBits(stage))) {
56 "Failed to create shader module from '{}'", spirv_path);
57 return nullptr;
58 }
59
60 track_shader(shader);
61 return shader;
62}
#define MF_ERROR(comp, ctx,...)
void track_shader(const std::shared_ptr< VKShaderModule > &shader)
vk::Device get_device() const
Get logical device.
Definition VKContext.hpp:49
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Core::VKContext::get_device(), MayaFlux::Journal::GraphicsBackend, m_context, MF_ERROR, and track_shader().

Referenced by setup_backend_service().

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