What it does

A Geometry Shader is a GPU stage that can output points, lines, or triangles from incoming primitives. Its role differs from a Fragment Shader's color calculations, and it requires platform support.

Figure: Conceptual relationship: Input primitives → Emit output primitives → Send to later stages
Figure: Conceptual relationship: Input primitives → Emit output primitives → Send to later stages

How to use it

A geometry shader takes primitives after vertex processing and emits primitives on supported APIs. It differs from compute and tessellation, with platform-specific availability.

A concrete example

Expanding points into cards is one example, but prebuilt geometry or instancing can achieve similar output. Selecting this stage does not guarantee higher throughput.

How to check it

  1. Test small input/output counts and orientation, then compile and measure on the target Player.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data
  2. Check supportsGeometryShaders where relevant and plan unsupported-device alternatives.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data

Limitations

It is unavailable on Metal and many mobile paths; consider instancing or compute alternatives.

References