Skip to content

mesa/st: Allocate the gl_context with 16-byte alignment.

Emma Anholt requested to merge anholt/mesa:context-align into master

The _ModelProjectMatrix matrix embedded inside has members inside of it marked as 16-byte aligned, and so the context also has to be 16-byte aligned or access to those members would be invalid. I believe the compiler used this to use better 16-byte-aligned load/stores to other members of the context, breaking when the context's alignment was only 8 (as normal mallocs guarantee).

Fixes: 3175b63a ("mesa: don't allocate matrices with malloc")

(Speculative fix by me for a bug we saw with uprevving freedreno)

Merge request reports