• Advertisement
Sign in to follow this  

[dx10] passing parameters to geometry shader

This topic is 3873 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a few techniques, which need to pass parameters do the geometry shader to modify how many iterations of a loop is occuring. This also effects the number of output tris i tried this:
[maxvertexcount(18)]
void GS(triangle GSIn IN[3], inout TriangleStream<PSIn> outStream, const int numTargets)
{
for (int f = 0; f < numTargets; ++f)
    {
:


technique10 Render1
{
	pass Pass0
	{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(CompileShader(gs_4_0, GS(1)));
        SetPixelShader(CompileShader(ps_4_0, PS()));
    }
}

technique10 Render2
{
	pass Pass0
	{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(CompileShader(gs_4_0, GS(2)));
        SetPixelShader(CompileShader(ps_4_0, PS()));
    }
}


but it fails to compile, saying: error X3013: 'GS': function does not take 1 parameter is there a special way to indicate such information for the GS?

Share this post


Link to post
Share on other sites
Advertisement
I'm not at my D3D10 devbox right now, but have you tried using 'uniform int numTargets' instead of 'const int numTargets'?

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement