apis[VK_API_VERSION_1_0].push_back(FunctionInfo("vkCmdNextSubpass", FUNCTIONORIGIN_DEVICE));
apis[VK_API_VERSION_1_0].push_back(FunctionInfo("vkCmdEndRenderPass", FUNCTIONORIGIN_DEVICE));
apis[VK_API_VERSION_1_0].push_back(FunctionInfo("vkCmdExecuteCommands", FUNCTIONORIGIN_DEVICE));
- apis[VK_API_VERSION_1_0].push_back(FunctionInfo("vkEnumerateInstanceVersion", FUNCTIONORIGIN_PLATFORM));
- apis[VK_API_VERSION_1_0].push_back(FunctionInfo("vkGetDeviceQueue2", FUNCTIONORIGIN_DEVICE));
apis[VK_API_VERSION_1_1].push_back(FunctionInfo("vkCreateInstance", FUNCTIONORIGIN_PLATFORM));
apis[VK_API_VERSION_1_1].push_back(FunctionInfo("vkDestroyInstance", FUNCTIONORIGIN_INSTANCE));
TYPE_INSTANCE = 1 # Bound to VkInstance
TYPE_DEVICE = 2 # Bound to VkDevice
- def __init__ (self, name, returnType, arguments):
+ def __init__ (self, name, returnType, arguments, apiVersion = None):
self.name = name
self.returnType = returnType
self.arguments = arguments
self.alias = None
self.isAlias = False
+ self.apiVersion = apiVersion
def getType (self):
# Special functions
functions.append(Function(name.strip(), returnType.strip(), parseArgList(argList)))
return functions
+def parseFunctionsByVersion (src):
+ ptrnVer10 = 'VK_VERSION_1_0 1'
+ ptrnVer11 = 'VK_VERSION_1_1 1'
+ matchVer10 = re.search(ptrnVer10, src)
+ matchVer11 = re.search(ptrnVer11, src)
+ ptrn = r'VKAPI_ATTR\s+(' + TYPE_PTRN + ')\s+VKAPI_CALL\s+(' + IDENT_PTRN + r')\s*\(([^)]*)\)\s*;'
+ regPtrn = re.compile(ptrn)
+ matches = regPtrn.findall(src, matchVer10.start(), matchVer11.start())
+ functions = []
+ for returnType, name, argList in matches:
+ functions.append(Function(name.strip(), returnType.strip(), parseArgList(argList), 'VK_VERSION_1_0'))
+ matches = regPtrn.findall(src, matchVer11.start())
+ for returnType, name, argList in matches:
+ functions.append(Function(name.strip(), returnType.strip(), parseArgList(argList), 'VK_VERSION_1_1'))
+ return functions
+
def splitByExtension (src):
ptrn = r'#define\s+[A-Z0-9_]+_EXTENSION_NAME\s+"([^"]+)"'
match = "#define\s+("
bitfields = []
bitfieldEnums = set([getBitEnumNameForBitfield(n) for n in bitfieldNames if getBitEnumNameForBitfield(n) in [enum.name for enum in rawEnums]])
compositeTypes = parseCompositeTypes(src)
- allFunctions = parseFunctions(src)
+ allFunctions = parseFunctionsByVersion(src)
for enum in rawEnums:
if enum.name in bitfieldEnums:
" apis.insert(::std::pair<deUint32, FunctionInfosList>(" + str(Version((1, 1, 0))) + ", FunctionInfosList()));",
""]
- def listUpgradedFuncs ():
- for fun in api.extensions[0].functions:
- if not fun.isAlias and fun.alias == None:
+ def list10Funcs ():
+ for fun in api.functions:
+ if fun.apiVersion == 'VK_VERSION_1_0':
insert = ' apis[' + str(Version((1, 0, 0))) + '].push_back(FunctionInfo("' + fun.name + '",\t' + functionOriginValues[fun.getType()] + '));'
yield insert
insert = ' apis[' + str(Version((1, 1, 0))) + '].push_back(FunctionInfo("' + fun.name + '",\t' + functionOriginValues[fun.getType()] + '));'
yield insert
- lines = lines + [line for line in indentLines(listUpgradedFuncs())]
+ lines = lines + [line for line in indentLines(list10Funcs())]
lines.append("")
lines = lines + [line for line in indentLines(listAllFuncs())]
// Vulkan 1.0 version number
#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)
-#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)
#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22)
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_1_1 1
// Vulkan 1.1 version number
-#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)// Patch version should always be set to 0
+#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion)