Jump to content
  • Advertisement
Sign in to follow this  
EnlightenedOne

Iscolating the cause of a Lost Device (Fixed)

This topic is 3247 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!