Later this year the era of mainstream general purpose computing on graphics processing units (GPGPU) will finally begin with the release of DirectX 11 compute shaders as well as OpenCL application programming interfaces (APIs). In the computer graphics world DirectX is by far more popular than OpenGL due to many reasons. But what will happen with the GPGPU implementations and which API will be the more popular?
According to Neil Trevett, the president of the Khronos Group and a vice president at Nvidia Corp., OpenCL has numerous advantages over DirectX compute shaders. In particular, traditionally OpenGL, and now OpenCL, enabled pretty close access to the silicon capability of graphics processors, which potentially means higher performance. Moreover, OpenCL does not require usage of OpenGL and its compatibility is not limited to Windows operating system.
“It is interesting to compare and contrast DirectX compute shaders with OpenCL. The approach we’ve taken with OpenCL is that you don't have to use OpenCL with OpenGL obviously if you were using compute in a visual application. […] OpenCL is a very robust compute solution rather than compute within the context of the graphics pipeline, which is more the approach that DirectX 11 compute shaders have taken,” said Mr. Trevett in an interview with Tech Report web-site.
Mr. Trevett claims that DirectX compute shaders are generally “super shaders” that are still a part of the graphics pipeline. As a result, those are more difficult to use, claims the head of competing API developer.
“OpenCL is a standalone, complete compute solution you can use for protein folding and particle analysis never touching the pixel, and you have the option of inter-opping it very closely with OpenGL, so you can use it for image processing and feeding into and feeding out of the OpenCL pipeline. The approach that DirectX 11 Compute takes is ‘super shaders’, which are like general-purpose C shaders. But those shaders exist within the context of the DX graphics pipeline, so it's intended to soup up your graphics applications but you'd probably find it more difficult to write, you know, a general-purpose animation package,” claimed Mr. Trevett.
It is interesting to note that Microsoft Corp. claims that compute shaders – a new programmable shader stage in DirectX 11 – is independent of the graphics pipeline.