DirectX SDK |
The D3DDEVINFO_TEXTUREMANAGER type contains information about the current state of the texture manager. This structure is used with the Direct3DDevice7.GetInfo method.
Type D3DDEVINFO_TEXTUREMANAGER bThrashing As Boolean lLastPri As Long lNumEvicts As Long lNumTexturesUsed As Long lNumUsedTexInVid As Long lNumVidCreates As Long lTotalBytes As Long lTotalManaged As Long lWorkingSet As Long lWorkingSetBytes As Long End Type
You can use the values in the lNumUsedTexInVid and lNumTexturesUsed to determine the percentage of textures used during the last frame were resident in video memory (local or non-local). The following code fragment shows how to make this computation:
' For this example, the d3dtminfo variable is a D3DDEVINFO_TEXTUREMANAGER ' structure that has been filled by a call to Direct3DDevice7.GetInfo. Dim lHitRate As Long ' Retrieve the percentage of textures used that were in video memory. lHitRate = (d3dtminfo.lNumUsedTexInVid * 100) / d3dtminfo.lNumTexturesUsed