Jump to content

  • Log In with Google      Sign In   
  • Create Account


DrawPrim or DrawIndexedPrim?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 VyvyanBasterd   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 August 2000 - 02:03 PM

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

Sponsor:

#2 Kylotan   Moderators   -  Reputation: 3333

Like
Likes
Like

Posted 21 August 2000 - 11:38 PM

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.


#3 VyvyanBasterd   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 August 2000 - 05:00 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS