Iscolating the cause of a Lost Device (Fixed)

Started by
11 comments, last by EnlightenedOne 14 years, 5 months ago
I recently setup the DX Debug mode. I got afew memory leaks in other thread and an unusual error about my display but this is by far the worst issue because it stops my program dead in its tracks. The error triggered is "Direct3D9: (ERROR) :Lost due to display uniqueness change" I changed the backbuffer size then run a lost device function I built with no good result. Right before it goes down it shows the change I set. Direct3D9: :WM_DISPLAYCHANGE: 1024x768x32 I traced the crash step by step as I went into fullscreen mode. All the conditions seemed to be changed fine I get into the reset device conditions and lose my devices from sprites and all then run this HRESULT hr = d3ddev->Reset(&d3dpp); This is the line where it dies smack bang on the device reset it works fine in windowed mode but I get this "lost due to display unqiueness change issue" when I switch to fullscreen modes that are not the same resolution as my current display (allthough they are compatible) and I have no idea why I am getting it in just windows 7 when it worked fine for Vista because it doesn't on the surface look like an error induced by a windows function. "hr" doesn't return a failure either DX is just giving me a breakpoint here im clueless as to the source of the issue. This is an issue I cannot really ignore when developing my program further so im spening time trying to figure it out. I can't strees enough that all my devices are released before the change in resolution and restored afterwards and the function works under different conditions. Without the diagnostic tool on I get no error just a blank screen with a mouse stretched to the resolution I intended over the entire screen rather than just a centered part of the screen with the correct resolution. If you feel you need more information say so I have no qualm with showing any more code on the issue. Thanks EO [Edited by - EnlightenedOne on October 28, 2009 6:33:16 PM]
Advertisement
I still have not made any progress... has no one else got this kind of trouble?
This is driving me insane. If I leave fullscreened mode after loosing the device I actually get the image back and can play the game why would I be able to do that after a Direct X throws an error why would I not be able to go to a resolution I know my screen can handle!

When the game changes to fullscreen.

Direct3D9: (WARN) :Cannot compute WNear and WFar from the supplied projection matrix

Direct3D9: (WARN) :Setting wNear to 0.0 and wFar to 1.0

Direct3D9: :Subclassing window 000e2d36
Direct3D9: :StartExclusiveMode
Direct3D9: :WM_DISPLAYCHANGE: 1024x768x32
Direct3D9: (ERROR) :Lost due to display uniqueness change
Direct3D9: (INFO) :Using FF to PS converter

Direct3D9: (INFO) :Using FF to VS converter in software vertex processing

D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.1342e-316f. This is ok.
Direct3D9: (WARN) :Cannot compute WNear and WFar from the supplied projection matrix

Direct3D9: (WARN) :Setting wNear to 0.0 and wFar to 1.0

D3D9 Helper: IDirect3DDevice9::Present failed: D3DERR_DEVICELOST

Device repeats failing afew times when I switch back I get this.

D3D9 Helper: IDirect3DDevice9::Present failed: D3DERR_DEVICELOST
Direct3D9: :WM_SIZE hWnd=E2D36 wp=0000, lp=02DA03F0 dwFlags=00000001
Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP
Direct3D9: :DoneExclusiveMode
Direct3D9: :INACTIVE: 00002140: Restoring original mode (1280x800x22x60) at adapter index 0
Direct3D9: :WM_DISPLAYCHANGE: 1280x800x32
Direct3D9: :Unsubclassing window 000e2d36
Direct3D9: (ERROR) :Lost due to display uniqueness change
Direct3D9: (INFO) :Using FF to PS converter

Direct3D9: (INFO) :Using FF to VS converter in software vertex processing

D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.1342e-316f. This is ok.
Direct3D9: :DoneExclusiveMode
Direct3D9: (INFO) :Using FF to PS converter

Direct3D9: (INFO) :Using FF to VS converter in software vertex processing

D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.1342e-316f. This is ok.
Direct3D9: :DoneExclusiveMode
Direct3D9: (INFO) :Using FF to PS converter

Direct3D9: (INFO) :Using FF to VS converter in software vertex processing

D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.1342e-316f. This is ok.
Direct3D9: (WARN) :Cannot compute WNear and WFar from the supplied projection matrix

Direct3D9: (WARN) :Setting wNear to 0.0 and wFar to 1.0

Then its back to normal. What is this exclusive mode setup here? Someone help me out please.
Is there a way you can iscolate what triggered the device to be lost?
Quote:Original post by EnlightenedOne
Is there a way you can iscolate what triggered the device to be lost?


Not that I am aware of, no. The OS is free to release your DX9 device whenever it feels like it. Generally this occurs when switching from a fullscreen app, minimizing a window, or under Vista, ctrl-alt-delete to that bluey/green menu screen.

As for your issue, it looks like it might possibly be either a driver or SDK bug:

http://www.gamedev.net/community/forums/topic.asp?topic_id=501868

A poster mentions a possible workaround in using IDirect3DDevice9Ex to create the dislay device, but I'm not sure if it will work in this case. Still, I guess there's no harm in trying! [smile]
Thanks for the feedback. The program in the post is crashing completely and I have switched everything between debug and retail versions without any difference its interesting tho. I looked at two arguments they brought up, the fact that the code works fine on vista and not on windows 7 could make it a driver issue. I dont know how to disable the windows desktop manager killing it in the taskmanager doesnt stop it coming back immediately. Its just so odd this issue only occurs when switching to a different resolution going to fullscreen mode any other lost device process is handled smoothly.

"FYI: One google answer mentions initiating full screen mode with a backbuffer size different than the screen resolution and a timing problem between disabling the desktop manager and setting the new screen mode."

"By any chance, are you going to full screen with a different resolution? If there's a timing problem, it may be due to the additional checking that's being done in Debug vs. Retail."

Im interested to see if I can disable this process to find out if it's the source of the problem. Im also curious to see if I can turn the process off and on again from inside my own program it sounds doubtfull. Im uncertain of what step to take if the error is not in my own code... any further thoughts?
The screen flashes pink and green sometimes when I go fullscreen to the same resolution, I have no idea why no buffer used is those colours...
It will allow me to go fullscreen in a different resolution to the one I am currently using provided that the resolution is bigger than or the same as the resolution in use. Thats got to be important here.
I'm going to move this to the DirectX forum.
A quick search on Google brings up This Page, which seems to indicate that it's a debug mode driver issue.

If it works with the retail runtimes and on other hardware (If you can test that), I'd be inclined to ignore it and blame it on a driver bug.

And the green / magenta background is a result of Present()ing a backbuffer which hasn't been cleared or filled with anything - the debug runtimes will fill the backbuffer with magenta and green on alternate frames when you use discard as your swap chain presentation method so you can catch possible errors. The solution is to Clear() the backbuffer, or not Present() it.

This topic is closed to new replies.

Advertisement