In geometry shader, I want to output about 108 vertices from 3 vertices (a triangle), and each output vertex has 12 scalar values. For example
struct VS_OUTPUT
{
float4 Pos;
float2 TextureUV;
float3 Normal;
float3 Data;
};
The problem is I cannot output all vertices because of the limitation of geometry shader output which does not allow output more than 1024 registers. Is there possible to use 2 instances of a geometry shader to solve this problem such as the first instance outputs the half of data and the second one outputs the other half?. I have searched on the internet, but there is nothing and have tried it but it does not work.
For example
[maxvertexcount(108]
[instance(2)]
GS_OUTPUT GS(triangle VS_OUTPUT input[3], inout TriangleStream<GS_OUTPUT> Output,
uint InstanceID : SV_GSInstanceID)
{
GS_OUTPUT vertex;
if (InstanceID == 0)
{
vertex.Pos = ....
vertex.TextureUV = ........
}
else // InstanceID = 1
{
vertex.Normal = ....
vertex.Data = .....
}
// Output data
}