Skip to main content
GameDev.net gamedev.net
🔒 Locked

limit on maxvertexcount() GS

Started by ultrapingu Apr 18, 2011 at 3:30 PM 0 replies 5.6k views
Original Post
ultrapingu
ultrapingu
Hi guys, I'm just wondering what it is that controls the maximum number of vertex the geometry shader can output?

I know it's something like the size of some output register divided by the stride of the output vertex. I saw in this post:
http://www.gamedev.net/topic/495265-maxvertexcount12---whats-this/ that there is a limit of 1024 bytes, however my vertex has a stride of 40 bytes and the code will compile up to outputting 113 vertex per triangle, which is at least 4520 bytes (providing the compiler isn't padding my vertex to 48 bytes). Ideally I need to output 183 vertex per triangle.

I know this is a ridiculous amount to output, but its for a paper that I'm writing as I'm just proving the theory of applying a current technique to the geometry shader. What I want to know is, what is the register where the output goes to (when its just sent straight to the pixel shader), is the size API dependant or device dependant, and where I can find the size (can I find it in DX capabilities) as I want to produce a size-time chart to show a predicted growth.

Thanks for your help.

-A
Jason Z
Jason Z
The limit is definitely part of the specification, and the limit is based on the number of scalar values in the output structure. The total number of scalar values can't exceed 1024, so that would probably account for your discrepancy in byte count...

Have you considered using geometry shader instancing? Assuming you are using D3D11 hardware, you can simply execute multiple copies of the geometry shader for each primitive. Then you can process one half of your data in one instance and the other half in the second instance - you would then just need to use the SV_GSInstanceID system value semantic in the shader to select the proper subset of data to produce. You can have up to 32 instances created for each primitive, so you could effectively up the limit to 1024*32.
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.