Debug issues [Solved]

Started by
10 comments, last by TWild 17 years, 9 months ago
I decided I'd enable D3D debugging in the DirectX control panel and now when I run my engine, my CheckDeviceType and CreateDevice calls are returning FAILED. It works fine in Retail. I am using an ATI X600, Windows Vista, DirectX9. Any ideas why this could be happening?

if(FAILED(m_pD3D->CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3ddm.Format, d3ddm.Format, TRUE)))
	{
         ...
	}

if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hWnd,
		D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &m_pD3DDevice))){
	        ...
		}




[Edited by - TWild on July 3, 2006 5:55:29 PM]
---------------------My specs (because I always forget to post them)Intel P4 2.4 GHz640 MB system memoryRadeon 9700 PROWindows XPDirectX 9DirectX 8.1 SDK
Advertisement
Not a darn clue, but DX may. Try this:

// ...#include <dxerr9.h>#include <sstream>using std::ostringstream;#include <iostream>using std::cout;using std::endl;// ie: for SetRenderStateif(FAILED(d3d_ret_code = device->SetRenderState(D3DRS_FOGENABLE, FALSE))){	ostringstream last_error;	last_error << "Render() - SetRenderState() failure: D3DRS_FOGENABLE.\n\nError code: " << DXGetErrorString9(d3d_ret_code) << "\nError description: " << DXGetErrorDescription9(d3d_ret_code);	cout << last_error.str() << endl;}// ...



Also, there are ways to compile with the Debug version of DX. Google for debug D3D app win32 or something similar.
If functions fail under the debug runtimes you should get an explanatory message in the "Output" view of Visual Studio - it should give the error code and what it doesn't like (e.g. which parameter is bad). Are you getting any output?

Bare in mind that 'retail' runtimes pass a lot of config through to the driver, so you rely on the driver doing checks. Sometimes they do, or worse, they're a little "loose" on requirements and will interpret what you want and magically make it work even if the params are technically wrong. Enabling the debug runtimes will cause D3D to do checks, so if it sees something that doesn't look right it'll throw an error - even if the driver might accept it.

I forget the details, but this happens a lot with one of the shadow mapping methods/formats.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by taby
Not a darn clue, but DX may. Try this:

*** Source Snippet Removed ***


Also, there are ways to compile with the Debug version of DX. Google for debug D3D app win32 or something similar.


I'm getting:

Error Code: D3DERR_NOTAVAILABLE
Error Description: Not Available





JollyJeffers, this is from my debug output window:
'J402 Engine.exe': Loaded 'D:\Documents and Settings\WILD\My Documents\Visual Studio Projects\J402 Engine\Debug\J402 Engine.exe', Symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\ntdll.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\kernel32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\winmm.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\msvcrt.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\user32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\gdi32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\advapi32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\ole32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\oleaut32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\oleacc.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\msvcp60.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\d3d9.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\version.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\d3d8thk.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\d3dx9_30.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\dinput8.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\imm32.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\msctf.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\lpk.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\usp10.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\uxtheme.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\d3d9d.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\dwmapi.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\atiumdag.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\atiumdva.dll', No symbols loaded.'J402 Engine.exe': Unloaded 'C:\Windows\System32\atiumdva.dll''J402 Engine.exe': Unloaded 'C:\Windows\System32\atiumdag.dll'D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO'J402 Engine.exe': Loaded 'C:\Windows\System32\atiumdag.dll', No symbols loaded.'J402 Engine.exe': Loaded 'C:\Windows\System32\atiumdva.dll', No symbols loaded.'J402 Engine.exe': Unloaded 'C:\Windows\System32\atiumdva.dll''J402 Engine.exe': Unloaded 'C:\Windows\System32\atiumdag.dll'
---------------------My specs (because I always forget to post them)Intel P4 2.4 GHz640 MB system memoryRadeon 9700 PROWindows XPDirectX 9DirectX 8.1 SDK
I dont have an example to hand, but if you've got the debug runtimes enabled then you should be getting a lot more output than that. You'll get messages with "D3D (WARN)" or "D3D (INFO)" (for example) prefixed to them....

You say you're using Vista... I dont see why it wouldn't work there, but as a beta OS it could be worth running it on an XP system if available.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by jollyjeffers
I dont have an example to hand, but if you've got the debug runtimes enabled then you should be getting a lot more output than that. You'll get messages with "D3D (WARN)" or "D3D (INFO)" (for example) prefixed to them....

You say you're using Vista... I dont see why it wouldn't work there, but as a beta OS it could be worth running it on an XP system if available.

hth
Jack


I have come to the conclusion that it is indeed because of Vista. Debug worked in XP. Thanks for the help guys.
---------------------My specs (because I always forget to post them)Intel P4 2.4 GHz640 MB system memoryRadeon 9700 PROWindows XPDirectX 9DirectX 8.1 SDK
I think Beta 2 support was only added in the most recent SDK. Which one are you using?
Sirob Yes.» - status: Work-O-Rama.
Quote:Original post by sirob
I think Beta 2 support was only added in the most recent SDK. Which one are you using?
Unless you (or anyone else) has information to the contrary I think it was just the D3D10 CTP that was updated for the Beta-2 build. I don't think DX9 has been modified for Vista...

Then again I can't try it out myself, and still have 35-40hrs to wait until RC1 appears [sad]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by jollyjeffers
Quote:Original post by sirob
I think Beta 2 support was only added in the most recent SDK. Which one are you using?
Unless you (or anyone else) has information to the contrary I think it was just the D3D10 CTP that was updated for the Beta-2 build. I don't think DX9 has been modified for Vista...

Then again I can't try it out myself, and still have 35-40hrs to wait until RC1 appears [sad]

Jack


You're dead on as always. Sorry about causing any confusion :).
Sirob Yes.» - status: Work-O-Rama.
Quote:Original post by sirob
Quote:Original post by jollyjeffers
Quote:Original post by sirob
I think Beta 2 support was only added in the most recent SDK. Which one are you using?
Unless you (or anyone else) has information to the contrary I think it was just the D3D10 CTP that was updated for the Beta-2 build. I don't think DX9 has been modified for Vista...

Then again I can't try it out myself, and still have 35-40hrs to wait until RC1 appears [sad]

Jack


You're dead on as always. Sorry about causing any confusion :).
Well I wasn't 100% sure as I can't get Vista to run so I'm still on an older SDK [smile]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement