}
}
-/* TODO: Port to new type safety */
-#if 0
-// Check object status for selected flag state
-static VkBool32
-validate_status(
- VkObject dispatchable_object,
- VkObject vkObj,
- VkObjectType objType,
- ObjectStatusFlags status_mask,
- ObjectStatusFlags status_flag,
- VkFlags msg_flags,
- OBJECT_TRACK_ERROR error_code,
- const char *fail_msg)
-{
- if (objMap.find(vkObj) != objMap.end()) {
- OBJTRACK_NODE* pNode = objMap[vkObj];
- if ((pNode->status & status_mask) != status_flag) {
- char str[1024];
- log_msg(mdd(dispatchable_object), msg_flags, pNode->objType, vkObj, __LINE__, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK",
- "OBJECT VALIDATION WARNING: %s object 0x%" PRIxLEAST64 ": %s", string_VkObjectType(objType),
- static_cast<uint64_t>(vkObj), fail_msg);
- return VK_FALSE;
- }
- return VK_TRUE;
- }
- else {
- // If we do not find it print an error
- log_msg(mdd(dispatchable_object), msg_flags, (VkObjectType) 0, vkObj, __LINE__, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK",
- "Unable to obtain status for non-existent object 0x%" PRIxLEAST64 " of %s type",
- static_cast<uint64_t>(vkObj), string_VkObjectType(objType));
- return VK_FALSE;
- }
-}
-#endif
-
#include "vk_dispatch_table_helper.h"
static void init_object_tracker(layer_data *my_data, const VkAllocationCallbacks *pAllocator) {
ObjectStatusFlags status_flag);
static VkBool32 reset_device_memory_status(VkDevice dispatchable_object, VkDeviceMemory object, VkDebugReportObjectTypeEXT objType,
ObjectStatusFlags status_flag);
-#if 0
-static VkBool32 validate_status(VkDevice dispatchable_object, VkFence object, VkDebugReportObjectTypeEXT objType,
- ObjectStatusFlags status_mask, ObjectStatusFlags status_flag, VkFlags msg_flags, OBJECT_TRACK_ERROR error_code,
- const char *fail_msg);
-#endif
extern std::unordered_map<uint64_t, OBJTRACK_NODE *> VkPhysicalDeviceMap;
extern std::unordered_map<uint64_t, OBJTRACK_NODE *> VkDeviceMap;
extern std::unordered_map<uint64_t, OBJTRACK_NODE *> VkImageMap;
void **ppData) {
VkBool32 skipCall = VK_FALSE;
std::unique_lock<std::mutex> lock(global_lock);
- skipCall |= set_device_memory_status(device, mem, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, OBJSTATUS_GPU_MEM_MAPPED);
skipCall |= validate_device(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false);
lock.unlock();
if (skipCall == VK_TRUE)
void explicit_UnmapMemory(VkDevice device, VkDeviceMemory mem) {
VkBool32 skipCall = VK_FALSE;
std::unique_lock<std::mutex> lock(global_lock);
- skipCall |= reset_device_memory_status(device, mem, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, OBJSTATUS_GPU_MEM_MAPPED);
skipCall |= validate_device(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false);
lock.unlock();
if (skipCall == VK_TRUE)
-#!/usr/bin/env python3
+#!/usr/bin/env python3
#
# VK
#
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