MayaFlux 1.0.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 302 of file VKShaderModule.cpp.

308{
309 std::string resolved_path = resolve_shader_path(spirv_path);
310
311 auto spirv_code = read_spirv_file(resolved_path);
312 if (spirv_code.empty()) {
314 "Failed to read SPIR-V file: '{}'", spirv_path);
315 return false;
316 }
317
319 "Loaded SPIR-V from file: '{}'", spirv_path);
320
321 return create_from_spirv(device, spirv_code, stage, entry_point, enable_reflection);
322}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
vk::PhysicalDevice device
Definition VKDevice.cpp:121
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(), device, MayaFlux::Journal::GraphicsBackend, MF_DEBUG, MF_ERROR, and read_spirv_file().

+ Here is the call graph for this function: