• Advertisement

Archived

This topic is now archived and is closed to further replies.

DrawPrim or DrawIndexedPrim?

This topic is 6361 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 saw on nVidia''s website that DrawIndexedPrimitiveVB is faster than DrawPrimitiveVB on the geForce. I''ll accept that perhaps they''ve optimized their hardware, but it still seems like there''s going to be additional memory reads in the IndexedPrimitive call, thus adding overhead. Am I missing something? In the general case (not strictly geForce; I''m personally using a Voodoo3, and my programming partner uses a TNT2), which is faster? DrawIndexedPrimitiveVB or DrawPrimitiveVB? Does anyone have any data on this? Vyvyan

Share this post


Link to post
Share on other sites
Advertisement
Opinion from someone who doesn''t really know much 3D: I believe the Indexed calls, although they would use fewer reads, would be quicker for 2 other reasons:

1) The primitive is more likely to fit in the cache memory as it is smaller (an index to a vertex is smaller than a vertex), which will make those extra reads trivial.

2) The primitive will move up your PCI/AGP bus faster due to it being smaller: this means more primitives per second.

Note that these qualities will only be true if an indexed primitive would be smaller than a ''normal'' primitive of the same kind: this is going to be most likely where your vertices are shared across many triangles, for example on curved or skinned surfaces. At the other extreme, you may notice a small performance degradation on cubes, for example.

Share this post


Link to post
Share on other sites
Yeah, I guess you''ve pretty much got the following:
(each vert is at least 56 bytes)
1 Triangle:
In DP: 3 Verts = 168 bytes
In DIP: 3 Verts, 3 indices = 180 bytes

2 Triangles in a Strip (2 shared verts):
In DP: 6 Verts = 336 bytes
In DIP: 4 Verts, 6 indices = 248 bytes
Which is a savings of about 26%

3 Triangles (2 in a strip, one not):
In DP: 9 Verts = 504 bytes
In DIP: 7 Verts, 9 indices = 428 bytes
Savings of about 15%

So I guess it''s dependant on how many shared vertices there are.

Vyvyan

Share this post


Link to post
Share on other sites

  • Advertisement