vulkan: remove the temp hack for VK_ANDROID_native_buffer and regen framework
Previously the VK_ANDROID_native_buffer spec in the Vulkan registry is out of date. Since the upstream Vulkan registry has been fixed and imported to the Android downstream now, this change removes the hack and regenerate the Vulkan framework. This change also fixes below bugs: 1. Some device apis are treated as non-device. 2. The last command in the registry is ignored. Bug: 134711355 Test: Build, flash and dEQP tests Change-Id: I4eb77faf38b466f76caefdabb19a4d67a8ea789e
This commit is contained in:
parent
7e5d85ab04
commit
4bc489bb99
5 changed files with 20 additions and 34 deletions
|
@ -544,9 +544,9 @@ bool InitDriverTable(VkDevice dev,
|
||||||
INIT_PROC_EXT(KHR_bind_memory2, true, dev, BindImageMemory2KHR);
|
INIT_PROC_EXT(KHR_bind_memory2, true, dev, BindImageMemory2KHR);
|
||||||
INIT_PROC(false, dev, GetDeviceQueue2);
|
INIT_PROC(false, dev, GetDeviceQueue2);
|
||||||
INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsageANDROID);
|
INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsageANDROID);
|
||||||
|
INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsage2ANDROID);
|
||||||
INIT_PROC_EXT(ANDROID_native_buffer, true, dev, AcquireImageANDROID);
|
INIT_PROC_EXT(ANDROID_native_buffer, true, dev, AcquireImageANDROID);
|
||||||
INIT_PROC_EXT(ANDROID_native_buffer, true, dev, QueueSignalReleaseImageANDROID);
|
INIT_PROC_EXT(ANDROID_native_buffer, true, dev, QueueSignalReleaseImageANDROID);
|
||||||
INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsage2ANDROID);
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
|
|
@ -91,9 +91,9 @@ struct DeviceDriverTable {
|
||||||
PFN_vkBindImageMemory2KHR BindImageMemory2KHR;
|
PFN_vkBindImageMemory2KHR BindImageMemory2KHR;
|
||||||
PFN_vkGetDeviceQueue2 GetDeviceQueue2;
|
PFN_vkGetDeviceQueue2 GetDeviceQueue2;
|
||||||
PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID;
|
PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID;
|
||||||
|
PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID;
|
||||||
PFN_vkAcquireImageANDROID AcquireImageANDROID;
|
PFN_vkAcquireImageANDROID AcquireImageANDROID;
|
||||||
PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID;
|
PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID;
|
||||||
PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID;
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
// WARNING: This file is generated. See ../README.md for instructions.
|
// WARNING: This file is generated. See ../README.md for instructions.
|
||||||
|
|
||||||
#include "null_driver_gen.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "null_driver_gen.h"
|
||||||
|
|
||||||
using namespace null_driver;
|
using namespace null_driver;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -204,9 +204,9 @@ VKAPI_ATTR void DestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrCon
|
||||||
VKAPI_ATTR void GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue);
|
VKAPI_ATTR void GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue);
|
||||||
VKAPI_ATTR void GetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport);
|
VKAPI_ATTR void GetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport);
|
||||||
VKAPI_ATTR VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
|
VKAPI_ATTR VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
|
||||||
|
VKAPI_ATTR VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage);
|
||||||
VKAPI_ATTR VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
VKAPI_ATTR VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
||||||
VKAPI_ATTR VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd);
|
VKAPI_ATTR VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd);
|
||||||
VKAPI_ATTR VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage);
|
|
||||||
VKAPI_ATTR VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
|
VKAPI_ATTR VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
|
||||||
VKAPI_ATTR VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
VKAPI_ATTR VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
||||||
VKAPI_ATTR VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd);
|
VKAPI_ATTR VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd);
|
||||||
|
|
|
@ -127,7 +127,7 @@ def getDispatchTableType(functionName):
|
||||||
'VkCommandBuffer ' : 'Device'
|
'VkCommandBuffer ' : 'Device'
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(paramDict[functionName])>0:
|
if len(paramDict[functionName]) > 0:
|
||||||
return switchCase.get(paramDict[functionName][0][0], 'Global')
|
return switchCase.get(paramDict[functionName][0][0], 'Global')
|
||||||
return 'Global'
|
return 'Global'
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ def clang_on(f, indent):
|
||||||
def clang_off(f, indent):
|
def clang_off(f, indent):
|
||||||
f.write (clang_off_spaces * indent + '// clang-format off\n')
|
f.write (clang_off_spaces * indent + '// clang-format off\n')
|
||||||
|
|
||||||
clang_off_spaces = ' '*4
|
clang_off_spaces = ' ' * 4
|
||||||
|
|
||||||
parametersList = []
|
parametersList = []
|
||||||
paramDict = {}
|
paramDict = {}
|
||||||
|
@ -166,16 +166,13 @@ def parseVulkanRegistry():
|
||||||
vulkan_registry = os.path.join(os.path.dirname(__file__),'..','..','..','..','external','vulkan-headers','registry','vk.xml')
|
vulkan_registry = os.path.join(os.path.dirname(__file__),'..','..','..','..','external','vulkan-headers','registry','vk.xml')
|
||||||
tree = ET.parse(vulkan_registry)
|
tree = ET.parse(vulkan_registry)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
protoset = False
|
|
||||||
fnName = ""
|
|
||||||
fnType = ""
|
|
||||||
for commands in root.iter('commands'):
|
for commands in root.iter('commands'):
|
||||||
for command in commands:
|
for command in commands:
|
||||||
if command.tag == 'command':
|
if command.tag == 'command':
|
||||||
if protoset == True:
|
|
||||||
paramDict[fnName] = parametersList.copy()
|
|
||||||
parametersList.clear()
|
parametersList.clear()
|
||||||
protoset = False
|
protoset = False
|
||||||
|
fnName = ""
|
||||||
|
fnType = ""
|
||||||
if command.get('alias') != None:
|
if command.get('alias') != None:
|
||||||
alias = command.get('alias')
|
alias = command.get('alias')
|
||||||
fnName = command.get('name')
|
fnName = command.get('name')
|
||||||
|
@ -184,20 +181,20 @@ def parseVulkanRegistry():
|
||||||
paramDict[fnName] = paramDict[alias].copy()
|
paramDict[fnName] = paramDict[alias].copy()
|
||||||
returnTypeDict[fnName] = returnTypeDict[alias]
|
returnTypeDict[fnName] = returnTypeDict[alias]
|
||||||
for params in command:
|
for params in command:
|
||||||
if(params.tag == 'param'):
|
if params.tag == 'param':
|
||||||
paramtype = ""
|
paramtype = ""
|
||||||
if params.text!=None:
|
if params.text != None and params.text.strip() != '':
|
||||||
paramtype = params.text
|
paramtype = params.text.strip() + ' '
|
||||||
typeval = params.find('type')
|
typeval = params.find('type')
|
||||||
paramtype = paramtype + typeval.text
|
paramtype = paramtype + typeval.text
|
||||||
if typeval.tail!=None:
|
if typeval.tail != None:
|
||||||
paramtype = paramtype + typeval.tail
|
paramtype += typeval.tail.strip() + ' '
|
||||||
pname = params.find('name')
|
pname = params.find('name')
|
||||||
paramname = pname.text
|
paramname = pname.text
|
||||||
if pname.tail != None:
|
if pname.tail != None and pname.tail.strip() != '':
|
||||||
parametersList.append((paramtype,paramname,pname.tail))
|
parametersList.append((paramtype, paramname, pname.tail.strip()))
|
||||||
else:
|
else:
|
||||||
parametersList.append((paramtype,paramname))
|
parametersList.append((paramtype, paramname))
|
||||||
if params.tag == 'proto':
|
if params.tag == 'proto':
|
||||||
for c in params:
|
for c in params:
|
||||||
if c.tag == 'type':
|
if c.tag == 'type':
|
||||||
|
@ -207,6 +204,8 @@ def parseVulkanRegistry():
|
||||||
protoset = True
|
protoset = True
|
||||||
allCommandsList.append(fnName)
|
allCommandsList.append(fnName)
|
||||||
returnTypeDict[fnName] = fnType
|
returnTypeDict[fnName] = fnType
|
||||||
|
if protoset == True:
|
||||||
|
paramDict[fnName] = parametersList.copy()
|
||||||
|
|
||||||
for exts in root.iter('extensions'):
|
for exts in root.iter('extensions'):
|
||||||
for extension in exts:
|
for extension in exts:
|
||||||
|
@ -214,7 +213,7 @@ def parseVulkanRegistry():
|
||||||
if extension.tag == 'extension':
|
if extension.tag == 'extension':
|
||||||
extname = extension.get('name')
|
extname = extension.get('name')
|
||||||
for req in extension:
|
for req in extension:
|
||||||
if req.get('feature')!=None:
|
if req.get('feature') != None:
|
||||||
apiversion = req.get('feature')
|
apiversion = req.get('feature')
|
||||||
for commands in req:
|
for commands in req:
|
||||||
if commands.tag == 'command':
|
if commands.tag == 'command':
|
||||||
|
@ -224,19 +223,6 @@ def parseVulkanRegistry():
|
||||||
if apiversion != "":
|
if apiversion != "":
|
||||||
versionDict[commandname] = apiversion
|
versionDict[commandname] = apiversion
|
||||||
|
|
||||||
# TODO(adsrini): http://b/136570819
|
|
||||||
extensionsDict['vkGetSwapchainGrallocUsage2ANDROID'] = 'VK_ANDROID_native_buffer'
|
|
||||||
allCommandsList.append('vkGetSwapchainGrallocUsage2ANDROID')
|
|
||||||
returnTypeDict['vkGetSwapchainGrallocUsage2ANDROID'] = 'VkResult'
|
|
||||||
paramDict['vkGetSwapchainGrallocUsage2ANDROID'] = [
|
|
||||||
('VkDevice ', 'device'),
|
|
||||||
('VkFormat ', 'format'),
|
|
||||||
('VkImageUsageFlags ', 'imageUsage'),
|
|
||||||
('VkSwapchainImageUsageFlagsANDROID ', 'swapchainImageUsage'),
|
|
||||||
('uint64_t* ', 'grallocConsumerUsage'),
|
|
||||||
('uint64_t* ', 'grallocProducerUsage')
|
|
||||||
]
|
|
||||||
|
|
||||||
for feature in root.iter('feature'):
|
for feature in root.iter('feature'):
|
||||||
apiversion = feature.get('name')
|
apiversion = feature.get('name')
|
||||||
for req in feature:
|
for req in feature:
|
||||||
|
|
Loading…
Reference in a new issue