cgGetNamedStateAssignment
Keywords: cgGetNamedStateAssignment, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgGetNamedStateAssignment - get a pass state assignment by name

> ## Synopsis

>     #include <Cg/cg.h>

>     CGstateassignment cgGetNamedStateAssignment( CGpass pass,
>                                                  const char * name );

> ## Parameters

> pass
>   The pass from which to retrieve the state assignment.
> name
>   The name of the state assignment to retrieve.

> ## Return Values

> Returns the named state assignment from the pass.

> Returns NULL if the pass has no state assignment corresponding to name.

> ## Description

> The state assignments of a pass can be retrieved directly by name using cgGetNamedStateAssignment. The names of the state assignments in a pass can be discovered by iterating through the pass's state assignments (see cgGetFirstStateAssignment and cgGetNextStateAssignment), calling cgGetStateAssignmentState then cgGetStateName for each one in turn.

> ## Examples

> to-be-written

> ## Errors

> CG_INVALID_PASS_HANDLE_ERROR is generated if pass is not a valid pass.

> ## History

> cgGetNamedStateAssignment was introduced in Cg 1.4.

> ## See Also

> cgIsStateAssignment, cgGetFirstStateAssignment, cgGetNextStateAssignment, cgGetStateAssignmentState, cgGetStateName