1

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?

Daniel
  • 3,461
  • 8
  • 36
  • 55

2 Answers2

2

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

Ellis
  • 3,626
  • 19
  • 28
2

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.

Nathan Reed
  • 33,657
  • 3
  • 90
  • 114