DiligentGraphics / DiligentCore

A modern cross-platform low-level graphics API
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
632 stars 138 forks source link

Restore Android SDK 21 support. #630

Closed eugeneko closed 1 month ago

eugeneko commented 1 month ago

This is standard approach for manual pointer alignment, used in e.g. EASTL:

https://github.com/electronicarts/EASTL/blob/master/include/EASTL/allocator.h#L252-L296

This fallback allows us to avoid pushing minimal required Android SDK version for sake of single optional feature.

I did not test it on Android, but I tested these functions by calling them unconditionally in AllocateAligned and FreeAligned.