Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::CompilerLinker Class Reference

Compiles and links GLSL shaders into SPIR-V bytecode. More...

#include <C:/Code/AeonEngine/engine/renderers/vulkan/SPIR-V/CompilerLinker.hpp>

Collaboration diagram for AeonGames::CompilerLinker:
Collaboration graph

Public Types

enum  TOptions {
  EOptionNone = 0 , EOptionIntermediate = ( 1 << 0 ) , EOptionSuppressInfolog = ( 1 << 1 ) , EOptionMemoryLeakMode = ( 1 << 2 ) ,
  EOptionRelaxedErrors = ( 1 << 3 ) , EOptionGiveWarnings = ( 1 << 4 ) , EOptionLinkProgram = ( 1 << 5 ) , EOptionMultiThreaded = ( 1 << 6 ) ,
  EOptionDumpConfig = ( 1 << 7 ) , EOptionDumpReflection = ( 1 << 8 ) , EOptionSuppressWarnings = ( 1 << 9 ) , EOptionDumpVersions = ( 1 << 10 ) ,
  EOptionSpv = ( 1 << 11 ) , EOptionHumanReadableSpv = ( 1 << 12 ) , EOptionVulkanRules = ( 1 << 13 ) , EOptionDefaultDesktop = ( 1 << 14 ) ,
  EOptionOutputPreprocessed = ( 1 << 15 ) , EOptionOutputHexadecimal = ( 1 << 16 ) , EOptionReadHlsl = ( 1 << 17 ) , EOptionCascadingErrors = ( 1 << 18 ) ,
  EOptionAutoMapBindings = ( 1 << 19 ) , EOptionFlattenUniformArrays = ( 1 << 20 ) , EOptionNoStorageFormat = ( 1 << 21 ) , EOptionKeepUncalled = ( 1 << 22 )
}
 Compiler/linker option flags. More...
enum  FailCode { ESuccess = 0 , EFailCompile , EFailLink }
 Process exit/result codes. More...

Public Member Functions

 CompilerLinker (TOptions aOptions=static_cast< TOptions >(EOptionSpv|EOptionVulkanRules|EOptionLinkProgram))
 Constructor.
void AddShaderSource (EShLanguage aStage, const char *aSource)
 Add GLSL source code for a shader stage.
void RemoveShaderSource (EShLanguage aStage)
 Remove the shader source for a given stage.
FailCode CompileAndLink ()
 Compile all added shader sources and link into a program.
const std::vector< uint32_t > & GetSpirV (EShLanguage aStage) const
 Get the compiled SPIR-V bytecode for a shader stage.
const std::string & GetLog () const
 Get the compilation/link log output.

Detailed Description

Compiles and links GLSL shaders into SPIR-V bytecode.

Definition at line 26 of file CompilerLinker.hpp.

Member Enumeration Documentation

◆ FailCode

Process exit/result codes.

Definition at line 62 of file CompilerLinker.hpp.

◆ TOptions

Compiler/linker option flags.

Definition at line 31 of file CompilerLinker.hpp.

Constructor & Destructor Documentation

◆ CompilerLinker()

AeonGames::CompilerLinker::CompilerLinker ( TOptions aOptions = static_cast<TOptions> ( EOptionSpv | EOptionVulkanRules | EOptionLinkProgram ))

Constructor.

Definition at line 65 of file CompilerLinker.cpp.

Member Function Documentation

◆ AddShaderSource()

void AeonGames::CompilerLinker::AddShaderSource ( EShLanguage aStage,
const char * aSource )

Add GLSL source code for a shader stage.

Definition at line 85 of file CompilerLinker.cpp.

◆ CompileAndLink()

CompilerLinker::FailCode AeonGames::CompilerLinker::CompileAndLink ( )

Compile all added shader sources and link into a program.

Definition at line 145 of file CompilerLinker.cpp.

◆ GetLog()

const std::string & AeonGames::CompilerLinker::GetLog ( ) const

Get the compilation/link log output.

Definition at line 261 of file CompilerLinker.cpp.

◆ GetSpirV()

const std::vector< uint32_t > & AeonGames::CompilerLinker::GetSpirV ( EShLanguage aStage) const

Get the compiled SPIR-V bytecode for a shader stage.

Definition at line 256 of file CompilerLinker.cpp.

◆ RemoveShaderSource()

void AeonGames::CompilerLinker::RemoveShaderSource ( EShLanguage aStage)

Remove the shader source for a given stage.

Definition at line 90 of file CompilerLinker.cpp.


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