|
|
|
|
|
by magicalhippo
5 days ago
|
|
> So all malloc implementations have a minimum alignment guarantee. Typically 16 bytes these days on x86 Fun story. Back in the early 2000s, my Delphi OpenGL program randomly crashed when I tried to use vertex buffers. I spent a lot of time checking this and that, before I realized it might be an alignment issue. Sure enough, Delphi memory allocator at the time only provided 4-byte alignment, while NVIDIA's drivers used aligned SSE instructions which require 16-byte alignment. So, had to manually align the buffers before passing them to OpenGL. |
|