Home | History | Annotate | Download | only in scripts

Lines Matching refs:table

92 # Generates dispatch table helper header files for LVL
94 """Generate dispatch table helper header based on XML element attributes"""
268 # Determine if this API should be ignored or added to the instance or device dispatch table
377 protos += '// Dispatch table properly filled in with appropriate terminators for the\n'
387 protos += '// Init Device function pointer dispatch table with core commands\n'
391 protos += '// Init Device function pointer dispatch table with extension commands\n'
395 protos += '// Init Instance function pointer dispatch table with core commands\n'
396 protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n'
399 protos += '// Init Instance function pointer dispatch table with core commands\n'
400 protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n'
404 protos += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name);\n'
407 protos += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,\n'
432 # Create a layer instance dispatch table from the appropriate list and return it as a string
435 table = ''
438 table += '// Instance function pointer dispatch table\n'
439 table += 'typedef struct VkLayerInstanceDispatchTable_ {\n'
443 table += ' // Manually add in GetPhysicalDeviceProcAddr entry\n'
444 table += ' PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;\n'
458 table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
460 table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
467 table += '#ifdef %s\n' % cur_cmd.protect
469 table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name)
472 table += '#endif // %s\n' % cur_cmd.protect
474 table += '} VkLayerInstanceDispatchTable;\n\n'
475 return table
478 # Create a layer device dispatch table from the appropriate list and return it as a string
481 table = ''
484 table += '// Device function pointer dispatch table\n'
485 table += 'typedef struct VkLayerDispatchTable_ {\n'
499 table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
501 table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
508 table += '#ifdef %s\n' % cur_cmd.protect
510 table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name)
513 table += '#endif // %s\n' % cur_cmd.protect
515 table += '} VkLayerDispatchTable;\n\n'
516 return table
519 # Create a dispatch table from the appropriate list and return it as a string
522 table = ''
525 table += '// ICD function pointer dispatch table\n'
526 table += 'struct loader_icd_term_dispatch {\n'
541 table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
543 table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
550 table += '#ifdef %s\n' % cur_cmd.protect
552 table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name)
555 table += '#endif // %s\n' % cur_cmd.protect
557 table += '};\n\n'
558 return table
561 # Init a dispatch table from the appropriate list and return it as a string
566 table = ''
567 table += 'VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,\n'
568 table += ' const PFN_vkGetInstanceProcAddr fp_gipa) {\n'
569 table += '\n'
570 table += '#define LOOKUP_GIPA(func, required) \\\n'
571 table += ' do { \\\n'
572 table += ' icd_term->dispatch.func = (PFN_vk##func)fp_gipa(inst, "vk" #func); \\\n'
573 table += ' if (!icd_term->dispatch.func && required) { \\\n'
574 table += ' loader_log((struct loader_instance *)inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \\\n'
575 table += ' loader_platform_get_proc_address_error("vk" #func)); \\\n'
576 table += ' return false; \\\n'
577 table += ' } \\\n'
578 table += ' } while (0)\n'
579 table += '\n'
600 table += '\n // ---- Core %s\n' % cur_cmd.ext_name[11:]
602 table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
609 table += '#ifdef %s\n' % cur_cmd.protect
614 table += ' LOOKUP_GIPA(%s, true);\n' % (base_name)
616 table += ' LOOKUP_GIPA(%s, false);\n' % (base_name)
619 table += '#endif // %s\n' % cur_cmd.protect
621 table += '\n'
622 table += '#undef LOOKUP_GIPA\n'
623 table += '\n'
624 table += ' return true;\n'
625 table += '};\n\n'
626 return table
691 tables += '// Init Device function pointer dispatch table with core commands\n'
694 tables += ' VkLayerDispatchTable *table = &dev_table->core_dispatch;\n'
702 tables += '// Init Device function pointer dispatch table with extension commands\n'
705 tables += ' VkLayerDispatchTable *table = &dev_table->core_dispatch;\n'
712 tables += '// Init Instance function pointer dispatch table with core commands\n'
713 tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n'
721 tables += '// Init Instance function pointer dispatch table with core commands\n'
722 tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n'
747 # If we're looking for the proc we are passing in, just point the table to it. This fixes the issue where
750 tables += ' table->GetDeviceProcAddr = gpa;\n'
752 tables += ' table->GetInstanceProcAddr = gpa;\n'
754 tables += ' table->%s = (PFN_%s)gpa(%s, "%s");\n' % (base_name, cur_cmd.name, gpa_param, cur_cmd.name)
763 # Create a lookup table function from the appropriate list of entrypoints and
776 tables += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name) {\n'
784 tables += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,\n'
822 tables += ' if (!strcmp(name, "%s")) return (void *)table->%s;\n' % (base_name, base_name)
1268 # Create code to initialize a dispatch table from the appropriate list of
1314 # Create code to initialize a dispatch table from the appropriate list of
1318 table = ''
1321 table += '// This table contains the loader\'s instance dispatch table, which contains\n'
1322 table += '// default functions if no instance layers are activated. This contains\n'
1323 table += '// pointers to "terminator functions".\n'
1324 table += 'const VkLayerInstanceDispatchTable instance_disp = {\n'
1336 table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
1338 table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
1350 table += '#ifdef %s\n' % cur_cmd.protect
1353 table += ' .%s = %s,\n' % (base_name, cur_cmd.name)
1355 table += ' .%s = terminator_%s,\n' % (base_name, base_name)
1358 table += '#endif // %s\n' % cur_cmd.protect
1359 table += '};\n\n'
1361 return table
1368 table = ''
1369 table += '// A null-terminated list of all of the instance extensions supported by the loader.\n'
1370 table += '// If an instance extension name is not in this list, but it is exported by one or more of the\n'
1371 table += '// ICDs detected by the loader, then the extension name not in the list will be filtered out\n'
1372 table += '// before passing the list of extensions to the application.\n'
1373 table += 'const char *const LOADER_INSTANCE_EXTENSIONS[] = {\n'
1379 table += '#ifdef %s\n' % ext.protect
1380 table += ' '
1381 table += ext.define + ',\n'
1384 table += '#endif // %s\n' % ext.protect
1385 table += ' NULL };\n'
1386 return table