Jump to content
  • Advertisement
Sign in to follow this  
programmer_tom

dx9 multithreaded

This topic is 4326 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 does anyone know a lot about multithreading in dx9? i've written a simple threaded loading screen that renders while a scene loads on the main thread. works fine (most of the time). i created a multithreaded device....wondering if there are restrictions on using threads to do directx calls. do i need to make the file loader the thread and the main app thread does the rendering? there is no object creation going on inside the graphics thread, so it's not that it's reading/writing without mutex locks. just once in a while, weird things go down after the loading like terrain geometry comes out all messed up etc. thanks -programmer_tom

Share this post


Link to post
Share on other sites
Advertisement
The Forum Search (Well, Google search :P) brings up a lot of relevant threads. There's been 2 or 3 threads about it in the past couple of months too, having a look through the last two months or so of posts in this forum might be useful too.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I have a thread load assets while the screen shows one of those "Loading... " progress bars. No problems with multi-threading here. The DX docs say that locking is done internally.

Share this post


Link to post
Share on other sites
So long as you call IDirect3DDevice9::Reset, IDirect3D9::CreateDevice, IDirect3DDevice9::TestCooperativeLevel, or the final Release of IDirect3DDevice9 from only the thread that handles your window messages (Probably the main thread). There shouldn't be any problems in locking vertex buffers from different threads, so long as your own application is aware of when context switches can occur (E.g. you don't free a buffer that's being copied into a vertex buffer from another thread), you should be safe.

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!