Exception thrown (in debug pane) when exiting fullscreen

Started by
15 comments, last by vinterberg 8 years, 6 months ago
Unfortunately its not in the clean up. I got my program to quit out to windows right after the device and swapchain are created. Obviously this causes a leak, which VS reports. But, I am still getting the exceptions and still only in fullscreen mode.

I did read recently that hard coding the refresh rate isn't a good thing and will cause exceptions in FS mode. Even though my display says it is 60hz, it might really be 59.95hz or something. So, I'll throw in some proper auto-detection and report back smile.png
Advertisement

It seems like you forget to set SwapEffect, thus it defaults to 0 which is DXGI_SWAP_EFFECT_DISCARD.

This flag is valid for a swap chain with more than one back buffer, although, applications only have read and write access to buffer 0.

And you only got 1 backbuffer ("swapChainDesc.BufferCount = 1;") ..

Maybe this is the cause? blink.png

.:vinterberg:.

It seems like you forget to set SwapEffect, thus it defaults to 0 which is DXGI_SWAP_EFFECT_DISCARD.


How can you tell that from what I have posted? DXGI_SWAP_EFFECT_DISCARD is a Present() parameter.

The exceptions happen at the 'create device' stage. Even though create device reports that all went well.
I added code to correctly query the refresh rate and it is in fact 59.978 Hz.

I have corrected the swapchain creation process to detect the users refresh rate rather than to hard code it. So, that side of things is more robust.

However the exceptions still remain. I'll keep plugging away until this is sorted smile.png

How can you tell that from what I have posted? DXGI_SWAP_EFFECT_DISCARD is a Present() parameter.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb173075%28v=vs.85%29.aspx

The "DXGI_SWAP_CHAIN_DESC swapChainDesc;" should have a SwapEffect Member...?

Edit: And you still need more than one backbuffer for that flag...

.:vinterberg:.

Right you are. smile.png

I now have triple buffering and have tried all of the SWAP_EFFECT_* flags, but still the same result, unfortunately.

That's strange indeed, haven't been able to find any similiar problem by searching - this is worthy of Holmes :D

.:vinterberg:.

This topic is closed to new replies.

Advertisement