Home -> IProgramNode -> SetConstantStateValue
Description
The SetConstantStateValue method defines a shader state value which the application guarantees will not be modified at any point under this IProgramNode. The use of constant state values can allow significant optimizations to be made to shader programs on some renderers.
Warning
If the application attempts to change a state value on a child IStateGroupNode or IRenderableNode which has had a constant state value set through SetConstantStateValue, the results are undefined. The new state value may be updated, or it might not, but in either case, no warnings or errors are likely to be raised for performance reasons. It is the responsibility of the application to ensure it does not attempt to override constant state values.
Usage
template<class T>
void SetConstantStateValue(StateValueId stateId, const T& value, size_t arrayIndex = 0);
Argument list
- value [StateValueId]
- The StateValueId of the target state variable
- value [T]
- The value to assign to the state variable
- arrayIndex [size_t]
- Specifies the index to use if the target state value is an array