Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::HLSLIncluder Class Reference

Custom include handler for HLSL shader source files used with shaderc compiler. More...

#include <VulkanShaderCompiler.h>

Inheritance diagram for Raven::HLSLIncluder:

Public Member Functions

shaderc_include_result * GetInclude (const char *requested_source, shaderc_include_type type, const char *requesting_source, size_t include_depth) override
 Called by shaderc to resolve an include file.
void ReleaseInclude (shaderc_include_result *result) override
 Called by shaderc to release memory allocated for an include result.
void SetIncludeRoot (const std::filesystem::path &root)
 Sets the root directory to use when resolving system includes.

Detailed Description

Custom include handler for HLSL shader source files used with shaderc compiler.

Implements shaderc::CompileOptions::IncluderInterface to resolve include directives by searching relative and system paths, reading included files, and returning their contents to the shader compiler.

Member Function Documentation

◆ GetInclude()

shaderc_include_result * Raven::HLSLIncluder::GetInclude ( const char * requested_source,
shaderc_include_type type,
const char * requesting_source,
size_t include_depth )
inlineoverride

Called by shaderc to resolve an include file.

Parameters
requested_sourceName/path of the include file requested.
typeWhether the include is relative or system.
requesting_sourcePath of the file requesting the include.
include_depthDepth of recursive include (unused).
Returns
shaderc_include_result* Pointer to allocated include result containing content or error.

◆ ReleaseInclude()

void Raven::HLSLIncluder::ReleaseInclude ( shaderc_include_result * result)
inlineoverride

Called by shaderc to release memory allocated for an include result.

Parameters
resultPointer to the include result to be freed.

◆ SetIncludeRoot()

void Raven::HLSLIncluder::SetIncludeRoot ( const std::filesystem::path & root)
inline

Sets the root directory to use when resolving system includes.

Parameters
rootFilesystem path to the include root directory.

The documentation for this class was generated from the following file: