Skip to content

Conversation

ggcrunchy
Copy link
Contributor

This one-liner is, I hope, the fix for this issue.


The new stuff in 3713 introduced custom vertex formats. These meant you could no longer always jump right into the geometry data, and thus need a "correction": fVertexOffset - fOffsetCorrection, in Renderer::CheckAndInsertDrawCommand().

The "stored on GPU" path would still want essentially the old behavior, since its buffers only have data for themselves, but the correction snippet was still being used, but never zeroing out that value: it's either whatever it last was or (as in the link) some uninitialized garbage. In the latter case that happens to be a negative value and thus produce that WebGL error.


This was a general bug—I believe I did see it in my tests, when indexed meshes were involved (the only source of "stored on GPU" buffers in most builds), but it "went away" (probably when I reordered some objects) and I falsely assumed something had fixed it. The web beta stores all objects on GPU, so the problem couldn't help but show up.

@ggcrunchy ggcrunchy requested a review from Shchvova as a code owner February 17, 2025 00:36
@Shchvova Shchvova merged commit b1bdaaf into coronalabs:master Feb 21, 2025
1 check 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