Difference between revisions of "Compute Shader"

From OpenGL.org
Jump to: navigation, search
m (categorization)
m (categorization)
Line 8: Line 8:
[[Category:OpenGL Shading Language]]
[[Category:OpenGL Shading Language]]

Revision as of 17:15, 23 September 2012

A Compute Shader is a shader stage that is used entirely for computation.

These are special in that all other shaders have specific input and output information flow. Vertex shaders get their inputs from vertex attributes; geometry shaders get their input from vertex shaders and provide output to the rasterizer and/or transform feedback. And so on. These shaders can access Textures, Buffer Objects, and so forth via various means, but they also have these special purpose inputs and outputs.

Compute shaders do not. They have a very limited set of built-in inputs, which only define "where" in the computation this particular invocation of the shader is executing. They have no defined outputs. Thus, if they are to do something, they must do so through mechanisms like writing to images, employing Shader Storage Buffer Objects, and the like.