question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessors with of 1-byte data are not aligned

See original GitHub issue

Each vertex must be aligned, i.e., buffer view for such accessors must have stride of 4.

Mesh_PrimitiveAttribute\Mesh_PrimitiveAttribute_01.gltf
    /meshes/0/primitives/0/attributes/TEXCOORD_0: Vertex attribute data must be aligned to 4-byte boundaries.

Mesh_PrimitiveVertexColor\Mesh_PrimitiveVertexColor_01.gltf
    /meshes/0/primitives/0/attributes/COLOR_0: Vertex attribute data must be aligned to 4-byte boundaries.

Mesh_PrimitiveVertexColor\Mesh_PrimitiveVertexColor_02.gltf
    /meshes/0/primitives/0/attributes/COLOR_0: Vertex attribute data must be aligned to 4-byte boundaries.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lexaknyazevcommented, Mar 17, 2018

What performance and compatibility reasons?

Some GPUs (mostly mobile) may refuse to load unaligned data, it may lead to a runtime failure or in-driver data realignment.

0reactions
kcoleycommented, Mar 20, 2018

Should be resolved for the above models now. Thanks for flagging @lexaknyazev !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Alignment Across Architectures: The Good, The Bad ...
Alignment depends on byte order. Casting happens all the time in C behind the scenes, which is pretty bad for a language that...
Read more >
How to allocate aligned memory only using the standard ...
No free() required. This is typically two instructions: subtract 1024 from the stack pointer, then AND the stack pointer with -alignment.
Read more >
Data Alignment
Data alignment means that the address of a data can be evenly divisible by 1, 2, 4, or 8. In other words, data...
Read more >
Structure Member Alignment, Padding and Data Packing
A variable's data alignment deals with the way the data is stored in ... We need 1-byte padding after the char member to...
Read more >
3.5. Aligning a Struct with or without Padding
A proper struct alignment means that the alignment can be evenly divided by the struct size. Important: Ensure a 4-byte alignment for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found