Platform SDK: DirectX |
The D3DDEVINFO_TEXTUREMANAGER structure contains information about the current state of the texture manager. This structure is used with the IDirect3DDevice7::GetInfo method.
typedef struct _D3DDEVINFO_TEXTUREMANAGER { BOOL bThrashing; DWORD dwNumEvicts; DWORD dwNumVidCreates; DWORD dwNumTexturesUsed; DWORD dwNumUsedTexInVid; DWORD dwWorkingSet; DWORD dwWorkingSetBytes; DWORD dwTotalManaged; DWORD dwTotalBytes; DWORD dwLastPri; } D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
Use the values in dwNumUsedTexInVid and dwNumTexturesUsed to determine the percentage of textures used during the last frame that were resident in video memory (local or nonlocal). 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 IDirect3DDevice7::GetInfo. DWORD dwHitRate; // Retrieve the percentage of textures used that were in video memory. dwHitRate = (d3dtminfo.dwNumUsedTexInVid * 100) / d3dtminfo.dwNumTexturesUsed;