Jump to content
  • Advertisement
Sign in to follow this  
JoCCo

Multithreading in Direct X

This topic is 4843 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

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...

Share this post


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