mikegi
22-Feb-2009, 01:23
I'm trying to understand how incorporate GPGPU functionality into my regular Direct3D programs. Right now all my main computational tasks are implemented as background threads in C++. I'd like to move some of those background computational tasks to the GPU for speed. I don't fully understand how to partition the D3D stuff:
1) Should I create a second Direct3D device for the GPGPU thread? Since the main D3D device is used extensively for rendering in Windows, I don't believe I can use it simultaneously in the background without complicating the rendering code tremendously and/or causing stuttering in the UI.
2) What's the easiest way to a create a "windowless" D3D device? The GPGPU thread will be used exclusively for computation and will not display anything.
3) Will creating a second device cause stuttering in my main UI when the GPGPU thread is busy crunching numbers? I guess I'm wondering how well D3D handles thread switching in a multithreaded program.
I'd appreciate hearing anyone's thoughts and experience doing such a thing.
Thanks
1) Should I create a second Direct3D device for the GPGPU thread? Since the main D3D device is used extensively for rendering in Windows, I don't believe I can use it simultaneously in the background without complicating the rendering code tremendously and/or causing stuttering in the UI.
2) What's the easiest way to a create a "windowless" D3D device? The GPGPU thread will be used exclusively for computation and will not display anything.
3) Will creating a second device cause stuttering in my main UI when the GPGPU thread is busy crunching numbers? I guess I'm wondering how well D3D handles thread switching in a multithreaded program.
I'd appreciate hearing anyone's thoughts and experience doing such a thing.
Thanks