![]() |
NDEVR
API Documentation
|
Utility class for compiling GLSL shader source files into SPIR-V binaries using the Vulkan SDK glslangValidator tool. More...
Public Member Functions | |
| ShaderTools () | |
| Constructs ShaderTools and expands environment variables in the executable path. | |
| void | compileDefault () |
| Compiles all default shaders from the VulkanInterface resources directory. | |
| void | compileIndividualShader (File compile_file, File output_location) |
| Compiles a single shader file to SPIR-V. | |
| void | compileShader (File reference) |
| Compiles a single shader file to SPIR-V with the same base name. | |
| void | compileShader (File reference, const StringView &out_name, const StringView &value, bool is_simple) |
| Compiles a shader variant by enabling a preprocessor define and writing a temporary file. | |
| void | compileShaders (File reference) |
| Compiles all standard shader variants (points, linework, solid, etc.) from a reference file. | |
Public Attributes | |
| File | exe_location = File("$(VULKAN_DIR)/Bin/glslangValidator.exe") |
| Path to the glslangValidator executable. | |
| LogPtr | log = nullptr |
| Log for compilation status messages. | |
Utility class for compiling GLSL shader source files into SPIR-V binaries using the Vulkan SDK glslangValidator tool.
Definition at line 14 of file ShaderTools.h.
Compiles a single shader file to SPIR-V.
| [in] | compile_file | The shader source file to compile. |
| [in] | output_location | The destination for the compiled SPIR-V binary. |
Definition at line 27 of file ShaderTools.h.
References LocalApplicationLauncher::CallApplication(), exe_location, and log.
Referenced by compileShader(), and compileShader().
|
inline |
Compiles a single shader file to SPIR-V with the same base name.
| [in] | reference | The shader source file to compile. |
Definition at line 70 of file ShaderTools.h.
References compileIndividualShader(), File::e_file_extension, and File::setPath().
|
inline |
Compiles a shader variant by enabling a preprocessor define and writing a temporary file.
| [in] | reference | The reference shader source file. |
| [in] | out_name | The output file name (without extension). |
| [in] | value | The preprocessor define to enable. |
| [in] | is_simple | Whether this is a simple shader variant. |
Definition at line 38 of file ShaderTools.h.
References File::appendPath(), String::beginsWith(), File::close(), compileIndividualShader(), Scanner::currentLine(), File::e_ascii_write, File::e_file_extension, File::expandEnvironmentalVars(), File::getParentDirectory(), File::getPath(), BufferedScanner::nextLine(), and File::open().
Referenced by compileDefault(), and compileShaders().
|
inline |
Compiles all standard shader variants (points, linework, solid, etc.) from a reference file.
| [in] | reference | The reference shader source file. |
Definition at line 78 of file ShaderTools.h.
References compileShader().
Referenced by compileDefault().