CUGL 4.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cugl::graphics::UniformDef Class Reference

#include <CUGraphicsBase.h>

Public Member Functions

 UniformDef ()
 
 UniformDef (const UniformDef &def)
 
UniformDefoperator= (const UniformDef &def)
 

Public Attributes

GLSLType type
 
ShaderStage stage
 
Sint32 location
 
size_t size
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UniformDef() [1/2]

cugl::graphics::UniformDef::UniformDef ( )

Creates a default uniform definition.

◆ UniformDef() [2/2]

cugl::graphics::UniformDef::UniformDef ( const UniformDef def)

Creates a copy of the given uniform definition

Parameters
defThe uniform definition to copy

Member Function Documentation

◆ operator=()

UniformDef & cugl::graphics::UniformDef::operator= ( const UniformDef def)

Assigns this object to be a copy of the given uniform definition.

Parameters
defThe uniform definition to copy
Returns
a reference to this object for chaining

Member Data Documentation

◆ location

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

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.

◆ stage

ShaderStage cugl::graphics::UniformDef::stage

The shader stage where this uniform is located

◆ type

GLSLType cugl::graphics::UniformDef::type

The GLSL type of this uniform


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