layers: Enable destroy_msg_callback dbg msgs
authorMark Lobodzinski <mark@lunarg.com>
Thu, 10 Nov 2016 16:12:57 +0000 (09:12 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Fri, 11 Nov 2016 20:00:01 +0000 (13:00 -0700)
These DEBUG_REPORT_DEBUG messages would never get printed as the
active_flags were zeroed out before the log_msg call. Temporarily
used the current callback's flags.

Change-Id: If1cc8ac2edb7dad9964049a7b755b4666f562104

layers/vk_layer_logging.h

index 1dd2c6d..f05d97d 100644 (file)
@@ -64,8 +64,8 @@ static inline void RemoveDebugMessageCallback(debug_report_data *debug_data, VkL
     VkLayerDbgFunctionNode *cur_callback = *list_head;
     VkLayerDbgFunctionNode *prev_callback = cur_callback;
     bool matched = false;
+    VkFlags local_flags = 0;
 
-    debug_data->active_flags = 0;
     while (cur_callback) {
         if (cur_callback->msgCallback == callback) {
             matched = true;
@@ -75,10 +75,10 @@ static inline void RemoveDebugMessageCallback(debug_report_data *debug_data, VkL
             }
             debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT,
                                  reinterpret_cast<uint64_t &>(cur_callback->msgCallback), 0, VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT,
-                                 "DebugReport", "Destroyed callback");
+                                 "DebugReport", "Destroyed callback\n");
         } else {
             matched = false;
-            debug_data->active_flags |= cur_callback->msgFlags;
+            local_flags |= cur_callback->msgFlags;
         }
         prev_callback = cur_callback;
         cur_callback = cur_callback->pNext;
@@ -86,6 +86,7 @@ static inline void RemoveDebugMessageCallback(debug_report_data *debug_data, VkL
             free(prev_callback);
         }
     }
+    debug_data->active_flags = local_flags;
 }
 
 // Removes all debug callback function nodes from the specified callback linked lists and frees their resources