Export (0) Print
Expand All

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;

 

Parameters

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.

Example

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.


struct PS_CUBEMAP_IN
{
    float4 Pos : SV_POSITION;     // Projection coord
    float2 Tex : TEXCOORD0;       // Texture coord
    uint RTIndex : SV_RenderTargetArrayIndex;
};

[maxvertexcount(18)]
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.



Object.Method


The following methods are implemented.

MethodsDescription
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

 

 

Community Additions

ADD
Show:
© 2015 Microsoft