Portal:OpenGL Shading Language/Compute Shader

From OpenGL Wiki
< Portal:OpenGL Shading Language
Revision as of 02:55, 25 July 2018 by Alfonse (talk | contribs) (Clarification.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Compute Shader is the shader stage for doing arbitrary computations. It uses an execution model based on groups of shader invocations which can share data. The invocations within these "work groups" can inter-communicate reasonably freely, with relatively minimal overhead. The compute shader determines how many invocations go into each work group, though the maximum number is limited.

Compute shaders are not invoked by rendering operations. They are instead started by calling a special dispatch function. Each execution of a compute shader will run the given number of work groups.

While compute shaders could in theory take the place of rendering, this is not a practical use for them.