Skip to content

Fix bufferStorage bitfield #20

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

Merged

Conversation

DialecticalMaterialist
Copy link
Contributor

The current packed struct is wrong, it was implemented in the order which the flags are described in the OpenGL Spec. This is not how the bits are laid out in memory though, in fact if you were to write true to map_write with this implementation it would through a GL_INVALID_VALUE error since the function does not allow setting any bits besides the defined ones. This commit fixes the bitfield to have the correct order and padding aswell as providing their offsets as a comment and a small description of what each flag does.

The current packed struct is wrong, it was implemented in the order
which the flags are described in the OpenGL Spec. This is not how the
bits are laid out in memory though, in fact if you were to write true to
map_write with this implementation it would through a GL_INVALID_VALUE
error since the function does not allow setting any bits besides the
defined ones. This commit fixes the bitfield to have the correct order
and padding aswell as providing their offsets as a comment and a small
description of what each flag does.
Copy link
Member

@hazeycode hazeycode left a comment

Choose a reason for hiding this comment

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

Thanks!

@hazeycode hazeycode merged commit 33ae578 into zig-gamedev:main Aug 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants