Lines Matching refs:append

194             contents.append(copyright)
196 contents.append(header)
198 contents.append(body)
200 contents.append(footer)
301 r_body.append('%s' % self.lineinfo.get())
302 … r_body.append('VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(')
303 r_body.append(' VkInstance instance,')
304 r_body.append(' const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,')
305 r_body.append(' const VkAllocationCallbacks* pAllocator,')
306 r_body.append(' VkDebugReportCallbackEXT* pCallback)')
307 r_body.append('{')
310 …r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_t…
311 …r_body.append(' VkResult result = pInstanceTable->CreateDebugReportCallbackEXT(instance, pCreat…
312 r_body.append(' if (VK_SUCCESS == result) {')
313 …r_body.append(' layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_dat…
314 r_body.append(' result = layer_create_msg_callback(my_data->report_data,')
315 r_body.append(' pCreateInfo,')
316 r_body.append(' pAllocator,')
317 r_body.append(' pCallback);')
318 r_body.append(' }')
319 r_body.append(' return result;')
321 …r_body.append(' VkResult result = instance_dispatch_table(instance)->CreateDebugReportCallbackE…
322 r_body.append(' if (VK_SUCCESS == result) {')
323 …r_body.append(' layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_dat…
324 …r_body.append(' result = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllo…
325 r_body.append(' }')
326 r_body.append(' return result;')
327 r_body.append('}')
332 r_body.append('%s' % self.lineinfo.get())
333 …r_body.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstan…
334 r_body.append('{')
337 …r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_t…
339 …r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = instance_dispatch_table(instance…
340 …r_body.append(' pInstanceTable->DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator…
341 …r_body.append(' layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_ma…
342 … r_body.append(' layer_destroy_msg_callback(my_data->report_data, msgCallback, pAllocator);')
343 r_body.append('}')
348 r_body.append('%s' % self.lineinfo.get())
349 …r_body.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT(VkInstance insta…
350 r_body.append('{')
353 …r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_t…
355 …r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = instance_dispatch_table(instance…
356 …r_body.append(' pInstanceTable->DebugReportMessageEXT(instance, flags, objType, object, locatio…
357 r_body.append('}')
363 ggep_body.append('%s' % self.lineinfo.get())
365 ggep_body.append('')
367 ggep_body.append('static const VkExtensionProperties instance_extensions[] = {')
368 ggep_body.append(' {')
369 ggep_body.append(' VK_EXT_DEBUG_REPORT_EXTENSION_NAME,')
370 ggep_body.append(' VK_EXT_DEBUG_REPORT_SPEC_VERSION')
371 ggep_body.append(' }')
372 ggep_body.append('};')
373 …ggep_body.append('VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPrope…
374 ggep_body.append('{')
376 …ggep_body.append(' return util_GetExtensionProperties(1, instance_extensions, pCount, pProperti…
378 ggep_body.append(' return util_GetExtensionProperties(0, NULL, pCount, pProperties);')
379 ggep_body.append('}')
386 ggep_body.append('%s' % self.lineinfo.get())
387 ggep_body.append('static const VkLayerProperties globalLayerProps[] = {')
388 ggep_body.append(' {')
390 ggep_body.append(' "VK_LAYER_GOOGLE_%s",' % layer)
391 ggep_body.append(' VK_LAYER_API_VERSION, // specVersion')
392 ggep_body.append(' 1, // implementationVersion')
393 ggep_body.append(' "Google Validation Layer"')
395 ggep_body.append(' "VK_LAYER_LUNARG_%s",' % layer)
396 ggep_body.append(' VK_LAYER_API_VERSION, // specVersion')
397 ggep_body.append(' 1, // implementationVersion')
398 ggep_body.append(' "LunarG Validation Layer"')
399 ggep_body.append(' }')
400 ggep_body.append('};')
401 ggep_body.append('')
402 ggep_body.append('%s' % self.lineinfo.get())
403 ggep_body.append('')
404 …ggep_body.append('VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerPropertie…
405 ggep_body.append('{')
406 …ggep_body.append(' return util_GetLayerProperties(ARRAY_SIZE(globalLayerProps), globalLayerProp…
407 ggep_body.append('}')
412 gpdlp_body.append('%s' % self.lineinfo.get())
413 gpdlp_body.append('static const VkLayerProperties deviceLayerProps[] = {')
414 gpdlp_body.append(' {')
416 gpdlp_body.append(' "VK_LAYER_GOOGLE_%s",' % layer)
417 gpdlp_body.append(' VK_LAYER_API_VERSION, // specVersion')
418 gpdlp_body.append(' 1, // implementationVersion')
419 gpdlp_body.append(' "Google Validation Layer"')
421 gpdlp_body.append(' "VK_LAYER_LUNARG_%s",' % layer)
422 gpdlp_body.append(' VK_LAYER_API_VERSION, // specVersion')
423 gpdlp_body.append(' 1, // implementationVersion')
424 gpdlp_body.append(' "LunarG Validation Layer"')
425 gpdlp_body.append(' }')
426 gpdlp_body.append('};')
427 …gpdlp_body.append('VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties…
428 gpdlp_body.append('{')
429 …gpdlp_body.append(' return util_GetLayerProperties(ARRAY_SIZE(deviceLayerProps), deviceLayerPro…
430 gpdlp_body.append('}')
431 gpdlp_body.append('')
454 funcs.append('/* CreateDevice HERE */')
463 funcs.append(intercept)
465 intercepted.append(proto)
470 lookups.append("if (!strcmp(name, \"%s\"))" % proto.name)
471 lookups.append(" return (PFN_vkVoidFunction) %s%s;" %
476 body.append('%s' % self.lineinfo.get())
477 body.append("static inline PFN_vkVoidFunction layer_intercept_proc(const char *name)")
478 body.append("{")
479 body.append(generate_get_proc_addr_check("name"))
480 body.append("")
481 body.append(" name += 2;")
482 body.append(" %s" % "\n ".join(lookups))
483 body.append("")
484 body.append(" return NULL;")
485 body.append("}")
498 lookups.append("if (!strcmp(name, \"%s\"))" % proto.name)
499 lookups.append(" return (PFN_vkVoidFunction) %s%s;" % (prefix, proto.name))
501 … body.append("static inline PFN_vkVoidFunction layer_intercept_instance_proc(const char *name)")
502 body.append("{")
503 body.append(generate_get_proc_addr_check("name"))
504 body.append("")
505 body.append(" name += 2;")
506 body.append(" %s" % "\n ".join(lookups))
507 body.append("")
508 body.append(" return NULL;")
509 body.append("}")
511 funcs.append("\n".join(body))
516 exts.append('%s' % self.lineinfo.get())
517 exts.append(self._gen_create_msg_callback())
518 exts.append(self._gen_destroy_msg_callback())
519 exts.append(self._gen_debug_report_msg())
528 …func_body.append("VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkD…
541 func_body.append('%s' % self.lineinfo.get())
542 …func_body.append(' layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer…
546 func_body.append(' if (my_device_data->%s) {' % ext_enable)
549 func_body.append(' %sif (!strcmp("%s", funcName))\n'
552 func_body.append(' }\n')
553 …func_body.append("\n if (get_dispatch_table(%s_device_table_map, device)->GetDeviceProcAddr == …
557 …func_body.append("VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(V…
581 …func_body.append(" layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data…
588 …func_body.append(" VkLayerInstanceDispatchTable* pTable = get_dispatch_table(%s_instance_table_…
590 … func_body.append(' if (instanceExtMap.size() != 0 && instanceExtMap[pTable].%s)' % ext_enable)
591 func_body.append(' {')
595 func_body.append('%s' % wsi_ifdef(ext_name))
596 func_body.append(' %sif (!strcmp("%s", funcName))\n'
599 func_body.append('%s' % wsi_endif(ext_name))
601 func_body.append(' }\n')
603 …func_body.append(" if (get_dispatch_table(%s_instance_table_map, instance)->GetInstanceProcAddr…
610 func_body.append('%s' % self.lineinfo.get())
611 …func_body.append("VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkD…
614 func_body.append("\n"
622 func_body.append(" if (device == VK_NULL_HANDLE) {\n"
625 func_body.append('')
626 func_body.append(' VkLayerDispatchTable *pDisp = device_dispatch_table(device);')
631 … func_body.append(' if (deviceExtMap.size() != 0 && deviceExtMap[pDisp].%s)' % ext_enable)
632 func_body.append(' {')
635 func_body.append(' %sif (!strcmp("%s", funcName))\n'
638 func_body.append(' }')
639 func_body.append('%s' % self.lineinfo.get())
640 func_body.append(" {\n"
646 func_body.append('%s' % self.lineinfo.get())
647 …func_body.append("VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(V…
657 func_body.append(
662 func_body.append(" if (instance == VK_NULL_HANDLE) {\n"
665 func_body.append("")
666 …func_body.append(" VkLayerInstanceDispatchTable* pTable = instance_dispatch_table(instance);\n")
672 …func_body.append(" layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data…
678 … func_body.append(' if (instanceExtMap.size() != 0 && instanceExtMap[pTable].%s)' % ext_enable)
679 func_body.append(' {')
683 func_body.append('%s' % wsi_ifdef(ext_name))
684 func_body.append(' %sif (!strcmp("%s", funcName))\n'
687 func_body.append('%s' % wsi_endif(ext_name))
689 func_body.append(' }\n')
691 func_body.append(" if (pTable->GetInstanceProcAddr == NULL)\n"
700 func_body.append('%s' % self.lineinfo.get())
701 …func_body.append('static void init_%s(layer_data *my_data, const VkAllocationCallbacks *pAllocator…
704 func_body.append('%s' % self.lineinfo.get())
705 func_body.append('')
706 …func_body.append(' layer_debug_actions(my_data->report_data, my_data->logging_callback, pAlloca…
707 func_body.append('')
709 func_body.append('%s' % self.lineinfo.get())
710 func_body.append(" if (!%sLockInitialized)" % lockname)
711 func_body.append(" {")
712 func_body.append(" // TODO/TBD: Need to delete this mutex sometime. How???")
713 func_body.append(" loader_platform_thread_create_mutex(&%sLock);" % lockname)
715 func_body.append(" loader_platform_thread_init_cond(&%sCond);" % condname)
716 func_body.append(" %sLockInitialized = 1;" % lockname)
717 func_body.append(" }")
718 func_body.append("}\n")
719 func_body.append('')
725 header_txt.append('%s' % self.lineinfo.get())
726 header_txt.append('#include <stdio.h>')
727 header_txt.append('#include <stdlib.h>')
728 header_txt.append('#include <string.h>')
729 header_txt.append('#include <inttypes.h>')
730 header_txt.append('')
731 header_txt.append('#include "vulkan/vulkan.h"')
732 header_txt.append('#include "vk_loader_platform.h"')
733 header_txt.append('')
734 header_txt.append('#include <unordered_map>')
735 header_txt.append('using namespace std;')
736 header_txt.append('#include "vulkan/vk_layer.h"')
737 header_txt.append('#include "vk_layer_config.h"')
738 header_txt.append('#include "vk_layer_table.h"')
739 header_txt.append('#include "vk_layer_data.h"')
740 header_txt.append('#include "vk_layer_logging.h"')
741 header_txt.append('')
743 header_txt.append('#include "object_tracker.h"')
744 header_txt.append('')
750 maps_txt.append('unordered_map<uint64_t, OBJTRACK_NODE*> %sMap;' % (o))
784 procs_txt.append('%s' % self.lineinfo.get())
788 …procs_txt.append('static void create_%s(%s dispatchable_object, %s vkObj, VkDebugReportObjectTypeE…
790 …procs_txt.append('static void create_%s(VkDevice dispatchable_object, %s vkObj, VkDebugReportObjec…
791 procs_txt.append('{')
792 …procs_txt.append(' log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_INFORMATION_BIT_EXT, objTy…
793 …procs_txt.append(' "OBJ[%llu] : CREATE %s object 0x%" PRIxLEAST64 , object_track_index++, s…
794 procs_txt.append(' (uint64_t)(vkObj));')
795 procs_txt.append('')
796 procs_txt.append(' OBJTRACK_NODE* pNewObjNode = new OBJTRACK_NODE;')
797 procs_txt.append(' pNewObjNode->belongsTo = (uint64_t)dispatchable_object;')
798 procs_txt.append(' pNewObjNode->objType = objType;')
799 procs_txt.append(' pNewObjNode->status = OBJSTATUS_NONE;')
800 procs_txt.append(' pNewObjNode->vkObj = (uint64_t)(vkObj);')
801 procs_txt.append(' %sMap[(uint64_t)vkObj] = pNewObjNode;' % (o))
802 procs_txt.append(' uint32_t objIndex = objTypeToIndex(objType);')
803 procs_txt.append(' numObjs[objIndex]++;')
804 procs_txt.append(' numTotalObjs++;')
805 procs_txt.append('}')
806 procs_txt.append('')
807 procs_txt.append('%s' % self.lineinfo.get())
809 … procs_txt.append('static void destroy_%s(%s dispatchable_object, %s object)' % (name, o, o))
811 … procs_txt.append('static void destroy_%s(VkDevice dispatchable_object, %s object)' % (name, o))
812 procs_txt.append('{')
813 procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
814 procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
815 procs_txt.append(' if (it != %sMap.end()) {' % o)
816 procs_txt.append(' OBJTRACK_NODE* pNode = it->second;')
817 procs_txt.append(' uint32_t objIndex = objTypeToIndex(pNode->objType);')
818 procs_txt.append(' assert(numTotalObjs > 0);')
819 procs_txt.append(' numTotalObjs--;')
820 procs_txt.append(' assert(numObjs[objIndex] > 0);')
821 procs_txt.append(' numObjs[objIndex]--;')
822 …procs_txt.append(' log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_INFORMATION_BIT_EXT, p…
823 …procs_txt.append(' "OBJ_STAT Destroy %s obj 0x%" PRIxLEAST64 " (%" PRIu64 " total objs r…
824 …procs_txt.append(' string_VkDebugReportObjectTypeEXT(pNode->objType), (uint64_t)(object…
825 procs_txt.append(' string_VkDebugReportObjectTypeEXT(pNode->objType));')
826 procs_txt.append(' delete pNode;')
827 procs_txt.append(' %sMap.erase(it);' % (o))
828 procs_txt.append(' } else {')
829 …procs_txt.append(' log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebu…
830 …procs_txt.append(' "Unable to remove obj 0x%" PRIxLEAST64 ". Was it created? Has it alr…
831 procs_txt.append(' object_handle);')
832 procs_txt.append(' }')
833 procs_txt.append('}')
834 procs_txt.append('')
835 procs_txt.append('%s' % self.lineinfo.get())
837 …procs_txt.append('static VkBool32 set_%s_status(%s dispatchable_object, %s object, VkDebugReportOb…
839 …procs_txt.append('static VkBool32 set_%s_status(VkDevice dispatchable_object, %s object, VkDebugRe…
840 procs_txt.append('{')
841 procs_txt.append(' if (object != VK_NULL_HANDLE) {')
842 procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
843 procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
844 procs_txt.append(' if (it != %sMap.end()) {' % o)
845 procs_txt.append(' it->second->status |= status_flag;')
846 procs_txt.append(' }')
847 procs_txt.append(' else {')
848 procs_txt.append(' // If we do not find it print an error')
849 …procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_E…
850 …procs_txt.append(' "Unable to set status for non-existent object 0x%" PRIxLEAST64 "…
851 … procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
852 procs_txt.append(' }')
853 procs_txt.append(' }')
854 procs_txt.append(' return VK_FALSE;')
855 procs_txt.append('}')
856 procs_txt.append('')
857 procs_txt.append('%s' % self.lineinfo.get())
858 procs_txt.append('static VkBool32 validate_%s_status(' % (name))
860 procs_txt.append('%s dispatchable_object, %s object,' % (o, o))
862 procs_txt.append('VkDevice dispatchable_object, %s object,' % (o))
863 procs_txt.append(' VkDebugReportObjectTypeEXT objType,')
864 procs_txt.append(' ObjectStatusFlags status_mask,')
865 procs_txt.append(' ObjectStatusFlags status_flag,')
866 procs_txt.append(' VkFlags msg_flags,')
867 procs_txt.append(' OBJECT_TRACK_ERROR error_code,')
868 procs_txt.append(' const char *fail_msg)')
869 procs_txt.append('{')
870 procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
871 procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
872 procs_txt.append(' if (it != %sMap.end()) {' % o)
873 procs_txt.append(' OBJTRACK_NODE* pNode = it->second;')
874 procs_txt.append(' if ((pNode->status & status_mask) != status_flag) {')
875 …procs_txt.append(' log_msg(mdd(dispatchable_object), msg_flags, pNode->objType, object_…
876 …procs_txt.append(' "OBJECT VALIDATION WARNING: %s object 0x%" PRIxLEAST64 ": %s", s…
877 procs_txt.append(' object_handle, fail_msg);')
878 procs_txt.append(' return VK_FALSE;')
879 procs_txt.append(' }')
880 procs_txt.append(' return VK_TRUE;')
881 procs_txt.append(' }')
882 procs_txt.append(' else {')
883 procs_txt.append(' // If we do not find it print an error')
884 …procs_txt.append(' log_msg(mdd(dispatchable_object), msg_flags, (VkDebugReportObjectTypeEXT…
885 …procs_txt.append(' "Unable to obtain status for non-existent object 0x%" PRIxLEAST64 " …
886 … procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
887 procs_txt.append(' return VK_FALSE;')
888 procs_txt.append(' }')
889 procs_txt.append('}')
890 procs_txt.append('')
891 procs_txt.append('%s' % self.lineinfo.get())
893 …procs_txt.append('static VkBool32 reset_%s_status(%s dispatchable_object, %s object, VkDebugReport…
895 …procs_txt.append('static VkBool32 reset_%s_status(VkDevice dispatchable_object, %s object, VkDebug…
896 procs_txt.append('{')
897 procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
898 procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
899 procs_txt.append(' if (it != %sMap.end()) {' % o)
900 procs_txt.append(' it->second->status &= ~status_flag;')
901 procs_txt.append(' }')
902 procs_txt.append(' else {')
903 procs_txt.append(' // If we do not find it print an error')
904 …procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, …
905 …procs_txt.append(' "Unable to reset status for non-existent object 0x%" PRIxLEAST64 " o…
906 … procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
907 procs_txt.append(' }')
908 procs_txt.append(' return VK_FALSE;')
909 procs_txt.append('}')
910 procs_txt.append('')
911 procs_txt.append('%s' % self.lineinfo.get())
916 procs_txt.append('//%s' % str(obj_use_dict))
921 procs_txt.append('%s' % self.lineinfo.get())
922 …procs_txt.append('static VkBool32 validate_%s(%s dispatchable_object, %s object, VkDebugReportObje…
923 procs_txt.append('{')
924 procs_txt.append(' if (null_allowed && (object == VK_NULL_HANDLE))')
925 procs_txt.append(' return VK_FALSE;')
926 procs_txt.append(' if (%sMap.find((uint64_t)object) == %sMap.end()) {' % (do, do))
927 …procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, …
928 … procs_txt.append(' "Invalid %s Object 0x%%" PRIx64 ,(uint64_t)(object));' % do)
929 procs_txt.append(' }')
930 procs_txt.append(' return VK_FALSE;')
931 procs_txt.append('}')
932 procs_txt.append('')
938 procs_txt.append('%s' % self.lineinfo.get())
939 …procs_txt.append('static VkBool32 validate_%s(%s dispatchable_object, %s object, VkDebugReportObje…
940 procs_txt.append('{')
941 procs_txt.append(' if (null_allowed && (object == VK_NULL_HANDLE))')
942 procs_txt.append(' return VK_FALSE;')
944 … procs_txt.append(' // We need to validate normal image objects and those from the swapchain')
945 … procs_txt.append(' if ((%sMap.find((uint64_t)object) == %sMap.end()) &&' % (o, o))
946 …procs_txt.append(' (swapchainImageMap.find((uint64_t)object) == swapchainImageMap.end())) {…
948 … procs_txt.append(' if (%sMap.find((uint64_t)object) == %sMap.end()) {' % (o, o))
949 …procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, …
950 … procs_txt.append(' "Invalid %s Object 0x%%" PRIx64, (uint64_t)(object));' % o)
951 procs_txt.append(' }')
952 procs_txt.append(' return VK_FALSE;')
953 procs_txt.append('}')
954 procs_txt.append('')
955 procs_txt.append('')
960 gedi_txt.append('%s' % self.lineinfo.get())
961 gedi_txt.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(')
962 gedi_txt.append('VkInstance instance,')
963 gedi_txt.append('const VkAllocationCallbacks* pAllocator)')
964 gedi_txt.append('{')
965 gedi_txt.append(' loader_platform_thread_lock_mutex(&objLock);')
966 …gedi_txt.append(' validate_instance(instance, instance, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EX…
967 gedi_txt.append('')
968 gedi_txt.append(' destroy_instance(instance, instance);')
969 gedi_txt.append(' // Report any remaining objects in LL')
970 gedi_txt.append('')
971 gedi_txt.append(' for (auto iit = VkDeviceMap.begin(); iit != VkDeviceMap.end();) {')
972 gedi_txt.append(' OBJTRACK_NODE* pNode = iit->second;')
973 gedi_txt.append(' if (pNode->belongsTo == (uint64_t)instance) {')
974 …gedi_txt.append(' log_msg(mid(instance), VK_DEBUG_REPORT_ERROR_BIT_EXT, pNode->objType,…
975 …gedi_txt.append(' "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not been destro…
976 gedi_txt.append(' pNode->vkObj);')
980 … gedi_txt.append(' for (auto idt = %sMap.begin(); idt != %sMap.end();) {' % (o, o))
981 gedi_txt.append(' OBJTRACK_NODE* pNode = idt->second;')
982 gedi_txt.append(' if (pNode->belongsTo == iit->first) {')
983 …gedi_txt.append(' log_msg(mid(instance), VK_DEBUG_REPORT_ERROR_BIT_EXT, pNode->…
984 …gedi_txt.append(' "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not bee…
985 gedi_txt.append(' pNode->vkObj);')
986 gedi_txt.append(' %sMap.erase(idt++);' % o )
987 gedi_txt.append(' } else {')
988 gedi_txt.append(' ++idt;')
989 gedi_txt.append(' }')
990 gedi_txt.append(' }')
991 gedi_txt.append(' VkDeviceMap.erase(iit++);')
992 gedi_txt.append(' } else {')
993 gedi_txt.append(' ++iit;')
994 gedi_txt.append(' }')
995 gedi_txt.append(' }')
996 gedi_txt.append('')
997 gedi_txt.append(' dispatch_key key = get_dispatch_key(instance);')
998 …gedi_txt.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(object_trac…
999 gedi_txt.append(' pInstanceTable->DestroyInstance(instance, pAllocator);')
1000 gedi_txt.append('')
1001 gedi_txt.append(' layer_data *my_data = get_my_data_ptr(key, layer_data_map);')
1002 gedi_txt.append(' // Clean up logging callback, if any')
1003 gedi_txt.append(' while (my_data->logging_callback.size() > 0) {')
1004 … gedi_txt.append(' VkDebugReportCallbackEXT callback = my_data->logging_callback.back();')
1005 … gedi_txt.append(' layer_destroy_msg_callback(my_data->report_data, callback, pAllocator);')
1006 gedi_txt.append(' my_data->logging_callback.pop_back();')
1007 gedi_txt.append(' }')
1008 gedi_txt.append('')
1009 gedi_txt.append(' layer_debug_report_destroy_instance(mid(instance));')
1010 gedi_txt.append(' layer_data_map.erase(pInstanceTable);')
1011 gedi_txt.append('')
1012 gedi_txt.append(' instanceExtMap.erase(pInstanceTable);')
1013 gedi_txt.append(' loader_platform_thread_unlock_mutex(&objLock);')
1015 gedi_txt.append(' object_tracker_instance_table_map.erase(key);')
1016 gedi_txt.append(' if (object_tracker_instance_table_map.empty()) {')
1017 gedi_txt.append(' // Release mutex when destroying last instance.')
1018 gedi_txt.append(' loader_platform_thread_delete_mutex(&objLock);')
1019 gedi_txt.append(' objLockInitialized = 0;')
1020 gedi_txt.append(' }')
1021 gedi_txt.append('}')
1022 gedi_txt.append('')
1027 gedd_txt.append('%s' % self.lineinfo.get())
1028 gedd_txt.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(')
1029 gedd_txt.append('VkDevice device,')
1030 gedd_txt.append('const VkAllocationCallbacks* pAllocator)')
1031 gedd_txt.append('{')
1032 gedd_txt.append(' loader_platform_thread_lock_mutex(&objLock);')
1033 …gedd_txt.append(' validate_device(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false…
1034 gedd_txt.append('')
1035 gedd_txt.append(' destroy_device(device, device);')
1036 … gedd_txt.append(' // Report any remaining objects associated with this VkDevice object in LL')
1041 gedd_txt.append(' for (auto it = %sMap.begin(); it != %sMap.end();) {' % (o, o))
1042 gedd_txt.append(' OBJTRACK_NODE* pNode = it->second;')
1043 gedd_txt.append(' if (pNode->belongsTo == (uint64_t)device) {')
1044 …gedd_txt.append(' log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, pNode->objType, p…
1045 …gedd_txt.append(' "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not been destro…
1046 gedd_txt.append(' pNode->vkObj);')
1047 gedd_txt.append(' %sMap.erase(it++);' % o )
1048 gedd_txt.append(' } else {')
1049 gedd_txt.append(' ++it;')
1050 gedd_txt.append(' }')
1051 gedd_txt.append(' }')
1052 gedd_txt.append('')
1053 gedd_txt.append(" // Clean up Queue's MemRef Linked Lists")
1054 gedd_txt.append(' destroyQueueMemRefLists();')
1055 gedd_txt.append('')
1056 gedd_txt.append(' loader_platform_thread_unlock_mutex(&objLock);')
1057 gedd_txt.append('')
1058 gedd_txt.append(' dispatch_key key = get_dispatch_key(device);')
1059 …gedd_txt.append(' VkLayerDispatchTable *pDisp = get_dispatch_table(object_tracker_device_table_…
1060 gedd_txt.append(' pDisp->DestroyDevice(device, pAllocator);')
1061 gedd_txt.append(' object_tracker_device_table_map.erase(key);')
1062 gedd_txt.append('')
1063 gedd_txt.append('}')
1064 gedd_txt.append('')
1226 loop_params[param_count].append(p.name)
1227 loop_types[param_count].append(str(p.ty[6:-1]))
1230 loop_params[0].append(p.name)
1231 loop_types[0].append(str(p.ty))
1254 … loop_params[param_count].append('%s,%s' % (loop_count, param_name))
1255 … loop_types[param_count].append('%s' % (vk_helper.struct_dict[struct_type][m]['type']))
1258 loop_params[loop_count].append(param_name)
1259 … loop_types[loop_count].append('%s' % (vk_helper.struct_dict[struct_type][m]['type']))
1262 loop_params[param_count].append(param_name)
1263 … loop_types[param_count].append('%s' % (vk_helper.struct_dict[struct_type][m]['type']))
1265 loop_params[0].append(param_name)
1266 … loop_types[0].append('%s' % (vk_helper.struct_dict[struct_type][m]['type']))
1275 funcs.append('%s\n' % self.lineinfo.get())
1277 funcs.append('%s%s\n'
1299 funcs.append('%s\n' % self.lineinfo.get())
1309 funcs.append('%s\n' % self.lineinfo.get())
1346 funcs.append('%s' % wsi_ifdef(proto.name))
1347 funcs.append('%s%s\n'
1356 funcs.append('%s' % wsi_endif(proto.name))
1417 header_txt.append('%s' % self.lineinfo.get())
1418 header_txt.append('#include "unique_objects.h"')
1548 funcs.append('%s%s\n'
1649 funcs.append('%s'