Jump to content
  • Advertisement
Sign in to follow this  
JohnnyCode

OpenGL vertex alignment effect

This topic is 2027 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

On opengl webpage, it was mentioned that vertex attributes should be occpupying 4 bytes multiple, in the very bound buffer data, and if they don't they should be aligned this way in buffer. I have a vertex size of 32 bytes, but one attribute occupies 3 bytes.

 

I have this question- wheather vertex attribute alignment speeds up vertex buffer binding, or it speeds up drawing the buffer as well. I plan on making this 3 byte attribute 4 byte, and have the 4th component manifest other information, but I wonder wheather it will be the gain in drawing, or only in binding. 

Share this post


Link to post
Share on other sites
Advertisement

It will be padded to 4 bytes. So if your attribute is 3 byte or 4 bytes, it will perform the same probably. The issue would be if the driver didn't pad the attributes at all. If you're using OpenGL, remember it when you're messing with uniform blocks or shader storage, padding rules still apply and can alter your offsets.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!