Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Setting GL_UNPACK_ALIGNMENT to 1

4: Adsense

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 gd_sequoia   Members   

99
Like
0Likes
Like

Posted 24 March 2012 - 06:04 AM

I've been uploading a texture (glTexSubImage2D) and getting skewed results for upload-buffer sizes that are not a multiple of 4 (I think). Setting GL_UNPACK_ALIGNMENT to 1 fixes that, but is it a good idea? Likely to get me bad performance on certain hw?

#2 swiftcoder   Senior Moderators   

18213
Like
0Likes
Like

Posted 24 March 2012 - 07:41 AM

Using a buffer size that isn't a multiple of 4 is liable to get you bad performance on quite a lot of hardware. I have one OpenGL application where the performance *doubles* when I add a dummy alpha-channel to pad my textures to 4 bytes/component...

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]





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.