Lines Matching refs:self
112 def __init__(self, token, apiname = 'Vulkan', supported = True):
113 self.token = token
114 self.constant = token.replace('_VERSION_', '_API_VERSION_')
115 self.number = token[token.find('_VERSION_') + len('_VERSION_'):].replace('_', '.')
116 self.name = f'{apiname} {self.number}'
117 self.supported = supported
122 def __init__(self,
147 GeneratorOptions.__init__(self,
161 self.prefixText = prefixText
162 self.prefixText = None
163 self.apicall = apicall
164 self.apientry = apientry
165 self.apientryp = apientryp
166 self.alignFuncParam = alignFuncParam
167 self.expandEnumerants = expandEnumerants
174 def __init__(self,
178 OutputGenerator.__init__(self, errFile, warnFile, diagFile)
181 self.ext_instance_dispatch_list = [] # List of extension entries for instance dispatch list
182 self.ext_device_dispatch_list = [] # List of extension entries for device dispatch list
183 self.core_commands = [] # List of CommandData records for core Vulkan commands
184 self.ext_commands = [] # List of CommandData records for extension Vulkan commands
185 self.CommandParam = namedtuple('CommandParam', ['type', 'name', 'cdecl'])
186 self.CommandData = namedtuple('CommandData', ['name', 'ext_name', 'ext_type', 'require', 'protect', 'return_type', 'handle_type', 'params', 'cdecl'])
187 self.instanceExtensions = []
188 self.ExtensionData = namedtuple('ExtensionData', ['name', 'type', 'protect', 'define', 'num_commands'])
192 def beginFile(self, genOpts):
193 OutputGenerator.beginFile(self, genOpts)
198 write(s, file=self.outFile)
203 write(file_comment, file=self.outFile)
233 if self.genOpts.filename == 'vk_loader_extensions.h':
236 elif self.genOpts.filename == 'vk_loader_extensions.c':
248 elif self.genOpts.filename == 'vk_layer_dispatch_table.h':
255 write(copyright, file=self.outFile)
256 write(preamble, file=self.outFile)
260 def endFile(self):
263 if self.genOpts.filename == 'vk_loader_extensions.h':
264 file_data += self.OutputPrototypesInHeader()
265 file_data += self.OutputLoaderTerminators()
266 file_data += self.OutputIcdDispatchTable()
267 file_data += self.OutputIcdExtensionEnableUnion()
268 file_data += self.OutputDeviceFunctionTerminatorDispatchTable()
270 elif self.genOpts.filename == 'vk_loader_extensions.c':
271 file_data += self.OutputUtilitiesInSource()
272 file_data += self.OutputIcdDispatchTableInit()
273 file_data += self.OutputLoaderDispatchTables()
274 file_data += self.InitDeviceFunctionTerminatorDispatchTable()
275 file_data += self.OutputDeviceFunctionTrampolinePrototypes()
276 file_data += self.OutputLoaderLookupFunc()
277 file_data += self.CreateTrampTermFuncs()
278 file_data += self.InstExtensionGPA()
279 file_data += self.InstantExtensionCreate()
280 file_data += self.DeviceExtensionGetTerminator()
281 file_data += self.InitInstLoaderExtensionDispatchTable()
282 file_data += self.OutputInstantExtensionWhitelistArray()
284 elif self.genOpts.filename == 'vk_layer_dispatch_table.h':
285 file_data += self.OutputLayerInstanceDispatchTable()
286 file_data += self.OutputLayerDeviceDispatchTable()
290 write(file_data, file=self.outFile);
293 OutputGenerator.endFile(self)
295 def beginFeature(self, interface, emit):
297 OutputGenerator.beginFeature(self, interface, emit)
298 self.featureExtraProtect = GetFeatureProtect(interface)
301 self.currentExtension = ''
302 self.name_definition = ''
307 self.name_definition = name_definition
309 self.type = interface.get('type')
310 self.num_commands = 0
312 self.currentExtension = name
316 def genCmd(self, cmdinfo, name, alias):
317 OutputGenerator.genCmd(self, cmdinfo, name, alias)
321 info = self.getTypeNameTuple(params[0])
323 self.num_commands += 1
326 self.AddCommandToDispatchList(self.currentExtension, self.type, name, cmdinfo, info[0])
328 def endFeature(self):
330 if 'android' not in self.currentExtension:
331 self.instanceExtensions.append(self.ExtensionData(name=self.currentExtension,
332 type=self.type,
333 protect=self.featureExtraProtect,
334 define=self.name_definition,
335 num_commands=self.num_commands))
338 OutputGenerator.endFeature(self)
342 def getLen(self, param):
359 def getAPIVersion(self, token):
360 if self.genOpts.apiname == 'vulkansc':
379 def AddCommandToDispatchList(self, extension_name, extension_type, name, cmdinfo, handle_type):
380 handle = self.registry.tree.find("types/type/[name='" + handle_type + "'][@category='handle']")
388 require_node = self.registry.tree.find("./extensions/extension[@name='{}']/require/command[@name='{}']/..".format(extension_name, name))
399 len = self.getLen(param)
404 paramInfo = self.getTypeNameTuple(param)
407 param_cdecl = self.makeCParamDecl(param, 0)
408 cmd_params.append(self.CommandParam(type=param_type, name=param_name,
411 version = self.getAPIVersion(extension_name)
420 self.core_commands.append(
421 self.CommandData(name=name, ext_name=version.token,
424 protect=self.featureExtraProtect,
428 cdecl=self.makeCDecls(cmdinfo.elem)[0]))
430 self.ext_device_dispatch_list.append((name, self.featureExtraProtect))
431 self.ext_commands.append(
432 self.CommandData(name=name, ext_name=extension_name,
435 protect=self.featureExtraProtect,
439 cdecl=self.makeCDecls(cmdinfo.elem)[0]))
444 self.core_commands.append(
445 self.CommandData(name=name, ext_name=version.token,
448 protect=self.featureExtraProtect,
452 cdecl=self.makeCDecls(cmdinfo.elem)[0]))
455 self.ext_instance_dispatch_list.append((name, self.featureExtraProtect))
456 self.ext_commands.append(
457 self.CommandData(name=name, ext_name=extension_name,
460 protect=self.featureExtraProtect,
464 cdecl=self.makeCDecls(cmdinfo.elem)[0]))
468 def getTypeNameTuple(self, param):
478 def OutputPrototypesInHeader(self):
540 def OutputUtilitiesInSource(self):
558 def OutputLayerInstanceDispatchTable(self):
573 commands = self.core_commands
575 commands = self.ext_commands
578 version = self.getAPIVersion(cur_cmd.ext_name)
605 def OutputLayerDeviceDispatchTable(self):
617 commands = self.core_commands
619 commands = self.ext_commands
622 version = self.getAPIVersion(cur_cmd.ext_name)
649 def ShouldPrintInIcdDispatchTable(self, cur_cmd, skip_list):
655 def OutputIcdDispatchTable(self):
669 commands = self.core_commands
671 commands = self.ext_commands
674 version = self.getAPIVersion(cur_cmd.ext_name)
675 if (self.ShouldPrintInIcdDispatchTable(cur_cmd, skip_commands)):
699 def OutputIcdDispatchTableInit(self):
731 commands = self.core_commands
733 commands = self.ext_commands
737 version = self.getAPIVersion(cur_cmd.ext_name)
738 if (self.ShouldPrintInIcdDispatchTable(cur_cmd, skip_gipa_commands)):
774 def OutputIcdExtensionEnableUnion(self):
775 extensions = self.instanceExtensions
780 if (self.getAPIVersion(ext.name) or ext.name in WSI_EXT_NAMES or
791 def OutputLoaderTerminators(self):
795 for cur_cmd in self.core_commands:
819 def OutputLoaderDispatchTables(self):
830 commands = self.core_commands
842 commands = self.ext_commands
856 commands = self.core_commands
865 commands = self.ext_commands
872 version = self.getAPIVersion(cur_cmd.ext_name)
920 def OutputLoaderLookupFunc(self):
960 commands = self.core_commands
962 commands = self.ext_commands
965 version = self.getAPIVersion(cur_cmd.ext_name)
1015 def CreateTrampTermFuncs(self):
1048 for ext_cmd in self.ext_commands:
1055 version = self.getAPIVersion(ext_cmd.ext_name)
1435 def InstExtensionGPA(self):
1444 for cur_cmd in self.ext_commands:
1445 if (self.getAPIVersion(cur_cmd.ext_name) or
1486 def InstantExtensionCreate(self):
1488 entries = self.instanceExtensions
1497 if (self.getAPIVersion(ext.name) or ext.name in WSI_EXT_NAMES or
1530 def DeviceExtensionGetTerminator(self):
1545 for ext_cmd in self.ext_commands:
1546 version = self.getAPIVersion(ext_cmd.ext_name)
1577 def OutputDeviceFunctionTerminatorDispatchTable(self):
1585 for ext_cmd in self.ext_commands:
1586 version = self.getAPIVersion(ext_cmd.ext_name)
1607 def OutputDeviceFunctionTrampolinePrototypes(self):
1613 for ext_cmd in self.ext_commands:
1614 version = self.getAPIVersion(ext_cmd.ext_name)
1636 def InitDeviceFunctionTerminatorDispatchTable(self):
1646 for ext_cmd in self.ext_commands:
1647 version = self.getAPIVersion(ext_cmd.ext_name)
1677 def InitInstLoaderExtensionDispatchTable(self):
1689 commands = self.core_commands
1691 commands = self.ext_commands
1694 version = self.getAPIVersion(cur_cmd.ext_name)
1729 def OutputInstantExtensionWhitelistArray(self):
1730 extensions = self.instanceExtensions
1739 if ext.type == 'device' or self.getAPIVersion(ext.name):