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

> ## Name

> cgSetMultiDimArraySize - sets the size of a resizable multi-dimensional array parameter

> ## Synopsis

>     #include <Cg/cg.h>

>     void cgSetMultiDimArraySize( CGparameter param,
>                                  const int * sizes );

> ## Parameters

> param
>   The array parameter handle.
> sizes
>   An array of sizes for each dimension of the array.

> ## Return Values

> None.

> ## Description

> cgSetMultiDimArraySize sets the size of each dimension of resizable multi-dimensional array parameter param. sizes must be an array that has N number of elements where N is equal to the result of cgGetArrayDimension.

> ## Examples

> If you have Cg program with a parameter like this :

>     /* ... */

>     float4 main(float4 myarray[][][])
>     {
>       /* ... */
>     }

> You can set the sizes of each dimension of the myarray array parameter like so :

>     const int sizes[] = { 3, 2, 4 };
>     CGparameter myArrayParam =
>       cgGetNamedProgramParameter(program, CG_PROGRAM, "myarray");

>     cgSetMultiDimArraySize(myArrayParam, sizes);

> ## Errors

> CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

> CG_ARRAY_PARAM_ERROR is generated if param is not an array parameter.

> CG_INVALID_POINTER_ERROR is generated if sizes is NULL.

> CG_INVALID_PARAMETER_ERROR is generated if any value in sizes is less than or equal to 0.

> CG_PARAMETER_IS_NOT_RESIZABLE_ARRAY_ERROR is generated if param is not a resizable array.

> ## History

> cgSetMultiDimArraySize was introduced in Cg 1.2.

> ## See Also

> cgGetArraySize, cgGetArrayDimension, cgSetArraySize