Debian Codegraph @

src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.h

raw
1 /*
2 * Copyright 2019 Google LLC
3 * SPDX-License-Identifier: MIT
4 */
5 #pragma once
6
7 #if defined(ANDROID)
8
9 #include <vulkan/vulkan.h>
10
11 #include "gfxstream/guest/GfxStreamGralloc.h"
12 #include "HostVisibleMemoryVirtualization.h"
13
14 // Structure similar to
15 // https://github.com/mesa3d/mesa/blob/master/src/intel/vulkan/anv_android.c
16
17 namespace gfxstream {
18 namespace vk {
19
20 uint64_t getAndroidHardwareBufferUsageFromVkUsage(const VkImageCreateFlags vk_create,
21 const VkImageUsageFlags vk_usage);
22
23 VkResult getAndroidHardwareBufferPropertiesANDROID(
24 gfxstream::Gralloc* grallocHelper, const AHardwareBuffer* buffer,
25 VkAndroidHardwareBufferPropertiesANDROID* pProperties);
26
27 VkResult getMemoryAndroidHardwareBufferANDROID(gfxstream::Gralloc* grallocHelper,
28 struct AHardwareBuffer** pBuffer);
29
30 VkResult importAndroidHardwareBuffer(gfxstream::Gralloc* grallocHelper,
31 const VkImportAndroidHardwareBufferInfoANDROID* info,
32 struct AHardwareBuffer** importOut);
33
34 VkResult createAndroidHardwareBuffer(gfxstream::Gralloc* grallocHelper, bool hasDedicatedImage,
35 bool hasDedicatedBuffer, const VkExtent3D& imageExtent,
36 uint32_t imageLayers, VkFormat imageFormat,
37 VkImageUsageFlags imageUsage,
38 VkImageCreateFlags imageCreateFlags, VkDeviceSize bufferSize,
39 VkDeviceSize allocationInfoAllocSize,
40 struct AHardwareBuffer** out);
41
42 } // namespace vk
43 } // namespace gfxstream
44
45 #endif // ANDROID