Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Vertex Buffer to 4 Bytes #51376

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

The-O-King
Copy link
Contributor

With the octahedral compression, we had attributes of a size of 2 bytes
which potentially caused performance regressions on iOS/Mac

Now add padding to the normal/tangent buffer

For octahedral, normal will always be oct32 encoded
UNLESS tangent exists and is also compressed
then both will be oct16 encoded and packed into a vec4<GL_BYTE>
attribute

With the octahedral compression, we had attributes of a size of 2 bytes
which potentially caused performance regressions on iOS/Mac

Now add padding to the normal/tangent buffer

For octahedral, normal will always be oct32 encoded
UNLESS tangent exists and is also compressed
then both will be oct16 encoded and packed into a vec4<GL_BYTE>
attribute
@The-O-King The-O-King requested a review from a team as a code owner August 7, 2021 19:43
@Calinou Calinou added this to the 3.4 milestone Aug 7, 2021
@The-O-King
Copy link
Contributor Author

CC @clayjohn @RevoluPowered made some updates to make sure the bytes we have are used as efficiently as possible and created the PR!

just wondering if the logic might be confusing for those who want to vertex data to the buffers directly?

@RevoluPowered
Copy link
Contributor

Sweet I will check this out tonight

@RevoluPowered
Copy link
Contributor

Checking the PR out now :) sorry work was keeping me busy

@RevoluPowered
Copy link
Contributor

RevoluPowered commented Aug 12, 2021

Performance is great, no reported issues! Tried with both indexing settings, no visual bugs

Copy link
Contributor

@RevoluPowered RevoluPowered left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested: Regressions with performance gone :)

@akien-mga akien-mga merged commit 9e3e7b0 into godotengine:3.x Aug 12, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants