Name

cgSetParameterVariability - set a parameter's variability

Synopsis

#include <Cg/cg.h>

void cgSetParameterVariability( CGparameter param,
                                CGenum vary );

Parameters

param
The parameter.
vary
The variability to which param will be set.

Return Values

None.

Description

cgSetParameterVariability allows the application to change the variability of a parameter.

Currently parameters may not be changed to or from CG_VARYING variability. Also, the variability of uniform buffer parameters and their member parameters may not be changed. However, other parameters of CG_UNIFORM or CG_LITERAL variability may be changed.

Valid values for vary include :

CG_UNIFORM
A uniform parameter is one whose value does not change with each invocation of a program, but whose value can change between groups of program invocations.
CG_LITERAL
A literal parameter is folded out at compile time. Making a uniform parameter literal will often make a program more efficient at the expense of requiring a compile every time the value is set.
CG_DEFAULT
By default, the variability of a parameter will be overridden by the a source parameter connected to it unless it is changed with cgSetParameterVariability. If it is set to CG_DEFAULT it will restore the default state of assuming the source parameters variability.

Examples

to-be-written

Errors

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

CG_INVALID_ENUMERANT_ERROR is generated if vary is not CG_UNIFORM, CG_LITERAL, or CG_DEFAULT.

CG_INVALID_PARAMETER_VARIABILITY_ERROR is generated if the parameter could not be changed to the variability indicated by vary.

CG_INVALID_PARAMETER_TYPE_ERROR is generated if vary is CG_LITERAL and param is not a numeric parameter, or if param is a uniform buffer or a member of a uniform buffer.

History

cgSetParameterVariability was introduced in Cg 1.2.

See Also

cgGetParameterVariability