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

> ## Name

> cgGetParameterResourceSize - get size of resource associated with a parameter

> ## Synopsis

>     #include <Cg/cg.h>

>     long cgGetParameterResourceSize( CGparameter param );

> ## Parameters

> param
>   The parameter for which the associated resource size will be retrieved.

> ## Return Values

> Returns the size on the GPU of the resource associated with param.

> Returns -1 if an error occurs.

> ## Description

> cgGetParameterResourceSize returns the size in bytes of the resource corresponding to a parameter if the parameter belongs to a Cg buffer resource.

> The size of sampler parameters is zero because they have no actual data storage.

> The size of an array parameter is the size of an array element parameter times the length of the array.

> The size of a structure parameter is the sum of the size of all the members of the structure plus zero or more bytes of profile-dependent padding.

> ## Examples

> to-be-written

> ## Errors

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

> ## History

> cgGetParameterResourceSize was introduced in Cg 2.0.

> ## See Also

> cgGetParameterBufferOffset, cgGetParameterBufferIndex