Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 997 Bytes

2020_08_29_d3d_debug_info.md

File metadata and controls

44 lines (34 loc) · 997 Bytes

Enabling Direct3D Debug Information (Direct3D 9)

D3D_DEBUG_INFO

  • 控制面板启用 d3d9 debug runtime
  • 利用 D3D_DEBUG_INFO,开启 debug information
  • WinXP、Win7 可用,Win8、Win10 不再支持 d3d9 debug runtime
#define D3D_DEBUG_INFO
#include <d3d9.h>
  • 可以获得很多信息
  • 使用 CreationCallStack 需要开启 "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Direct3D\D3D9Debugging\EnableCreationStack"
DECLARE_INTERFACE_(IDirect3DCubeTexture9, IDirect3DBaseTexture9)
{
    ...

    #ifdef D3D_DEBUG_INFO
    LPCWSTR Name;
    UINT Width;
    UINT Height;
    UINT Levels;
    DWORD Usage;
    D3DFORMAT Format;
    D3DPOOL Pool;
    DWORD Priority;
    DWORD LOD;
    D3DTEXTUREFILTERTYPE FilterType;
    UINT LockCount;
    LPCWSTR CreationCallStack;
    #endif
};

参考资料