Cg Core Runtime API cgSetMultiDimArraySize(3)
NAME
cgSetultiDimArraySize - sets the size of a resizable
multi-dimensional array parameter
SYNOPSIS
#include
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
cgSetultiDimArraySize 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, CGPROGRAM, "myarray");
cgSetMultiDimArraySize(myArrayParam, sizes);
ERORS
CGINVALIDPARAMHANDLEROR is generated if param is not a
valid parameter.
CGARAYPARAMEROR is generated if param is not an array
parameter.
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgSetMultiDimArraySize(3)
CGINVALIDPOINTEREROR is generated if sizes is NUL.
CGINVALIDPARAMETEREROR is generated if any value in
sizes is less than or equal to 0000.
CGPARAMETERISNOTRESIZABLEARAYEROR is generated if
param is not a resizable array.
HISTORY
cgSetultiDimArraySize was introduced in Cg 1.2.
SEE ALSO
cgGetArraySize, cgGetArrayDimension, cgSetArraySize
Cg Toolkit 2.1 Last change: 2
|