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

Fix GL buffer upload size bugs #58085

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Feb 14, 2022

Wrapper functions for uploading buffers to OpenGL take all sizes and offsets in bytes. Some buffer sizes are specified as units (e.g. float) so require conversion to bytes when calling the buffer upload functions.

Two such bugs have been fixed in blendshapes, and parameter names and comments have been changed to emphasize that sizes should be in bytes.

In addition DEV_ASSERTS in the upload wrappers have been changed to ERR_FAIL.

Fixes upload size bug in #58078
Bug introduced in #51363

Notes

  • This is quite an easy mistake, as some Godot buffers are specified in bytes, and some in "units".
  • We could also consider renaming some of the buffer sizes to make this less likely to happen in future. Any ideas for having automated checks for this bug would be welcome.
  • There could be an argument for making the ERR_FAIL_CONDs DEV_ENABLED only, but only if profiling shows this to be a problem.

Wrapper functions for uploading buffers to OpenGL take all sizes and offsets in bytes. Some buffer sizes are specified as units (e.g. float) so require conversion to bytes when calling the buffer upload functions.

Two such bugs have been fixed in blendshapes, and parameter names and comments have been changed to emphasize that sizes should be in bytes.

In addition DEV_ASSERTS in the upload wrappers have been changed to ERR_FAIL.
@lawnjelly lawnjelly requested a review from a team as a code owner February 14, 2022 11:09
@akien-mga akien-mga added this to the 3.5 milestone Feb 14, 2022
@fire
Copy link
Member

fire commented Feb 14, 2022

Although it was found in the gltf exporter, it's not a gltf2 bug directly.

@akien-mga akien-mga merged commit 869939c into godotengine:3.x Feb 15, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.3.

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