#include <shaderconstant.h>
Public Attributes | |
std::string | mName |
Property: 'Name' The name of the specialization constant variable in the shader interface. More... | |
uint | mValue = 0 |
Property: 'Value' The value to overwrite the default specialization constant variable with. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Shader constant resource. Assigns an unsigned integer constant to a material.
Shaders are parsed on initialization, but not actually compiled until creation of a graphics pipeline. Shader constants implement Vulkan specialization constants and are a powerful way to compile specialized versions of shaders per material instance. Graphics and compute pipeline keys are distinguished by a shader constant hash that is generated from the material instance resource. This way you can benefit from compiler optimizations like loop unrolling and branch elimination per material setup.
std::string mName |
Property: 'Name' The name of the specialization constant variable in the shader interface.
uint mValue = 0 |
Property: 'Value' The value to overwrite the default specialization constant variable with.