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

◆ create_from_spirv_file()

bool MayaFlux::Core::VKShaderModule::create_from_spirv_file ( vk::Device  device,
const std::string &  spirv_path,
vk::ShaderStageFlagBits  stage,
const std::string &  entry_point = "main",
bool  enable_reflection = true 
)

Create shader module from SPIR-V file.

Parameters
deviceLogical device
spirv_pathPath to .spv file
stageShader stage
entry_pointEntry point function name
enable_reflectionExtract metadata
Returns
true if creation succeeded

Reads binary file and calls create_from_spirv().

Definition at line 182 of file VKShaderModule.cpp.

188{
189 std::string resolved_path = resolve_shader_path(spirv_path);
190
191 auto spirv_code = read_spirv_file(resolved_path);
192 if (spirv_code.empty()) {
194 "Failed to read SPIR-V file: '{}'", spirv_path);
195 return false;
196 }
197
199 "Loaded SPIR-V from file: '{}'", spirv_path);
200
201 return create_from_spirv(device, spirv_code, stage, entry_point, enable_reflection);
202}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
bool create_from_spirv(vk::Device device, const std::vector< uint32_t > &spirv_code, vk::ShaderStageFlagBits stage, const std::string &entry_point="main", bool enable_reflection=true)
Create shader module from SPIR-V binary.
static std::vector< uint32_t > read_spirv_file(const std::string &filepath)
Read binary file into vector.
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, create_from_spirv(), MayaFlux::Journal::GraphicsBackend, MF_DEBUG, MF_ERROR, and read_spirv_file().

+ Here is the call graph for this function: