vlj / YAGF

Yet Another GL Framework
Other
15 stars 5 forks source link

Improper memory alignment. #3

Open mrgreywater opened 8 years ago

mrgreywater commented 8 years ago

Certain classes like SJoint have members that are required to be aligned by 16 Bytes for SSE (for matrix4 operations). They are however allocated with "new", which causes exceptions whenever you run into alignment issues.

SJoint should be therefore allocated with memalign/__aligned_malloc, not the default new as is the case here: https://github.com/vlj/YAGF/blob/da3a88b505afcfeec612448ea347de81c9e99294/include/Core/ISkinnedMesh.h#L1237

(Example exception caused by not properly aligned allocation: http://i.imgur.com/63AL48a.png)

edit: here is a simple fix (only tested the windows path)