diff --git a/bin/gen_enum_to_str.py b/bin/gen_enum_to_str.py index c4f8b262..2f2a7f10 100644 --- a/bin/gen_enum_to_str.py +++ b/bin/gen_enum_to_str.py @@ -59,7 +59,6 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\ #include #include - #include #include "../src/mesa/util/macros.h" #include "vk_enum_to_str.h" @@ -158,7 +157,6 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\ #define MESA_VK_ENUM_TO_STR_H #include - #include #ifdef __cplusplus extern "C" { @@ -361,6 +359,8 @@ def parse_xml(cmd_factory, enum_factory, ext_factory, struct_factory, filename): for command in xml.findall('./commands/command'): name = command.find('./proto/name') + if name is not None and "ANDROID" in name.text: + continue first_arg = command.find('./param/type') # Some commands are alias KHR -> nonKHR, ignore those if name is not None: @@ -369,6 +369,8 @@ def parse_xml(cmd_factory, enum_factory, ext_factory, struct_factory, filename): for struct_type in xml.findall('./types/type[@category="struct"]'): name = struct_type.attrib['name'] + if name is not None and "ANDROID" in name: + continue stype = struct_get_stype(struct_type) if stype is not None: struct_factory(name, stype=stype) diff --git a/include/vulkan/vk_android_native_buffer.h b/include/vulkan/vk_android_native_buffer.h deleted file mode 100644 index 8a777407..00000000 --- a/include/vulkan/vk_android_native_buffer.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2015 The Android Open Source Project - * - * 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. - */ -#ifndef __VK_ANDROID_NATIVE_BUFFER_H__ -#define __VK_ANDROID_NATIVE_BUFFER_H__ - -/* MESA: A hack to avoid #ifdefs in driver code. */ -#ifdef ANDROID -#include -#include -#include -#else -typedef void *buffer_handle_t; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define VK_ANDROID_native_buffer 1 -#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER 11 - -/* NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6 - * - * This version of the extension transitions from gralloc0 to gralloc1 usage - * flags (int -> 2x uint64_t). The WSI implementation will temporarily continue - * to fill out deprecated fields in VkNativeBufferANDROID, and will call the - * deprecated vkGetSwapchainGrallocUsageANDROID if the new - * vkGetSwapchainGrallocUsage2ANDROID is not supported. This transitionary - * backwards-compatibility support is temporary, and will likely be removed in - * (along with all gralloc0 support) in a future release. - */ -#define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 7 -#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME "VK_ANDROID_native_buffer" - -#define VK_ANDROID_NATIVE_BUFFER_ENUM(type,id) ((type)(1000000000 + (1000 * (VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER - 1)) + (id))) -#define VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 0) -#define VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 1) -#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 2) - -typedef enum VkSwapchainImageUsageFlagBitsANDROID { - VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0x00000001, - VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSwapchainImageUsageFlagBitsANDROID; -typedef VkFlags VkSwapchainImageUsageFlagsANDROID; -typedef struct { - VkStructureType sType; // must be VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID - const void* pNext; - - // Buffer handle and stride returned from gralloc alloc() - buffer_handle_t handle; - int stride; - - // Gralloc format and usage requested when the buffer was allocated. - int format; - int usage; // DEPRECATED in SPEC_VERSION 6 - - // -- Added in SPEC_VERSION 6 -- - struct { - uint64_t consumer; - uint64_t producer; - } usage2; -} VkNativeBufferANDROID; - -typedef struct { - VkStructureType sType; // must be VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID - const void* pNext; - - VkSwapchainImageUsageFlagsANDROID usage; -} VkSwapchainImageCreateInfoANDROID; - -typedef struct { - VkStructureType sType; // must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID - const void* pNext; - - VkBool32 sharedImage; -} VkPhysicalDevicePresentationPropertiesANDROID; - -// -- DEPRECATED in SPEC_VERSION 6 -- -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsageANDROID)(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage); -// -- ADDED in SPEC_VERSION 6 -- -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsage2ANDROID)(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage); -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); - -#ifndef VK_NO_PROTOTYPES -// -- DEPRECATED in SPEC_VERSION 6 -- -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageANDROID( - VkDevice device, - VkFormat format, - VkImageUsageFlags imageUsage, - int* grallocUsage -); -// -- ADDED in SPEC_VERSION 6 -- -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsage2ANDROID( - VkDevice device, - VkFormat format, - VkImageUsageFlags imageUsage, - VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, - uint64_t* grallocConsumerUsage, - uint64_t* grallocProducerUsage -); -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 -); -#endif - -#ifdef __cplusplus -} -#endif - -#endif // __VK_ANDROID_NATIVE_BUFFER_H__