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

Confusion around buffer sizes #1228

Closed
blgrossMS opened this issue Feb 1, 2018 · 3 comments
Closed

Confusion around buffer sizes #1228

blgrossMS opened this issue Feb 1, 2018 · 3 comments

Comments

@blgrossMS
Copy link

blgrossMS commented Feb 1, 2018

I am writing a GLB exporter for the UnityGLTF library: https://github.com/KhronosGroup/UnityGLTF

In doing this I have become confused as to what the max buffer size is. The GLB specification clearly states that it only deals in uint32's for all sizes of buffers and the glb itself: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#binary-gltf-layout

However, buffer size for referencing .bin's is less clear. The specification simply says "integer": https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-buffer

The UnityGLTF library interpreted this to mean int32, however from what I can tell from the JSON specification (http://ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf) and this GitHub thread (jqlang/jq#143) JSON does not actually specify how large the number field can be for integers (though it is usually interpreted to be int53 based on JavaScript's interpretation of Number).

The questions is:
Is the UnityGLTF library non-conformant in that it should accept buffers larger than int32 (either uint32, int53, or uint64)? Which would mean that GLB serialization would fail if given a buffer larger than uint32?

@DanHolbert
Copy link

It would be great to get clarification on this. Hopefully, the answer is at least uint32.

@lexaknyazev
Copy link
Member

I'd say that uint32 should be supported by all tools.
Given that buffer size can't be negative, why does UnityGLTF use signed type?

@blgrossMS
Copy link
Author

blgrossMS commented Feb 2, 2018

I'll change UnityGLTF to use uint32 as max buffer size. Thanks for the clarification.

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

No branches or pull requests

4 participants