

A DirectCompute application can run on CUDA hardware.īy using a compute pipeline we can still operate with Direct3D resources and we can use most of the texture features (e.g. Note: CUDA is both a hardware architecture and a programming language from NVIDIA. The compute pipeline was present since DirectX10 and the relative API goes under the name of DirectCompute (something aside from Direct3D).ĭirectCompute is an API from Microsoft but in the graphics scene we have other products like OpenCL from Khronos Group and CUDA from NVIDIA. To check a practical usage of compute shaders you can refer to my github repo FirstDX12Renderer by clicking here. This post takes a practical and fundamental approach to the use of Direct Compute in DirectX 12 by first describing the available tools and then going through a basic usage in code. In a game engine, compute shaders can be used to generate particles, physics, screen-space effects, deferred lighting and volumetric effects.

In science, every operation that involves the word "GPGPU" (General Purpose GPU) has some kind of compute shader usage in it: high performance computing, physics simulations, classification, image processing are just to scratch the surface among the multitude of use cases.

This ability to generically adapt to any type of calculus makes the compute pipeline really useful in many areas, not only for real-time applications, but also for many science-related computations. Its usages are multiple, but in general we can use the compute pipeline whenever we want to calculate something without the need of a rasterizer. Riccardo Loggini Compute Shaders in D3D12 Table of ContentsĬompute Shaders in D3D12 Why Talking About Compute Shadersĭirect Compute has been part of DirectX since version 10.
