Nebula
|
#include <shaderserverbase.h>
The ShaderServer loads all shaders when created, meaning all shaders in the project must be valid and hardware compatible when starting.
A shader only contains an applicable program, but to apply uniform values such as textures and transforms a ShaderState is required.
ShaderStates can be created directly from the shader, however it is recommended to through the shader server. Creating a shader state means that the shader state contains its own setup of values, which when committed will be actually applied within the shader program.
The shader server can also create shared states, which just returns a unique state containing the variable groups, and will modify the same shader state if any variable is applied to it.
Inherits Core::RefCounted.
Inherited by Vulkan::VkShaderServer.
Public Member Functions | |
ShaderServerBase () | |
constructor | |
virtual | ~ShaderServerBase () |
destructor | |
bool | Open () |
open the shader server | |
void | Close () |
close the shader server | |
bool | IsOpen () const |
return true if the shader server is open | |
bool | HasShader (const Resources::ResourceName &resId) const |
return true if a shader exists | |
const Util::Dictionary< Resources::ResourceName, Resources::ResourceId > & | GetAllShaders () const |
get all loaded shaders | |
const CoreGraphics::ShaderId | GetShader (Resources::ResourceName resId) const |
get shader by name | |
void | ResetFeatureBits () |
reset the current feature bits | |
void | SetFeatureBits (CoreGraphics::ShaderFeature::Mask m) |
set shader feature by bit mask | |
void | ClearFeatureBits (CoreGraphics::ShaderFeature::Mask m) |
clear shader feature by bit mask | |
CoreGraphics::ShaderFeature::Mask | GetFeatureBits () const |
get the current feature mask | |
CoreGraphics::ShaderFeature::Mask | FeatureStringToMask (const Util::String &str) |
convert a shader feature string into a feature bit mask | |
Util::String | FeatureMaskToString (CoreGraphics::ShaderFeature::Mask mask) |
convert shader feature bit mask into string | |
void | LoadShader (const Resources::ResourceName &shdName) |
explicitly loads a shader by resource id | |
void | BeforeFrame () |
update shader server outside of frame | |
Public Member Functions inherited from Core::RefCounted | |
RefCounted () | |
constructor | |
int | GetRefCount () const |
get the current refcount | |
void | AddRef () |
increment refcount by one | |
void | Release () |
decrement refcount and destroy object if refcount is zero | |
bool | IsInstanceOf (const Rtti &rtti) const |
return true if this object is instance of given class | |
bool | IsInstanceOf (const Util::String &className) const |
return true if this object is instance of given class by string | |
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
return true if this object is instance of given class by fourcc | |
bool | IsA (const Rtti &rtti) const |
return true if this object is instance of given class, or a derived class | |
bool | IsA (const Util::String &rttiName) const |
return true if this object is instance of given class, or a derived class, by string | |
bool | IsA (const Util::FourCC &rttiFourCC) const |
return true if this object is instance of given class, or a derived class, by fourcc | |
const Util::String & | GetClassName () const |
get the class name | |
Util::FourCC | GetClassFourCC () const |
get the class FourCC code | |
Private Member Functions | |
__DeclareClass (ShaderServerBase) | |
__DeclareSingleton (ShaderServerBase) | |
Friends | |
class | CoreGraphics::ShaderIdentifier |
class | ShaderBase |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::RefCounted | |
static void | DumpRefCountingLeaks () |
dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
virtual | ~RefCounted () |
destructor (called when refcount reaches zero) | |
Base::ShaderServerBase::ShaderServerBase | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
void Base::ShaderServerBase::BeforeFrame | ( | ) |
update shader server outside of frame
|
inline |
clear shader feature by bit mask
void Base::ShaderServerBase::Close | ( | ) |
close the shader server
|
inline |
convert shader feature bit mask into string
|
inline |
convert a shader feature string into a feature bit mask
|
inline |
get all loaded shaders
|
inline |
get the current feature mask
|
inline |
get shader by name
|
inline |
return true if a shader exists
|
inline |
return true if the shader server is open
void Base::ShaderServerBase::LoadShader | ( | const Resources::ResourceName & | shdName | ) |
explicitly loads a shader by resource id
bool Base::ShaderServerBase::Open | ( | ) |
open the shader server
|
inline |
reset the current feature bits
|
inline |
set shader feature by bit mask
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |