struct ShaderDataParameterInformation

Describes a single data (int, Vector2, etc.) shader parameter.

Public

Constructors

ShaderDataParameterInformation

ShaderDataParameterInformation() = default

ShaderDataParameterInformation

ShaderDataParameterInformation(String name, String gpuVariableName, GpuDataParameterType type, StringID rendererSemantic = StringID::kNone, u32 arraySize = 1, u32 elementSize = 0)

Fields

Type

The type of the parameter, must be the same as the type in GpuProgram.

ArraySize

u32 ArraySize

If the parameter is an array, the number of elements in the array.

Size of 1 means its not an array.

ElementSize

u32 ElementSize

Size of an individual element in the array, in bytes.

You only need to set this if you are setting variable length parameters, like structs. Otherwise the size is determined from the type.

Name

String Name

The name of the parameter.

Name must be unique between all data and object parameters in a shader.

GpuVariableName

String GpuVariableName

Name of the GPU variable in the GpuProgram that the parameter corresponds with.

RendererSemantic

StringID RendererSemantic

Optional semantic that allows you to specify the use of this parameter in the renderer.

The actual value of the semantic depends on the current Renderer and its supported list of semantics. Elements with renderer semantics should not be updated by the user, and will be updated by the renderer. These semantics will also be used to determine if a shader is compatible with a specific renderer or not. Value of 0 signifies the parameter is not used by the renderer.

DefaultValueIndex

u32 DefaultValueIndex

Index of the default value inside the Shader.

Should not be set externally by the user.

AttributeIndex

u32 AttributeIndex

Index to a set of optional attributes attached to the parameter.

Should not be set externally by the user.