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

Correction to index buffer type in loadMeshBVH #5

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

santeripuranen
Copy link

Only unsigned integer types are supported for user-supplied meshes in QQuick3DGeometry, and make sense for index buffers in general. The pre-set signed indexBufferFormat was always used in the old code, since "attribute.componentType" (either uint32 or uint16) never matched any of the signed alternatives in the if-clauses. This appears to have worked fine with uint32 buffers, but caused crashes with uint16 (due to out-of-bounds accesses caused by bad casts downstream).

Only unsigned integer types are supported for user-supplied meshes in QQuick3DGeometry, and make sense for index buffers in general. The pre-set signed indexBufferFormat was always used in the old code, since "attribute.componentType" (either uint32 or uint16) never matched any of the signed alternatives in the if-clauses. This appears to have worked fine with uint32 buffers, but caused crashes with uint16 (due to out-of-bounds accesses caused by bad casts downstream).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant