1
\$\begingroup\$

In my previous question, I asked about why people don't program on the GPU. Now I am learning about fluid dynamics with this article. They say that it should all be done on the GPU. The game engine that I use is Unity, and I know that shaders are run on the GPU. But is there any way to program (other than shaders) on the GPU?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Vertex and pixel shaders are the primary way that graphics programming on the GPU is done. However, more recent GPUs also support some technologies for more general-purpose parallel programming, such as CUDA (NVIDIA only), OpenCL, and most recently compute shaders (on DirectX 11 GPUs; google for more info about them). I don't think CUDA or OpenCL can effectively interchange data with the graphics pipeline, but compute shaders can.

\$\endgroup\$
2
  • \$\begingroup\$ What about PhysX? \$\endgroup\$
    – Daniel
    Commented Oct 10, 2011 at 20:47
  • \$\begingroup\$ PhysX can use the GPU, yes. But that's not really programming on the GPU, since the GPU stuff is already done for you by the PhysX developers. \$\endgroup\$ Commented Oct 10, 2011 at 21:17
2
\$\begingroup\$

Use Compute shaders (DirectX 11) or OpenCL on desktop systems.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .