Displaying DirectX Errors in the Debugger


Debugging DirectX calls that fail is a pain as the debugger cannot show the "nice" HRESULT codes as it does for COM errors (such as E_NOTIMPL). However you can tell the debugger about the custom error codes and add them to the [hresult] section of autoexp.dat. I went through the pain of hand calculating the (decimal!) values of these for the DX errors, so you don't have to. Here are the DX errors, remember to add them to the [hresult] section:

2289436696=D3DERR_WRONGTEXTUREFORMAT
2289436697=D3DERR_UNSUPPORTEDCOLOROPERATION
2289436698=D3DERR_UNSUPPORTEDCOLORARG
2289436699=D3DERR_UNSUPPORTEDALPHAOPERATION
2289436700=D3DERR_UNSUPPORTEDALPHAARG
2289436701=D3DERR_TOOMANYOPERATIONS
2289436702=D3DERR_CONFLICTINGTEXTUREFILTER
2289436703=D3DERR_UNSUPPORTEDFACTORVALUE
2289436705=D3DERR_CONFLICTINGRENDERSTATE
2289436706=D3DERR_UNSUPPORTEDTEXTUREFILTER
2289436710=D3DERR_CONFLICTINGTEXTUREPALETTE
2289436711=D3DERR_DRIVERINTERNALERROR

2289436774=D3DERR_NOTFOUND
2289436775=D3DERR_MOREDATA
2289436776=D3DERR_DEVICELOST
2289436777=D3DERR_DEVICENOTRESET
2289436778=D3DERR_NOTAVAILABLE
2289436779=D3DERR_INVALIDDEVICE
2289436780=D3DERR_INVALIDCALL
2289436781=D3DERR_DRIVERINVALIDCALL

2289435004=D3DERR_OUTOFVIDEOMEMORY
2289435164=D3DERR_WASSTILLDRAWING

This will work on Visual Studio 2005 for sure and 2003 probably - I can't remember when I added this feature. I would like to include a link to some documentation on this feature, but MSDN search sucks and I can't find it. It's there somewhere I am sure.

Comments (0)

Skip to main content