layers: ObjectTracker dead code elimination
Change-Id: I3244f8da58a7f150ebfa772a7c131422f75d0d8b
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index 9537e9f..3a07ce9 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python3
#
# VK
#
@@ -818,83 +818,6 @@
procs_txt.append(' }')
procs_txt.append('}')
procs_txt.append('')
- procs_txt.append('%s' % self.lineinfo.get())
- if o in vulkan.object_dispatch_list:
- procs_txt.append('static VkBool32 set_%s_status(%s dispatchable_object, %s object, VkDebugReportObjectTypeEXT objType, ObjectStatusFlags status_flag)' % (name, o, o))
- else:
- procs_txt.append('static VkBool32 set_%s_status(VkDevice dispatchable_object, %s object, VkDebugReportObjectTypeEXT objType, ObjectStatusFlags status_flag)' % (name, o))
- procs_txt.append('{')
- procs_txt.append(' if (object != VK_NULL_HANDLE) {')
- procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
- procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
- procs_txt.append(' if (it != %sMap.end()) {' % o)
- procs_txt.append(' it->second->status |= status_flag;')
- procs_txt.append(' }')
- procs_txt.append(' else {')
- procs_txt.append(' // If we do not find it print an error')
- procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT ) 0, object_handle, __LINE__, OBJTRACK_NONE, "OBJTRACK",')
- procs_txt.append(' "Unable to set status for non-existent object 0x%" PRIxLEAST64 " of %s type",')
- procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
- procs_txt.append(' }')
- procs_txt.append(' }')
- procs_txt.append(' return VK_FALSE;')
- procs_txt.append('}')
- procs_txt.append('')
- procs_txt.append('%s' % self.lineinfo.get())
- procs_txt.append('static VkBool32 validate_%s_status(' % (name))
- if o in vulkan.object_dispatch_list:
- procs_txt.append('%s dispatchable_object, %s object,' % (o, o))
- else:
- procs_txt.append('VkDevice dispatchable_object, %s object,' % (o))
- procs_txt.append(' VkDebugReportObjectTypeEXT objType,')
- procs_txt.append(' ObjectStatusFlags status_mask,')
- procs_txt.append(' ObjectStatusFlags status_flag,')
- procs_txt.append(' VkFlags msg_flags,')
- procs_txt.append(' OBJECT_TRACK_ERROR error_code,')
- procs_txt.append(' const char *fail_msg)')
- procs_txt.append('{')
- procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
- procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
- procs_txt.append(' if (it != %sMap.end()) {' % o)
- procs_txt.append(' OBJTRACK_NODE* pNode = it->second;')
- procs_txt.append(' if ((pNode->status & status_mask) != status_flag) {')
- procs_txt.append(' log_msg(mdd(dispatchable_object), msg_flags, pNode->objType, object_handle, __LINE__, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK",')
- procs_txt.append(' "OBJECT VALIDATION WARNING: %s object 0x%" PRIxLEAST64 ": %s", string_VkDebugReportObjectTypeEXT(objType),')
- procs_txt.append(' object_handle, fail_msg);')
- procs_txt.append(' return VK_FALSE;')
- procs_txt.append(' }')
- procs_txt.append(' return VK_TRUE;')
- procs_txt.append(' }')
- procs_txt.append(' else {')
- procs_txt.append(' // If we do not find it print an error')
- procs_txt.append(' log_msg(mdd(dispatchable_object), msg_flags, (VkDebugReportObjectTypeEXT) 0, object_handle, __LINE__, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK",')
- procs_txt.append(' "Unable to obtain status for non-existent object 0x%" PRIxLEAST64 " of %s type",')
- procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
- procs_txt.append(' return VK_FALSE;')
- procs_txt.append(' }')
- procs_txt.append('}')
- procs_txt.append('')
- procs_txt.append('%s' % self.lineinfo.get())
- if o in vulkan.object_dispatch_list:
- procs_txt.append('static VkBool32 reset_%s_status(%s dispatchable_object, %s object, VkDebugReportObjectTypeEXT objType, ObjectStatusFlags status_flag)' % (name, o, o))
- else:
- procs_txt.append('static VkBool32 reset_%s_status(VkDevice dispatchable_object, %s object, VkDebugReportObjectTypeEXT objType, ObjectStatusFlags status_flag)' % (name, o))
- procs_txt.append('{')
- procs_txt.append(' uint64_t object_handle = (uint64_t)(object);')
- procs_txt.append(' auto it = %sMap.find(object_handle);' % o)
- procs_txt.append(' if (it != %sMap.end()) {' % o)
- procs_txt.append(' it->second->status &= ~status_flag;')
- procs_txt.append(' }')
- procs_txt.append(' else {')
- procs_txt.append(' // If we do not find it print an error')
- procs_txt.append(' return log_msg(mdd(dispatchable_object), VK_DEBUG_REPORT_ERROR_BIT_EXT, objType, object_handle, __LINE__, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK",')
- procs_txt.append(' "Unable to reset status for non-existent object 0x%" PRIxLEAST64 " of %s type",')
- procs_txt.append(' object_handle, string_VkDebugReportObjectTypeEXT(objType));')
- procs_txt.append(' }')
- procs_txt.append(' return VK_FALSE;')
- procs_txt.append('}')
- procs_txt.append('')
- procs_txt.append('%s' % self.lineinfo.get())
# Generate the permutations of validate_* functions where for each
# dispatchable object type, we have a corresponding validate_* function
# for that object and all non-dispatchable objects that are used in API