xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/vulkan/android/vk_android_utils.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // vk_android_utils.h: Vulkan utilities for using the Android platform
8 
9 #ifndef LIBANGLE_RENDERER_VULKAN_ANDROID_VK_ANDROID_UTILS_H_
10 #define LIBANGLE_RENDERER_VULKAN_ANDROID_VK_ANDROID_UTILS_H_
11 
12 #include <EGL/egl.h>
13 #include <EGL/eglext.h>
14 #include "common/vulkan/vk_headers.h"
15 #include "libANGLE/Error.h"
16 
17 class Buffer;
18 class DeviceMemory;
19 
20 namespace rx
21 {
22 class Context;
23 
24 namespace vk
25 {
26 class Renderer;
27 angle::Result InitAndroidExternalMemory(Context *context,
28                                         EGLClientBuffer clientBuffer,
29                                         VkMemoryPropertyFlags memoryProperties,
30                                         Buffer *buffer,
31                                         VkMemoryPropertyFlags *memoryPropertyFlagsOut,
32                                         uint32_t *memoryTypeIndexOut,
33                                         DeviceMemory *deviceMemoryOut,
34                                         VkDeviceSize *sizeOut);
35 
36 void ReleaseAndroidExternalMemory(Renderer *renderer, EGLClientBuffer clientBuffer);
37 }  // namespace vk
38 }  // namespace rx
39 
40 #endif  // LIBANGLE_RENDERER_VULKAN_ANDROID_VK_ANDROID_UTILS_H_
41