class ShaderCompilers

Keeps track of all available shader compilers.

Public

Methods

RegisterCompiler

void RegisterCompiler(const String &language, const SPtr<IShaderCompiler> &compiler)

Registers a new shader compiler for the provided language.

UnregisterCompiler

void UnregisterCompiler(const String &language)

Unregisters a shader compiler.

RegisterSearchPath

void RegisterSearchPath(const Path &folder)

Registers a path that will be used for looking for shader files.

Thread safe.

GetCompiler

SPtr<IShaderCompiler> GetCompiler(const String &language)

Returns the compiler for the specified language.

staticDetectActiveShadingLanguage

static ShadingLanguageFlag DetectActiveShadingLanguage()

Detects shading language supported by the current render backend.

staticParseShadingLanguage

static ShadingLanguageFlag ParseShadingLanguage(const String &name)

Converts a shading language name to a corresponding enum entry.

staticGetShadingLanguageName

static const char *GetShadingLanguageName(ShadingLanguageFlag language)

Returns the name of the provided shading language.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Fields

mCompilers

UnorderedMap<String, SPtr<IShaderCompiler>> mCompilers

mSearchPaths

Vector<Path> mSearchPaths

mSearchPathMutex

Mutex mSearchPathMutex