kmGetFreeTextureMem

Obtains the available texture memory space.


KMSTATUS KMAPI
kmGetFreeTextureMem(
OUT PKMUINT32 pSizeOfTexture,
OUT PKMUINT32 pMaxBlockSizeOfTexture
)

Description:

This function returns the unused capacity of the texture memory.
The texture memory is managed in block units. If it is repeatedly allocated and released, the texture memory is divided into many blocks. This API can check the total size (pSizeOfTexture) of all the vacant blocks of texture memory and the size of the largest vacant block (pMaxBlockSizeOfTexture).

Even if the total size of the vacant blocks is sufficient, if the size of the largest vacant block is not sufficient, KMSTATUS_NOT_ENOUGH_MEMORY (insufficient memory) is returned when a texture surface is allocated (kmCreateTextureSurface, kmCreateCombinedTextureSurface, or kmCreateContiguousTextureSurface).

To use the texture memory efficiently, secure and release as many texture surfaces as possible.

Parameters:

pSizeOfTexture(output)
This parameter is a pointer to the KMDWORD area to which the available texture memory space is returned.

pMaxBlockSizeOfTexture(output)
This parameter is a pointer to the KMDWORD area to which the largest vacant block in the texture memory is to be returned.

Return values:

ValueExplanation
KMSTATUS_SUCCESS Success

  kmGetFreeTextureMem