DX11中提供vs和ps后的又一支持直接gpu计算的Compute Shader,可以看得出物理加速不再是只属于n卡,而且gpu通用计算的道路会越发成熟,下面做下标记,下次翻译
// from DX11 SDK and gamedev
Compute shaders are basically the same as any other shader ... pixel shader for example. Just like the pixel shader is envoked for each pixel, the compute shader is envoked for each
"thread". A thread is a generic and independent execution entity that doesn't really require any sort of geometry.
All you have to do now is to dispatch a number of threads, and your shader will be executed for each of these threads.
In DirectX, these threads are organized into "groups". You have X * Y * Z threads in each group, and U * V * W thread groups in your application.
Threads are organized into groups for synchornization purposes.
The number of groups are specified during dispatch time, and the number of threads in each group are hardcoded in the compute shader.
The compute shaders actually don't ou