blob: 6e2060bf563cb79e08a30b84a45e12908df66e98 [file] [log] [blame]
// Copyright (C) 2022 The Android Open Source Project
// Copyright (C) 2022 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Autogenerated header vk_android_native_buffer.h
// Please do not modify directly;
// re-run scripts/generate-vulkan-sources.sh,
// or directly from Python by calling the genvk.py script with correct parameters.
//
// This header is generated to support building the Gfxstream host components
// with system installed Vulkan headers instead of with Gfxstream's generated
// headers. Gfxstream's generated Vulkan headers include the Android extension
// in vulkan/vulkan_core.h due to local edits (see `supported="vulkan"`) but
// standard Vulkan headers do not. However, the host should still be able to
// support an Android guest. Gfxstream could be updated in the future to always
// generate and use the separate vulkan/vk_android_native_buffer.h to
// consolidate the builds.
#pragma once
#ifndef VK_ANDROID_native_buffer
#include "vk_android_native_buffer_structure_type.h"
#endif /* VK_ANDROID_native_buffer */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VK_ANDROID_native_buffer
#define VK_ANDROID_native_buffer 1
#define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 8
#define VK_ANDROID_NATIVE_BUFFER_NUMBER 11
#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME "VK_ANDROID_native_buffer"
#define VK_ANDROID_NATIVE_BUFFER_NAME VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME
typedef enum VkSwapchainImageUsageFlagBitsANDROID {
VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0x00000001,
VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM_ANDROID = 0x7FFFFFFF
} VkSwapchainImageUsageFlagBitsANDROID;
typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
typedef struct VkNativeBufferUsage2ANDROID {
uint64_t consumer;
uint64_t producer;
} VkNativeBufferUsage2ANDROID;
typedef struct VkNativeBufferANDROID {
VkStructureType sType;
const void* pNext;
const uint32_t* handle;
int stride;
int format;
int usage;
VkNativeBufferUsage2ANDROID usage2;
} VkNativeBufferANDROID;
typedef struct VkSwapchainImageCreateInfoANDROID {
VkStructureType sType;
const void* pNext;
VkSwapchainImageUsageFlagsANDROID usage;
} VkSwapchainImageCreateInfoANDROID;
typedef struct VkPhysicalDevicePresentationPropertiesANDROID {
VkStructureType sType;
const void* pNext;
VkBool32 sharedImage;
} VkPhysicalDevicePresentationPropertiesANDROID;
typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainGrallocUsageANDROID)(VkDevice device, VkFormat format,
VkImageUsageFlags imageUsage,
int* grallocUsage);
typedef VkResult(VKAPI_PTR* PFN_vkAcquireImageANDROID)(VkDevice device, VkImage image,
int nativeFenceFd, VkSemaphore semaphore,
VkFence fence);
typedef VkResult(VKAPI_PTR* PFN_vkQueueSignalReleaseImageANDROID)(
VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image,
int* pNativeFenceFd);
typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainGrallocUsage2ANDROID)(
VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage,
uint64_t* grallocProducerUsage);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
VkImageUsageFlags imageUsage,
int* grallocUsage);
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireImageANDROID(VkDevice device, VkImage image,
int nativeFenceFd, VkSemaphore semaphore,
VkFence fence);
VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageANDROID(VkQueue queue,
uint32_t waitSemaphoreCount,
const VkSemaphore* pWaitSemaphores,
VkImage image, int* pNativeFenceFd);
VKAPI_ATTR VkResult VKAPI_CALL
vkGetSwapchainGrallocUsage2ANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage);
#endif
#endif /* VK_ANDROID_native_buffer */
#ifdef __cplusplus
}
#endif