![]() |
CUGL 4.0
Cornell University Game Library
|
#include <CUGraphicsBase.h>
Public Member Functions | |
| ResourceDef () | |
| ResourceDef (const ResourceDef &def) | |
| ResourceDef & | operator= (const ResourceDef &def) |
Public Attributes | |
| ShaderStage | stage |
| ResourceType | type |
| Sint32 | set |
| Sint32 | location |
| Uint32 | arraysize |
| bool | unbounded |
| size_t | blocksize |
This class represents a shader resource variable.
Resources are any value attached to a shader that cannot be represented as GLSL primitive type. These primarily include textures and uniform buffers. However, in the case of Vulkan, there is a wider array of types supported. See ResourceType for the supported types.
| cugl::graphics::ResourceDef::ResourceDef | ( | ) |
Creates a default resource definition.
| cugl::graphics::ResourceDef::ResourceDef | ( | const ResourceDef & | def | ) |
Creates a copy of the given resource definition
| def | The resource definition to copy |
| ResourceDef & cugl::graphics::ResourceDef::operator= | ( | const ResourceDef & | def | ) |
Assigns this object to be a copy of the given resource definition.
| def | The resource definition to copy |
| Uint32 cugl::graphics::ResourceDef::arraysize |
The number of elements to attach to this resource.
This value defines the size of a texture or buffer array in a GLSL shader. It is only supported by Vulkan. OpenGL will ignore this value.
| size_t cugl::graphics::ResourceDef::blocksize |
The blocksize of this resource.
This value is only relevant for dynamic uniform and storage buffers. It is ignored for all other resources.
| Sint32 cugl::graphics::ResourceDef::location |
The resource location
In OpenGL, setting this value to -1 causes the shader to determine this location automatically. In Vulkan, this value is the binding location in the relevant descriptor set.
| Sint32 cugl::graphics::ResourceDef::set |
The descriptor set for this resource
Descriptor sets are Vulkan only. This should be set to -1 for OpenGL.
| ShaderStage cugl::graphics::ResourceDef::stage |
The shader stage where this resource is located
| ResourceType cugl::graphics::ResourceDef::type |
The resource type
| bool cugl::graphics::ResourceDef::unbounded |
Whether to make this resource an unbounded array.
If this value is true, then the value arraysize will be replaced with the device maximum. This can only be applied to the last resource in a set. For all other resources, arraysize will be preserved.
This feature is only supported by Vulkan, and not all versions of Vulkan support it. The Vulkan version must be 1.2 or greater, or support the descriptor indexing extension.