SetDepthStencilSurface() in Debug Version

Started by
4 comments, last by shaq1106 16 years, 4 months ago
Hi. First, my simple code is here. LPDIRECT3DSURFACE9 pOldTarget, pOldDepth; lpD3DDev->GetRenderTarget( 0, &pOldTarget ); lpD3DDev->GetDepthStencilSurface( &pOldDepth ); lpD3DDev->SetRenderTarget( 0, NewTarget ); lpD3DDev->SetDepthStencilSurface( NewDepthStencil ); lpD3DDev->Clear( 0L, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, 0, 1.0f, 0L ); // Rendering to New Target(Texture)... lpD3DDev->SetDepthStencilSurface( pOldDepth ); lpD3DDev->SetRenderTarget( 0, pOldTarget ); pOldDepth->Release(); pOldTarget->Release(); // Rendering to Main Target... This code is no problem when Direct3D is under Retail Version. But when I switched it to Debug Version in DirectX Control Panel, Nothing Rendered to Main Target like all Z-Buffer is zero. Then... if I render something to Main Target with switch-off z-buffer or Call "lpD3DDev->Clear()" again just before rendering to Main Target, And also when DepthStencil buffer is created bigger than window size. ((ex) window size = 1024 * 768, DepthStencil Size = 1024 * 1024.) Everything is fine, even if under Debug Version. What happen to Debug Version? (My Graphic card is GeForce 8600GT) please help me~~.
Advertisement
Something is failing. What does the debug output say?
Direct3D9: :====> ENTER: DLLMAIN(0123e6e0): Process Attach: 00000a54, tid=00000b70
Direct3D9: :====> EXIT: DLLMAIN(0123e6e0): Process Attach: 00000a54
Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE

Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE
Direct3D9: (INFO) :======================= Hal HWVP device selected

Direct3D9: (INFO) :HalDevice Driver style 9

Direct3D9: :DoneExclusiveMode
D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.58456e+029f. This is ok.
D3DX: Unicode support: 1

This is what I've got.
I see some (WARN). but I don't know what I should do for fixing it.
And also what D3D9 Helper warning...
Is the warning related to my problem?

Thanks.
D3D or nVidia drivers, I'm not sure which, seem to have problems with the debug libraries when the depth surface (or texture for nVidia shadow maps) is larger than the surface used to create the device. How it breaks even varies depending on how it's launched, with different but consistant behaviour between hitting F5, Ctrl-F5, or doubleclicking the exe. In some case it takes a few Resets to fail, sometimes right away.

I made a dead simple buggy app using the nVidia depth texture variety of the bug, a year or two ago and submitted it to the DirectX team. nVidia's developer relations people never reply to emails or fix any bugs I report, so I didn't bother to submit a report to them. The DX team refused to look at it as it wouldn't run on ATI hardware. I didn't push Microsoft any further for a fix, and as far as I know, they never put in the 10 minutes required to isolate the problem.

It's a long standing bug that many people have noticed... and nobody wants to look into it until you can prove it's definately their fault first.
And as for what the debug spew means:
Quote:Original post by shaq1106
Direct3D9: :====> ENTER: DLLMAIN(0123e6e0): Process Attach: 00000a54, tid=00000b70
Direct3D9: :====> EXIT: DLLMAIN(0123e6e0): Process Attach: 00000a54
Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
D3D has started up using the debug runtimes


Quote:Original post by shaq1106
Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE
Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE
You're calling GetDeviceCaps(nAdapter, D3DDEVTYPE_SW, &caps); somewhere, and there's no software device registered.

Quote:Original post by shaq1106
Direct3D9: (INFO) :======================= Hal HWVP device selected
You created a D3DDEVTYPE_HAL device with hardware vertex processing

Quote:Original post by shaq1106
Direct3D9: (INFO) :HalDevice Driver style 9
This driver is a DX9 driver

Quote:Original post by shaq1106
Direct3D9: :DoneExclusiveMode
Internal D3D spew - D3D takes exclusive control of the graphics card while creating the device so you can't change graphics mode while it's in mid-setup. This message is just D3D saying that it's finished with exclusive mode.

Quote:Original post by shaq1106
D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.58456e+029f. This is ok.
A default render state is the wrong value - this happens on NVidia cards for some reason.

Quote:Original post by shaq1106
D3DX: Unicode support: 1
D3DX supports unicode

Do you get any other errors or warnings after that? Can you post the full output for one run of the app (Init and shutdown, not just init)?
Direct3D9: :====> ENTER: DLLMAIN(0123e6e0): Process Attach: 00000ca0, tid=00000c9c
Direct3D9: :====> EXIT: DLLMAIN(0123e6e0): Process Attach: 00000ca0
Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE

Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE
Direct3D9: (INFO) :======================= Hal HWVP Pure device selected

Direct3D9: (INFO) :HalDevice Driver style 9

Direct3D9: :DoneExclusiveMode
D3DX: Unicode support: 1

The thread 'Win32 Thread' (0x620) has exited with code 0 (0x0).


Direct3D9: :====> ENTER: DLLMAIN(0123e6e0): Process Detach 00000ca0, tid=00000c9c
Direct3D9: (INFO) :MemFini!
Direct3D9: :====> EXIT: DLLMAIN(0123e6e0): Process Detach 00000ca0
The program '[3232] Casting.exe: Native' has exited with code 0 (0x0).

This is all I've got.
I updated newest driver version from NVidia. But same problem.
problem occurs uder debug version only.

This topic is closed to new replies.

Advertisement