Multithreading in Direct X

Started by
-1 comments, last by JoCCo 18 years, 8 months ago
Hey Im currently using two threads in my engine (one main render thread and a worker thread to do the loading). This all works quite nicely when running DirectX with retail runtimes. But as soon as I switch over to Debug runtimes I see some strange Errors from DirectX, it varys what it complains about ( sometimes its stream sizes that are changed from when they were declerated and sometimes it fails with BeginScene (or EndScene) because its doing Macro recording, and finally sometimes it complains about the index stream having too few indices. Normally I would think that this is a pointer running crazy and messing things up ( I generally have a this pointer of 0x0000001 - 0x000020 when it crashes ) but have tried most of the things I could comeup with to locate the pointer and I just can't find it so then I had an idea. Is the DirectX device so multi thread sensitve that I can't Render with it while loading other meshes ( I'm not sharing any variables or anything so it won't try to render things that I'm currently loading). The fact that it complains about issuing BeginScene while doing Macro recording sort of confuses me since that would suggest doing something on the worker thread that distrubs the render thread... Am I totally wrong in my thinking and should continue searching for a crazy pointer or do I need to do some sort of Critical Section for my Device (perhaps have several devices, one for each thread). I'm currently creating my device with Multithread support so I figure it should work to use in both threads...

This topic is closed to new replies.

Advertisement