Stream-Output Object

A stream-output object is a templated object that streams data out of the geometry-shader stage. Use the following syntax to declare a stream-output object.

inout StreamOutputObject<DataTypeName;



StreamOutputObject < DataType >   Name

The stream-output object (SO) declaration.

Stream-Output Object Types Description
PointStream A sequence of point primitives
LineStream A sequence of line primitives
TriangleStream A sequence of triangle primitives


DataType - Output data type; can be any HLSL data type. Must be surrounded by the angle brackets.

Name - Variable name; an ASCII string that uniquely identifies the object.


This is an example of a stream-output object declaration that streams out triangle primitives whose data is defined by the PS_CUBEMAP_IN structure. The geometry-shader is limited to generating 18 vertices.

    float4 Pos : SV_POSITION;     // Projection coord
    float2 Tex : TEXCOORD0;       // Texture coord
    uint RTIndex : SV_RenderTargetArrayIndex;

void main( inout TriangleStream<PS_CUBEMAP_IN> CubeMapStream, triangle PS_CUBEMAP_INT[3] )

This is a code snippet from the CubeMapGS Sample.

Stream-Output Object Methods

Use the following syntax to call stream-output-object methods.


The following methods are implemented.

Methods Description
Append Append output data to an existing stream.
RestartStrip End the current primitive strip and start a new primitive strip.


Minimum Shader Model

This object is supported in the following shader models.

Shader Model Supported
Shader Model 4 and higher shader models yes


Shader Model 4