Jump to content

  • Log In with Google      Sign In   
  • Create Account


Performance difference btw tri-list and indexed tris.


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
6 replies to this topic

#1 cephalo   Members   -  Reputation: 539

Like
0Likes
Like

Posted 24 April 2014 - 12:16 PM

I have a small primitive I am going to instance. I could use an index buffer, but the memory footprint is going to be extremely small either way. However, I am going to draw this object many times per frame. Does it matter at all if I use an ordered triangle list or an indexed triangle list?



Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3339

Like
1Likes
Like

Posted 24 April 2014 - 12:46 PM

Probably not.



#3 kalle_h   Members   -  Reputation: 1340

Like
2Likes
Like

Posted 24 April 2014 - 01:27 PM

Always use indices its very rare that you don't share any vertices. This way you allow gpu to use post vertex shader cache.



#4 mhagain   Crossbones+   -  Reputation: 7821

Like
3Likes
Like

Posted 24 April 2014 - 03:07 PM

Always use indices its very rare that you don't share any vertices. This way you allow gpu to use post vertex shader cache.

 

For the small number of vertices the OP is talking about (I'm guessing quads in a particle system?) it's highly unlikely to make any difference.  The bottleneck will be elsewhere.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#5 phantom   Moderators   -  Reputation: 7072

Like
6Likes
Like

Posted 24 April 2014 - 04:19 PM

For the small number of vertices the OP is talking about (I'm guessing quads in a particle system?) it's highly unlikely to make any difference.  The bottleneck will be elsewhere.


Basically, this.

In the general case a triangle list with indices in strip order will perform just as well, if not better, than tri-strips (if only because you can batch more together without having to care about shoving in degenerate triangles or primitive restart indices) BUT for small sizes, such as a quad in the form of two triangles you'll save memory foot print, bandwidth and cache by providing it as a tri-strip.

(The latter two are the two biggest killers of performance today; bandwidth might be large but you can run out quick, same deal with cache. Also keep in mind that vertex fetch is no longer a fixed operation, it is done in the ALU of the hardware via a normal memory fetch.)

#6 kalle_h   Members   -  Reputation: 1340

Like
0Likes
Like

Posted 24 April 2014 - 05:07 PM

Because I am optimizing my particle system now as well I will be going to test this tomorrow.



#7 phantom   Moderators   -  Reputation: 7072

Like
5Likes
Like

Posted 25 April 2014 - 08:00 AM

So, while waiting for data to build I was watching this http://gdcvault.com/play/1020624/Advanced-Visual-Effects-with-DirectX

And there is a bit where they cover particle systems using the vertex shader to expand a quad up.

The TL;DW (too long, didn't watch) version is that for particles;
- don't have a vertex buffer, use vertex id to index into an SRV to get your data
- do an indexed draw - this is slightly faster than an non-index draw (0.52 vs 0.77 (AMD), 0.87 (NV))
- don't instance - apparently draw instance for small meshes is REALLY slow like 0.52 vs 5.1 on a NV Titan for 500k slow. (or 1.5 vs 10.3 for 1M!. AMD; 0.52 v 1.77 and 1.02 vs 3.54); instead fill an index buffer and use that to draw things as a tri-list
- Don't use the Geo-shaders... just... don't. Ever.

Edited by phantom, 25 April 2014 - 10:46 AM.





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