#include "vk_debug_report.h"
#include "vk_alloc.h"
+#include "vk_common_entrypoints.h"
+#include "vk_instance.h"
#include "vk_util.h"
VkResult vk_debug_report_instance_init(struct vk_debug_report_instance *instance)
mtx_unlock(&instance->callbacks_mutex);
}
+
+VkResult
+vk_common_CreateDebugReportCallbackEXT(VkInstance _instance,
+ const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkDebugReportCallbackEXT *pCallback)
+{
+ VK_FROM_HANDLE(vk_instance, instance, _instance);
+ return vk_create_debug_report_callback(&instance->debug_report,
+ pCreateInfo, pAllocator,
+ &instance->alloc,
+ pCallback);
+}
+
+void
+vk_common_DestroyDebugReportCallbackEXT(VkInstance _instance,
+ VkDebugReportCallbackEXT callback,
+ const VkAllocationCallbacks *pAllocator)
+{
+ VK_FROM_HANDLE(vk_instance, instance, _instance);
+ vk_destroy_debug_report_callback(&instance->debug_report, callback,
+ pAllocator, &instance->alloc);
+}
+
+void
+vk_common_DebugReportMessageEXT(VkInstance _instance,
+ VkDebugReportFlagsEXT flags,
+ VkDebugReportObjectTypeEXT objectType,
+ uint64_t object,
+ size_t location,
+ int32_t messageCode,
+ const char* pLayerPrefix,
+ const char* pMessage)
+{
+ VK_FROM_HANDLE(vk_instance, instance, _instance);
+ vk_debug_report(&instance->debug_report, flags, objectType,
+ object, location, messageCode, pLayerPrefix, pMessage);
+}
&instance->dispatch_table, &vk_common_instance_entrypoints, false);
}
- return VK_SUCCESS;
+ return vk_debug_report_instance_init(&instance->debug_report);
}
void
vk_instance_finish(struct vk_instance *instance)
{
+ vk_debug_report_instance_destroy(&instance->debug_report);
vk_free(&instance->alloc, (char *)instance->app_info.app_name);
vk_free(&instance->alloc, (char *)instance->app_info.engine_name);
vk_object_base_finish(&instance->base);
#ifndef VK_INSTANCE_H
#define VK_INSTANCE_H
+#include "vk_debug_report.h"
#include "vk_dispatch_table.h"
#include "vk_extensions.h"
#include "vk_object.h"
struct vk_instance_extension_table enabled_extensions;
struct vk_instance_dispatch_table dispatch_table;
+
+ struct vk_debug_report_instance debug_report;
};
VK_DEFINE_HANDLE_CASTS(vk_instance, base, VkInstance,