Sign in to follow this  
Dragon_Strike

direct3d10 and multithreading

Recommended Posts

ive been trying to find some info on how one should do multithreading with direct3d10... without much success... right now ive got a main thread and a render thread... i send the HWND to the render thread from the main thread and create the direct3d device in the render thread... all calls to the direct3d api is done through the render thread... is this correct? do i need to do any synchronization with the HWND? right now it works fine... however ever since i went from single threaded to multithread the nvperfhud frame debugger has stopped working... the application simply crashes when i try to use the frame debugger...

Share this post


Link to post
Share on other sites
I think it would be better to keep all Direct3D stuff on the same thread as the message pump (ie. the thread that you're doing all your Win32 messages and windowing stuff on). The documentation warns that deadlock can occur if, for example, DXGI is on a different thread to the one that created the window.

Instead, consider having the renderer, windowing, messages, etc. on the main thread and game logic on a separate thread.

Share this post


Link to post
Share on other sites
i would like to have my message pump in a thread all by itself... soo ill have a win api thread/main thread, one render thread and one update thread...

i just foun thsi page when u mentioned DXGI

http://msdn.microsoft.com/en-us/library/cc627095(VS.85).aspx

they say its fine to have them on seperate threads as long as...

"To avoid this, never block the message pump. If a block is unavoidable, then all DXGI interaction should occur on the same thread as the message pump."

i dont block the message pump as far as i know.. soo it should be fine? what ar ethe cases whe a block is unavoidable?

EDIT: i forgot to mention that the problem with nvperfhudfwas because i blocked the message pump thread.. but it works well now... is there anything else ihave to think of?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this