Sign in to follow this  
janta

[DX10] Single threaded device

Recommended Posts

Hello Countrary to d3d9, a d3d10 device is thread safe by default. One may create a single threaded, thread-unsafe device using the D3D10_CREATE_DEVICE_SINGLETHREADED flag. Deciding to use or not to use this flag has MAJOR impact on an engine design (especially in the resource managing part: what thread creates d3d objects, what thread uses them, etc.) - One the one hand, I *think* a single threaded device would be significantly faster (at least it was the case with d3d9) but I have no evidence of this - On the other hand, designing an engine where the renderer thread also acts as an asynchronous d3d resource creation thread is significantly more difficult than just leaving that to one single "main" thread. Quick-testing this may have no point because real performance problems usually arise when the engine is performing in large scale, which is more than several month after a first functionnal release is done, and I need to finish the design beforehand :P (kinda like the chicken and the egg problem...) I know that eventually It's gonna be a first decision based on my personal faith, but any input would be appreciated ! [smile]

Share this post


Link to post
Share on other sites
As I understand things, the main thing that the multithread-protection layer does is to wrap all D3D calls in a critical section. All it's trying to do is to prevent two calls on the device from happing simultaneously.

Critical sections are fast, so I don't think you'll get much of a performance gain from turning the layer off. Besides, the buffer-oriented nature of D3D10 compared to D3D9 means you'll be making fewer API calls anyway - instead of calling SetRenderState repeatedly you'll just submit a pre-built state block.

Share this post


Link to post
Share on other sites
Yes, I agree with you.

In addition, if the default behaviour (mutithreaded mode) wouldnt offer appropriate performance I guess Microsoft would have done things the other way. That's gonna be my main "argument" until I get something better.

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