xrt: Add a macro for Android platform to select vulkan memory to create swapchain.

Increases compatibility. AHardwareBuffer path left available and enabled
by default.
This commit is contained in:
zhz 2024-01-14 19:25:21 +08:00 committed by Simon Zeni
parent cc54210f47
commit d232e73587
2 changed files with 3 additions and 2 deletions

View file

@ -18,6 +18,7 @@
#if defined(__ANDROID__)
#define XRT_OS_ANDROID
#define XRT_OS_ANDROID_USE_AHB
#define XRT_OS_LINUX
#define XRT_OS_UNIX
#define XRT_OS_WAS_AUTODETECTED

View file

@ -187,7 +187,7 @@ xrt_shmem_is_valid(xrt_shmem_handle_t handle)
*
*/
#if defined(XRT_OS_ANDROID) && (__ANDROID_API__ >= 26)
#if defined(XRT_OS_ANDROID) && defined(XRT_OS_ANDROID_USE_AHB) && (__ANDROID_API__ >= 26)
typedef struct AHardwareBuffer AHardwareBuffer;
/*!
@ -235,7 +235,7 @@ xrt_graphics_buffer_is_valid(xrt_graphics_buffer_handle_t handle)
*/
#define XRT_GRAPHICS_BUFFER_HANDLE_INVALID NULL
#elif defined(XRT_OS_LINUX)
#elif defined(XRT_OS_ANDROID) && !defined(XRT_OS_ANDROID_USE_AHB) || defined(XRT_OS_LINUX)
/*!
* The type underlying buffers shared between compositor clients and the main