Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Help: switching from float to unsigned short killed performance


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
1 reply to this topic

#1 HScottH   Members   -  Reputation: 516

Like
0Likes
Like

Posted 28 September 2013 - 02:04 PM

Hi all,

 

It's been a while since I've been here!

 

I am building a game engine.  My primary world geometry is fed to OpenGL using several arrays: coordinates, texture, etc.

 

My coordinates were simple [x,y,z] using GL_FLOAT, but to save space I decided to try GL_UNSIGNED_SHORT.

 

When I made that switch, my frame-rate dropped from ~150fps to ~40fps.

 

In retrospect, I realized I was feeding it six bytes per vertex, resulting in alignment problems so I changed the vertex data to [x,y,z,1], and got up to 80 fps.

 

But this is still just over 1/2 of what I was getting using GL_FLOAT.  Is there some secret here, or is the conversion in the GPU so expensive that it causes this issue?

 

Note: I am using shaders and none of the fixed-function pipeline.



Sponsor:

#2 HScottH   Members   -  Reputation: 516

Like
0Likes
Like

Posted 28 September 2013 - 03:21 PM

Redaction: I was mistaken. The frame rates are exactly the same.  It turns out that my frame rate flip-flops between the 80/150 number depending upon a random fluctuation in my game, and it just happened that several runs using FLOAT found the higher number, then several runs using SHORT found the lower one.

 

<whew> I was a bit concerned on this one :-)






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