Lines Matching refs:gencom
21 import generator_common as gencom namespace
177 if gencom.is_function_supported(cmd):
180 if cmd in gencom.extension_dict:
181 if (gencom.extension_dict[cmd] == 'VK_ANDROID_native_buffer' or
182 gencom.extension_dict[cmd] == 'VK_EXT_debug_report'):
194 gencom.is_instance_dispatched(cmd))
204 gencom.is_device_dispatched(cmd))
214 f.write(gencom.copyright_and_warning(2016))
239 f.write(gencom.indent(2) + gencom.base_ext_name(ext) + ',\n')
244 for version in gencom.version_code_list:
245 f.write(gencom.indent(2) + 'EXTENSION_CORE_' + version + ',\n')
264 for cmd in gencom.command_list:
266 f.write(gencom.indent(1) + 'PFN_' + cmd + ' ' +
267 gencom.base_name(cmd) + ';\n')
276 for cmd in gencom.command_list:
278 f.write(gencom.indent(1) + 'PFN_' + cmd + ' ' +
279 gencom.base_name(cmd) + ';\n')
307 gencom.run_clang_format(genfile)
316 if gencom.is_function_supported(cmd):
320 if cmd in gencom.extension_dict:
321 return gencom.extension_dict[cmd] in _INTERCEPTED_EXTENSIONS
331 assert cmd in gencom.version_dict
332 for version in gencom.version_code_list:
333 if gencom.version_dict[cmd] == 'VK_VERSION_' + version:
343 if _is_intercepted(cmd) and gencom.is_device_dispatched(cmd):
344 if cmd in gencom.extension_dict:
345 if not gencom.is_extension_internal(gencom.extension_dict[cmd]):
347 elif gencom.version_dict[cmd] != 'VK_VERSION_1_0':
360 return_type = gencom.return_type_dict[cmd]
364 if cmd in gencom.extension_dict:
365 ext_name = gencom.extension_dict[cmd]
366 ext_hook = 'ProcHook::' + gencom.base_ext_name(ext_name)
368 ext_name = gencom.version_dict[cmd]
371 handle = gencom.param_dict[cmd][0][1]
372 param_types = ', '.join([''.join(i) for i in gencom.param_dict[cmd]])
373 param_names = ', '.join([''.join(i[1]) for i in gencom.param_dict[cmd]])
375 f.write('VKAPI_ATTR ' + return_type + ' checked' + gencom.base_name(cmd) +
377 f.write(gencom.indent(1) + 'if (GetData(' + handle + ').hook_extensions[' +
380 f.write(gencom.indent(2))
381 if gencom.return_type_dict[cmd] != 'void':
383 f.write(gencom.base_name(cmd) + '(' + param_names + ');\n')
385 f.write(gencom.indent(1) + '} else {\n')
386 f.write(gencom.indent(2) + 'Logger(' + handle + ').Err(' + handle + ', \"' +
388 if gencom.return_type_dict[cmd] != 'void':
389 f.write(gencom.indent(2) + 'return VK_SUCCESS;\n')
390 f.write(gencom.indent(1) + '}\n}\n\n')
400 assert cmd not in gencom.extension_dict
402 f.write(gencom.indent(1) + '{\n')
403 f.write(gencom.indent(2) + '\"' + cmd + '\",\n')
404 f.write(gencom.indent(2) + 'ProcHook::GLOBAL,\n')
405 f.write(gencom.indent(2) + _get_proc_hook_enum(cmd) + ',\n')
406 f.write(gencom.indent(2) + 'reinterpret_cast<PFN_vkVoidFunction>(' +
407 gencom.base_name(cmd) + '),\n')
408 f.write(gencom.indent(2) + 'nullptr,\n')
409 f.write(gencom.indent(1) + '},\n')
419 f.write(gencom.indent(1) + '{\n')
420 f.write(gencom.indent(2) + '\"' + cmd + '\",\n')
421 f.write(gencom.indent(2) + 'ProcHook::INSTANCE,\n')
423 if cmd in gencom.extension_dict:
424 ext_name = gencom.extension_dict[cmd]
425 f.write(gencom.indent(2) + 'ProcHook::' +
426 gencom.base_ext_name(ext_name) + ',\n')
428 if gencom.is_extension_internal(ext_name):
434 reinterpret_cast<PFN_vkVoidFunction>(""" + gencom.base_name(cmd) + """),
437 f.write(gencom.indent(2) + _get_proc_hook_enum(cmd) + ',\n')
439 reinterpret_cast<PFN_vkVoidFunction>(""" + gencom.base_name(cmd) + """),
442 f.write(gencom.indent(1) + '},\n')
452 f.write(gencom.indent(1) + '{\n')
453 f.write(gencom.indent(2) + '\"' + cmd + '\",\n')
454 f.write(gencom.indent(2) + 'ProcHook::DEVICE,\n')
456 if (cmd in gencom.extension_dict or
457 gencom.version_dict[cmd] != 'VK_VERSION_1_0'):
460 if cmd in gencom.extension_dict:
461 ext_name = gencom.extension_dict[cmd]
462 ext_hook = 'ProcHook::' + gencom.base_ext_name(ext_name)
464 ext_name = gencom.version_dict[cmd]
466 f.write(gencom.indent(2) + ext_hook + ',\n')
468 if gencom.is_extension_internal(ext_name):
474 reinterpret_cast<PFN_vkVoidFunction>(""" + gencom.base_name(cmd) + """),
476 gencom.base_name(cmd) + '),\n')
479 f.write(gencom.indent(2) + _get_proc_hook_enum(cmd) + ',\n')
481 reinterpret_cast<PFN_vkVoidFunction>(""" + gencom.base_name(cmd) + """),
484 f.write(gencom.indent(1) + '},\n')
494 f.write(gencom.copyright_and_warning(2016))
510 for cmd in gencom.command_list:
519 sorted_command_list = sorted(gencom.command_list)
522 if gencom.is_globally_dispatched(cmd):
524 elif gencom.is_instance_dispatched(cmd):
526 elif gencom.is_device_dispatched(cmd):
548 f.write(gencom.indent(1) + 'if (strcmp(name, \"' + ext +
549 '\") == 0) return ProcHook::' + gencom.base_ext_name(ext) + ';\n')
582 for cmd in gencom.command_list:
584 gencom.init_proc(cmd, f)
600 for cmd in gencom.command_list:
602 gencom.init_proc(cmd, f)
613 for key, value in sorted(gencom.promoted_inst_ext_dict.items()):
614 f.write(gencom.indent(1) + 'std::make_pair("' + key + '", ' + value + '),\n')
662 gencom.run_clang_format(genfile)