hasvk: refactor to use DETECT_OS_ANDROID instead of ANDROID
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27374>
This commit is contained in:
@@ -24,7 +24,9 @@
|
||||
#ifndef ANV_ANDROID_H
|
||||
#define ANV_ANDROID_H
|
||||
|
||||
#if defined(ANDROID) && ANDROID_API_LEVEL >= 26
|
||||
#include "util/detect_os.h"
|
||||
|
||||
#if DETECT_OS_ANDROID && ANDROID_API_LEVEL >= 26
|
||||
#include <vndk/hardware_buffer.h>
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
@@ -319,7 +319,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
||||
.EXT_transform_feedback = true,
|
||||
.EXT_vertex_attribute_divisor = true,
|
||||
.EXT_ycbcr_image_arrays = true,
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
.ANDROID_external_memory_android_hardware_buffer = true,
|
||||
.ANDROID_native_buffer = true,
|
||||
#endif
|
||||
@@ -3334,7 +3334,7 @@ void anv_FreeMemory(
|
||||
|
||||
anv_device_release_bo(device, mem->bo);
|
||||
|
||||
#if defined(ANDROID) && ANDROID_API_LEVEL >= 26
|
||||
#if DETECT_OS_ANDROID && ANDROID_API_LEVEL >= 26
|
||||
if (mem->ahw)
|
||||
AHardwareBuffer_release(mem->ahw);
|
||||
#endif
|
||||
|
@@ -1258,7 +1258,7 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
||||
if (image->vk.external_handle_types &
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
|
||||
image->from_ahb = true;
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
image->vk.ahb_format = anv_ahb_format_for_vk_format(image->vk.format);
|
||||
#endif
|
||||
return VK_SUCCESS;
|
||||
@@ -1447,7 +1447,7 @@ resolve_ahw_image(struct anv_device *device,
|
||||
struct anv_image *image,
|
||||
struct anv_device_memory *mem)
|
||||
{
|
||||
#if defined(ANDROID) && ANDROID_API_LEVEL >= 26
|
||||
#if DETECT_OS_ANDROID && ANDROID_API_LEVEL >= 26
|
||||
assert(mem->ahw);
|
||||
AHardwareBuffer_Desc desc;
|
||||
AHardwareBuffer_describe(mem->ahw, &desc);
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include "ds/intel_driver_ds.h"
|
||||
#include "util/bitset.h"
|
||||
#include "util/bitscan.h"
|
||||
#include "util/detect_os.h"
|
||||
#include "util/macros.h"
|
||||
#include "util/hash_table.h"
|
||||
#include "util/list.h"
|
||||
|
Reference in New Issue
Block a user