Skip to main content
GameDev.net gamedev.net
🔒 Locked

SlimDX - Async Loading problems

Started by KaiRohmer Sep 4, 2011 at 9:43 AM 3 replies 1.9k views
Original Post
KaiRohmer
KaiRohmer
Hi,
i'm working on a small framework for game prototypes.. i'm beginning with simple game state and level based games and want to draw something while loading the content of the next level..
i'm using slimdx, directx11 (no effects) and draw everything in the immediate context

the loading is done by a thread of the dotNet threadpool.. there i only load textures, create buffers and so on.. no draw calls and so on..

now the problem..
the game runs perfect while launching from visual studio (with attached debugger)..(F5)..
if i start the program without debugger (Ctrl + F5) or starting the exe.. the game crashes in one of 5 tries. but only when using my nvidia chip (M310) .. there is no crash with the build in intel graphics chip
and the biggest problem is.. i can't debug the crashed program.. select debug after the program freezes and the message pops up leads in to another crash and dump files can not be opened..

any ideas? thank you!
KaiRohmer
KaiRohmer

Sounds like a driver problem. Have you tried updating to the latest NVIDIA drivers?


yes i did..
and tried on another pc, too (geforce 9800gtx+).. same problem.. same behavior (with debugger fine.. without crash)..

i tried to load data not async (in the main thread) there is no problem..
then i wrote a log file to find out at which possition the crash happens... result: it's different.. means that a different number of resources are loaded until the crash.. so i think its no simple bug in my thread management
(all resources in the loading stage are loading by the same thread of the threadpool)
KaiRohmer
KaiRohmer
Hey.. i found some time to work on this project again..
today i rebuild my taskmanagement to be sure to create no deadlocks or make other mistake like miss an exception..
then i ran some loading tests ..to finally see.. the problem is still there.. (now i got the same while starting from visual studio, too.. what i count as a win)..

after that.. i was able to create a dump file and load it again in visual studio to find out where my threads were at the crash.. and surprise:

main thread:
Result res = _SwapChain.Present(_VerticalSync ? 1 : 0, PresentFlags.None);

worker thread:
Effect loaded = new Effect(_Device, byteCode);

Has anybody an idea why that happens?
Thanks a lot!!
KaiRohmer
KaiRohmer
Found the problem
.. stupid mistake.. i found an ImmediateContext-Call in the loading code.. in my case this was update of an constant buffer (map/unmap)...
don't update constant buffers in property setters to sync your data.. ;)

buy the way.. what helped me to find out was the DirectX Control Panel, were you can add you application to scope and force debug layer to get real exceptions instead of crashes without infos...

thanks for all who tried to help me!!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.