0
\$\begingroup\$

Some people claim that floats should be used for rendering vertices in modern graphics cards, because graphics cards are optimized for floating-point arithmetic and therefore, integer calculations are often emulated. I would think that most graphics cards have ALUs, and therefore, an efficient way to process integer vertices. So, are floats actually faster than integers on modern graphics cards?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ What particular performance are you asking about? Where are you using these types? In your shader, in your vertex inputs, in textures, in framebuffer images, what? \$\endgroup\$ Nov 4 '17 at 21:41
  • \$\begingroup\$ Why do you assume that vertex processing is a primary arbiter of performance? You're far more likely to bottleneck on fillrate and ROP, particularly with ES devices (per your tags). \$\endgroup\$ Nov 21 '17 at 18:26
  • 1
    \$\begingroup\$ If that's an actual quote, please cite the source so people attempting to answer have the correct context. If it's not an actual quote, don't make it look like one. \$\endgroup\$
    – Pikalek
    Nov 21 '17 at 19:41
  • \$\begingroup\$ @Pikalek It's not an actual quote. \$\endgroup\$
    – Cpp plus 1
    Nov 21 '17 at 19:48
2
\$\begingroup\$

There's a very nice throughput table here

If you take a look at the rows containing the throughput of 32 bit integers and floats, you'll see, that the float throughput is either higher (in case of the compute capabilities between 3.0 and 3.7) or exactly same (3.7+). This means, that depending on the GPU, integers are either worse or the exact same.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Note that this only applies to NVIDIA hardware. \$\endgroup\$ Nov 22 '17 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.