Compute Shader

Revision as of 16:34, 26 August 2012 by Alfonse (Talk | contribs) (Start on the compute shader article.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.