Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
foray::core::ShaderManager::ShaderCompilation Struct Reference

Represents a unique shader compilation (input source path + config => Spirv file) More...

#include <foray_shadermanager.hpp>

Public Member Functions

 ShaderCompilation (ShaderManager *manager, const osi::Utf8Path &source, const ShaderCompilerConfig &config, uint64_t hash)
 Sets SpvPath and updates LastCompile.
 
void FindIncludes ()
 Finds all includes and configures them in the watch of the shader manager.
 
bool Compile ()
 Invokes the shader compiler.
 
ECompileCheckResult NeedsCompile (WriteTimeLookup &compileTimeLookup)
 Checks for need to recompile.
 

Public Attributes

ShaderManagerManager = nullptr
 Owning manager object.
 
osi::Utf8Path SourcePath = {}
 Source path.
 
osi::Utf8Path SpvPath = {}
 Output path.
 
std::filesystem::file_time_type LastCompile = std::filesystem::file_time_type::min()
 Last successful compile time.
 
std::filesystem::file_time_type LastFailedCompile = std::filesystem::file_time_type::min()
 Time of last failed compile.
 
std::unordered_set< IncludeFile * > Includes = {}
 List of includes.
 
ShaderCompilerConfig Config = {}
 Configuration of the shader compiler.
 
uint64_t Hash = 0
 Hash identifying the compilation.
 

Detailed Description

Represents a unique shader compilation (input source path + config => Spirv file)

Constructor & Destructor Documentation

◆ ShaderCompilation()

foray::core::ShaderManager::ShaderCompilation::ShaderCompilation ( ShaderManager manager,
const osi::Utf8Path source,
const ShaderCompilerConfig config,
uint64_t  hash 
)

Sets SpvPath and updates LastCompile.

Parameters
sourceAbsolute source file path
configCompiler configuration
hashcompilation hash

Member Function Documentation

◆ Compile()

bool foray::core::ShaderManager::ShaderCompilation::Compile ( )

Invokes the shader compiler.

Returns
True, if compilation was successful

◆ FindIncludes()

void foray::core::ShaderManager::ShaderCompilation::FindIncludes ( )

Finds all includes and configures them in the watch of the shader manager.

◆ NeedsCompile()

ECompileCheckResult foray::core::ShaderManager::ShaderCompilation::NeedsCompile ( WriteTimeLookup compileTimeLookup)

Checks for need to recompile.

Parameters
compileTimeLookupLookup for writetimes of already checked files

Member Data Documentation

◆ Config

ShaderCompilerConfig foray::core::ShaderManager::ShaderCompilation::Config = {}

Configuration of the shader compiler.

◆ Hash

uint64_t foray::core::ShaderManager::ShaderCompilation::Hash = 0

Hash identifying the compilation.

◆ Includes

std::unordered_set<IncludeFile*> foray::core::ShaderManager::ShaderCompilation::Includes = {}

List of includes.

◆ LastCompile

std::filesystem::file_time_type foray::core::ShaderManager::ShaderCompilation::LastCompile = std::filesystem::file_time_type::min()

Last successful compile time.

◆ LastFailedCompile

std::filesystem::file_time_type foray::core::ShaderManager::ShaderCompilation::LastFailedCompile = std::filesystem::file_time_type::min()

Time of last failed compile.

◆ Manager

ShaderManager* foray::core::ShaderManager::ShaderCompilation::Manager = nullptr

Owning manager object.

◆ SourcePath

osi::Utf8Path foray::core::ShaderManager::ShaderCompilation::SourcePath = {}

Source path.

◆ SpvPath

osi::Utf8Path foray::core::ShaderManager::ShaderCompilation::SpvPath = {}

Output path.


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