mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
31 lines
883 B
HLSL
31 lines
883 B
HLSL
// Per-vertex data from the vertex shader.
|
|
struct GeometryShaderInput
|
|
{
|
|
min16float4 pos : SV_POSITION;
|
|
min16float3 color : COLOR0;
|
|
uint instId : TEXCOORD0;
|
|
};
|
|
|
|
// Per-vertex data passed to the rasterizer.
|
|
struct GeometryShaderOutput
|
|
{
|
|
min16float4 pos : SV_POSITION;
|
|
min16float3 color : COLOR0;
|
|
uint rtvId : SV_RenderTargetArrayIndex;
|
|
};
|
|
|
|
// This geometry shader is a pass-through that leaves the geometry unmodified
|
|
// and sets the render target array index.
|
|
[maxvertexcount(3)]
|
|
void main(triangle GeometryShaderInput input[3], inout TriangleStream<GeometryShaderOutput> outStream)
|
|
{
|
|
GeometryShaderOutput output;
|
|
[unroll(3)]
|
|
for (int i = 0; i < 3; ++i)
|
|
{
|
|
output.pos = input[i].pos;
|
|
output.color = input[i].color;
|
|
output.rtvId = input[i].instId;
|
|
outStream.Append(output);
|
|
}
|
|
}
|