![]() |
CUGL 4.0
Cornell University Game Library
|
#include <CUGraphicsBase.h>
Public Member Functions | |
| UniformDef () | |
| UniformDef (const UniformDef &def) | |
| UniformDef & | operator= (const UniformDef &def) |
Public Attributes | |
| GLSLType | type |
| ShaderStage | stage |
| Sint32 | location |
| size_t | size |
This class represents a shader uniform variable.
The meaning of a uniform depends on the graphics API being used. In OpenGL a uniform includes any shader uniform that is not attached to a uniform buffer (buffers are handled separately). In Vulkan, a uniform refers to a push constant or a specialization constant.
Uniforms must be declared before the shader is compiled. The shader will validate the GLSL code against declared uniforms. Note that not all GLSL types are supported on all platforms.
| cugl::graphics::UniformDef::UniformDef | ( | ) |
Creates a default uniform definition.
| cugl::graphics::UniformDef::UniformDef | ( | const UniformDef & | def | ) |
Creates a copy of the given uniform definition
| def | The uniform definition to copy |
| UniformDef & cugl::graphics::UniformDef::operator= | ( | const UniformDef & | def | ) |
Assigns this object to be a copy of the given uniform definition.
| def | The uniform definition to copy |
| Sint32 cugl::graphics::UniformDef::location |
The uniform location
In OpenGL, setting this value to -1 causes the shader to determine this location automatically. In Vulkan, this value is used to sort the push constants so that we can determine their range.
| size_t cugl::graphics::UniformDef::size |
The size of this uniform.
This value is necessary for type GLSLType#BLOCK. This value will be computed for all other types.
| ShaderStage cugl::graphics::UniformDef::stage |
The shader stage where this uniform is located
| GLSLType cugl::graphics::UniformDef::type |
The GLSL type of this uniform