Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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 TypesDescription
PointStreamA sequence of point primitives
LineStreamA sequence of line primitives
TriangleStreamA 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.

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 ModelSupported
Shader Model 4 and higher shader modelsyes


Related topics

Shader Model 4



© 2017 Microsoft