<uniform> (//pfx/pipeline/uniform)

A <uniform> element defines a shader invocation-constant value

A <uniform> element defines a shader invocation-constant value. It may be unsupported on some implementations. Either this or the <buffer> element will be supported.

Typically, this will either be OpenGL ES default uniforms, or Vulkan style push-constants.

XML Attributes (<uniform> element)

ATTRIBUTE

Description

variable

(OPTIONAL) A variable name, as specified in the shader. This may be required by the implementation (OpenGL ES 2/3), or not supported at all.

If reflection is not supported, all uniforms will be regarded as tightly packed based on the std430 standard for layout.

semantic

References an application specific semantic. It will be used to select the data that will populate this uniform from the models that will be rendered by this pipeline or from the application.

scope

(OPTIONAL) A string describing the scope or the rate of update of this uniform.

Valid values:
  • effect (set once per effect)
  • pipeline (set once per pipeline)
  • model (set once per model)
  • node (set once per node)
  • batch (set once per batch).

dataType

The datatype of this uniform. See Datatypes.

apiVersion

(OPTIONAL) A string describing which API versions this element will be active for. If omitted, always active.