Question

Is it possible to create multiple instances of ID3DXRenderToSurface and have them rendering in parallel in threads? It seems unlikely, but as certain aspects of DirectX are still somewhat boggling to me I figured I'd ask.

It's no big deal if it can't be done. It's just that the application I'm working on (unfortunately) splits its object rendering into groups which are rendered to surfaces and then the completed surfaces are rendered to the back-buffer. I just figured it'd be nice if I could have all the groups render in parallel rather than serially if possible.

Was it helpful?

Solution

This interface just allows you rendering to a designated surface instead of back buffer. In order to render anything you still need to set states of D3D device and call its methods. Device interface in not thread safe in D3D9. So, the answer is "No, you cannot render in multiple threads going this way". You probably can create several devices, draw portions there and then combine resulted images on a single device but I doubt this will give much benefits (if will work at all).

If you look for multi-threaded rendering try using DX11.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top