Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 715b86ac authored by Jesse Hall's avatar Jesse Hall
Browse files

vulkan: Support VK_EXT_debug_report in loader and nulldrv

* Add extension to vulkan.api.
* Fix a few errors in upstream vk_ext_debug_report.h; bugs filed.
* Loader enumerates extension iff the driver supports it.
  - TODO: Also enumerate if any layers that support it are implicitly
    enabled.
  - Note extension may still be enabled if any layer supports it.
* Add loader bottom procs for the extension functions. These will call
  through to the driver version if the driver supports the extension.
* Add no-op support to nulldrv, mostly for testing the loader.

Change-Id: I092d2da56ee4c64498f8edae75e0d995478bb6f2
(cherry picked from commit a5ef7c27bc85e3628814532a32ffb9a5c33c4b73)
parent 6bd5dfa9
Loading
Loading
Loading
Loading
+108 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ define NULL_HANDLE 0
@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION     5
@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME             "VK_KHR_win32_surface"

@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION       2
@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME               "VK_EXT_debug_report"


/////////////
//  Types  //
@@ -121,6 +124,8 @@ type u32 VkSampleMask
@extension("VK_KHR_display")    @nonDispatchHandle type u64 VkDisplayKHR
@extension("VK_KHR_display")    @nonDispatchHandle type u64 VkDisplayModeKHR

@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT


/////////////
//  Enums  //
@@ -722,6 +727,46 @@ enum VkColorSpaceKHR {
    VK_COLORSPACE_SRGB_NONLINEAR_KHR                        = 0x00000000,
}

@extension("VK_EXT_debug_report")
enum VkDebugReportObjectTypeEXT {
    VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT                 = 0,
    VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT                = 1,
    VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT         = 2,
    VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT                  = 3,
    VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT                   = 4,
    VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT               = 5,
    VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT          = 6,
    VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT                   = 7,
    VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT           = 8,
    VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT                  = 9,
    VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT                   = 10,
    VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT                   = 11,
    VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT              = 12,
    VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT             = 13,
    VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT              = 14,
    VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT           = 15,
    VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT          = 16,
    VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT         = 17,
    VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT             = 18,
    VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT                = 19,
    VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT   = 20,
    VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT                 = 21,
    VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT         = 22,
    VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT          = 23,
    VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT             = 24,
    VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT            = 25,
    VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT             = 26,
    VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT           = 27,
    VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT            = 28,
}

@extension("VK_EXT_debug_report")
enum VkDebugReportErrorEXT {
    VK_DEBUG_REPORT_ERROR_NONE_EXT                          = 0,
    VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT                  = 1,
}


/////////////////
//  Bitfields  //
/////////////////
@@ -1249,6 +1294,17 @@ type VkFlags VkWin32SurfaceCreateFlagsKHR
//bitfield VkWin32SurfaceCreateFlagBitsKHR {
//}

@extension("VK_EXT_debug_report")
type VkFlags VkDebugReportFlagsEXT
@extension("VK_EXT_debug_report")
bitfield VkDebugReportFlagBitsEXT {
    VK_DEBUG_REPORT_INFO_BIT_EXT                            = 0x00000001,
    VK_DEBUG_REPORT_WARN_BIT_EXT                            = 0x00000002,
    VK_DEBUG_REPORT_PERF_WARN_BIT_EXT                       = 0x00000004,
    VK_DEBUG_REPORT_ERROR_BIT_EXT                           = 0x00000008,
    VK_DEBUG_REPORT_DEBUG_BIT_EXT                           = 0x00000010,
}


//////////////////
//  Structures  //
@@ -2534,6 +2590,15 @@ class VkWin32SurfaceCreateInfoKHR {
    platform.HWND                               hwnd
}

@extension("VK_EXT_debug_report")
class VkDebugReportCallbackCreateInfoEXT {
    VkStructureType                             sType
    const void*                                 pNext
    VkDebugReportFlagsEXT                       flags
    PFN_vkDebugReportCallbackEXT                pfnCallback
    void*                                       pUserData
}


////////////////
//  Commands  //
@@ -5068,6 +5133,49 @@ cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
    return ?
}

@extension("VK_EXT_debug_report")
@external type void* PFN_vkDebugReportCallbackEXT
@extension("VK_EXT_debug_report")
@pfn cmd VkBool32 vkDebugReportCallbackEXT(
        VkDebugReportFlagsEXT                   flags,
        VkDebugReportObjectTypeEXT              objectType,
        u64                                     object,
        platform.size_t                         location,
        s32                                     messageCode,
        const char*                             pLayerPrefix,
        const char*                             pMessage,
        void*                                   pUserData) {
    return ?
}

@extension("VK_EXT_debug_report")
cmd VkResult vkCreateDebugReportCallbackEXT(
        VkInstance                                  instance,
        const VkDebugReportCallbackCreateInfoEXT*   pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkDebugReportCallbackEXT*                   pCallback) {
    return ?
}

@extension("VK_EXT_debug_report")
cmd void vkDestroyDebugReportCallbackEXT(
        VkInstance                                  instance,
        VkDebugReportCallbackEXT                    callback,
        const VkAllocationCallbacks*                pAllocator) {
}

@extension("VK_EXT_debug_report")
cmd void vkDebugReportMessageEXT(
        VkInstance                                  instance,
        VkDebugReportFlagsEXT                       flags,
        VkDebugReportObjectTypeEXT                  objectType,
        u64                                         object,
        platform.size_t                             location,
        s32                                         messageCode,
        const char*                                 pLayerPrefix,
        const char*                                 pMessage) {
}


////////////////
// Validation //
+0 −182
Original line number Diff line number Diff line
//
// File: vk_debug_report_lunarg.h
//
/*
 * Vulkan
 *
 * Copyright (C) 2015 LunarG, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * Authors:
 *   Jon Ashburn <jon@lunarg.com>
 *   Courtney Goeltzenleuchter <courtney@lunarg.com>
 */

#ifndef __VK_DEBUG_REPORT_LUNARG_H__
#define __VK_DEBUG_REPORT_LUNARG_H__

#include "vulkan.h"

#define VK_DEBUG_REPORT_EXTENSION_NUMBER 5
#define VK_DEBUG_REPORT_EXTENSION_REVISION 1
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

/*
***************************************************************************************************
*   DebugReport Vulkan Extension API
***************************************************************************************************
*/
typedef enum {
    VK_OBJECT_TYPE_INSTANCE = 0,
    VK_OBJECT_TYPE_PHYSICAL_DEVICE = 1,
    VK_OBJECT_TYPE_DEVICE = 2,
    VK_OBJECT_TYPE_QUEUE = 3,
    VK_OBJECT_TYPE_COMMAND_BUFFER = 4,
    VK_OBJECT_TYPE_DEVICE_MEMORY = 5,
    VK_OBJECT_TYPE_BUFFER = 6,
    VK_OBJECT_TYPE_BUFFER_VIEW = 7,
    VK_OBJECT_TYPE_IMAGE = 8,
    VK_OBJECT_TYPE_IMAGE_VIEW = 9,
    VK_OBJECT_TYPE_ATTACHMENT_VIEW = 10,
    VK_OBJECT_TYPE_SHADER_MODULE = 12,
    VK_OBJECT_TYPE_SHADER = 13,
    VK_OBJECT_TYPE_PIPELINE = 14,
    VK_OBJECT_TYPE_PIPELINE_LAYOUT = 15,
    VK_OBJECT_TYPE_SAMPLER = 16,
    VK_OBJECT_TYPE_DESCRIPTOR_SET = 17,
    VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 18,
    VK_OBJECT_TYPE_DESCRIPTOR_POOL = 19,
    VK_OBJECT_TYPE_FENCE = 20,
    VK_OBJECT_TYPE_SEMAPHORE = 21,
    VK_OBJECT_TYPE_EVENT = 22,
    VK_OBJECT_TYPE_QUERY_POOL = 23,
    VK_OBJECT_TYPE_FRAMEBUFFER = 24,
    VK_OBJECT_TYPE_RENDER_PASS = 25,
    VK_OBJECT_TYPE_PIPELINE_CACHE = 26,
    VK_OBJECT_TYPE_SWAPCHAIN_KHR = 27,
    VK_OBJECT_TYPE_CMD_POOL = 28,
    VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_INSTANCE,
    VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_CMD_POOL,
    VK_OBJECT_TYPE_NUM = (VK_OBJECT_TYPE_CMD_POOL - VK_OBJECT_TYPE_INSTANCE + 1),
    VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
} VkDbgObjectType;

#define VK_DEBUG_REPORT_EXTENSION_NAME "DEBUG_REPORT"

VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDbgMsgCallback)

// ------------------------------------------------------------------------------------------------
// Enumerations

typedef enum VkDbgReportFlags_
{
    VK_DBG_REPORT_INFO_BIT       = 0x0001,
    VK_DBG_REPORT_WARN_BIT       = 0x0002,
    VK_DBG_REPORT_PERF_WARN_BIT  = 0x0004,
    VK_DBG_REPORT_ERROR_BIT      = 0x0008,
    VK_DBG_REPORT_DEBUG_BIT      = 0x0010,
} VkDbgReportFlags;

// Debug Report ERROR codes
typedef enum _DEBUG_REPORT_ERROR
{
    DEBUG_REPORT_NONE,                  // Used for INFO & other non-error messages
    DEBUG_REPORT_CALLBACK_REF,          // Callbacks were not destroyed prior to calling DestroyInstance
} DEBUG_REPORT_ERROR;

#define VK_DEBUG_REPORT_ENUM_EXTEND(type, id)    ((type)(VK_DEBUG_REPORT_EXTENSION_NUMBER * -1000 + (id)))

#define VK_OBJECT_TYPE_MSG_CALLBACK VK_DEBUG_REPORT_ENUM_EXTEND(VkDbgObjectType, 0)
#define VK_ERROR_VALIDATION_FAILED VK_DEBUG_REPORT_ENUM_EXTEND(VkResult, 0)

// ------------------------------------------------------------------------------------------------
// Vulkan function pointers

typedef VkBool32 (VKAPI_PTR *PFN_vkDbgMsgCallback)(
    VkFlags                             msgFlags,
    VkDbgObjectType                     objType,
    uint64_t                            srcObject,
    size_t                              location,
    int32_t                             msgCode,
    const char*                         pLayerPrefix,
    const char*                         pMsg,
    void*                               pUserData);

// ------------------------------------------------------------------------------------------------
// API functions

typedef VkResult (VKAPI_PTR *PFN_vkDbgCreateMsgCallback)(VkInstance instance, VkFlags msgFlags, const PFN_vkDbgMsgCallback pfnMsgCallback, void* pUserData, VkDbgMsgCallback* pMsgCallback);
typedef VkResult (VKAPI_PTR *PFN_vkDbgDestroyMsgCallback)(VkInstance instance, VkDbgMsgCallback msgCallback);

#ifdef VK_PROTOTYPES

// DebugReport extension entrypoints
VKAPI_ATTR VkResult VKAPI_CALL vkDbgCreateMsgCallback(
    VkInstance                          instance,
    VkFlags                             msgFlags,
    const PFN_vkDbgMsgCallback          pfnMsgCallback,
    void*                               pUserData,
    VkDbgMsgCallback*                   pMsgCallback);

VKAPI_ATTR VkResult VKAPI_CALL vkDbgDestroyMsgCallback(
    VkInstance                          instance,
    VkDbgMsgCallback                    msgCallback);

// DebugReport utility callback functions
VKAPI_ATTR void VKAPI_CALL vkDbgStringCallback(
    VkFlags                             msgFlags,
    VkDbgObjectType                     objType,
    uint64_t                            srcObject,
    size_t                              location,
    int32_t                             msgCode,
    const char*                         pLayerPrefix,
    const char*                         pMsg,
    void*                               pUserData);

VKAPI_ATTR void VKAPI_CALL vkDbgStdioCallback(
    VkFlags                             msgFlags,
    VkDbgObjectType                     objType,
    uint64_t                            srcObject,
    size_t                              location,
    int32_t                             msgCode,
    const char*                         pLayerPrefix,
    const char*                         pMsg,
    void*                               pUserData);

VKAPI_ATTR void VKAPI_CALL vkDbgBreakCallback(
    VkFlags                             msgFlags,
    VkDbgObjectType                     objType,
    uint64_t                            srcObject,
    size_t                              location,
    int32_t                             msgCode,
    const char*                         pLayerPrefix,
    const char*                         pMsg,
    void*                               pUserData);

#endif // VK_PROTOTYPES

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus

#endif // __VK_DEBUG_REPORT_LUNARG_H__
+5 −6
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ extern "C"
#define VK_EXT_debug_report 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT)

#define VK_EXT_DEBUG_REPORT_REVISION      2
#define VK_EXT_DEBUG_REPORT_EXTENSION_NUMBER 11
#define VK_EXT_DEBUG_REPORT_SPEC_VERSION    2
#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report"


@@ -85,8 +84,8 @@ typedef enum VkDebugReportObjectTypeEXT {
} VkDebugReportObjectTypeEXT;

typedef enum VkDebugReportErrorEXT {
    VK_DEBUG_REPORT_ERROR_NONE = 0,
    VK_DEBUG_REPORT_ERROR_CALLBACK_REF = 1,
    VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
    VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
} VkDebugReportErrorEXT;

typedef enum VkDebugReportFlagBitsEXT {
@@ -106,7 +105,7 @@ typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)(
    int32_t                                     messageCode,
    const char*                                 pLayerPrefix,
    const char*                                 pMessage,
    const void*                                 pUserData);
    void*                                       pUserData);


typedef struct VkDebugReportCallbackCreateInfoEXT {
@@ -114,7 +113,7 @@ typedef struct VkDebugReportCallbackCreateInfoEXT {
    const void*                                 pNext;
    VkDebugReportFlagsEXT                       flags;
    PFN_vkDebugReportCallbackEXT                pfnCallback;
    const void*                                 pUserData;
    void*                                       pUserData;
} VkDebugReportCallbackCreateInfoEXT;

typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback);
+7 −3
Original line number Diff line number Diff line
@@ -16,9 +16,12 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_CLANG := true
LOCAL_CFLAGS := -std=c99 -fvisibility=hidden -fstrict-aliasing
LOCAL_CFLAGS += -DLOG_TAG=\"vulkan\"
LOCAL_CFLAGS += -Weverything -Werror -Wno-padded -Wno-undef
LOCAL_CFLAGS := -DLOG_TAG=\"vulkan\" \
	-std=c99 -fvisibility=hidden -fstrict-aliasing \
	-Weverything -Werror \
	-Wno-padded \
	-Wno-undef
#LOCAL_CFLAGS += -DLOG_NDEBUG=0
LOCAL_CPPFLAGS := -std=c++14 \
	-Wno-c++98-compat-pedantic \
	-Wno-exit-time-destructors \
@@ -31,6 +34,7 @@ LOCAL_C_INCLUDES := \
	system/core/libsync/include

LOCAL_SRC_FILES := \
	debug_report.cpp \
	dispatch_gen.cpp \
	layers_extensions.cpp \
	loader.cpp \
+123 −0
Original line number Diff line number Diff line
/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "loader.h"

namespace vulkan {

VkResult DebugReportCallbackList::CreateCallback(
    VkInstance instance,
    const VkDebugReportCallbackCreateInfoEXT* create_info,
    const VkAllocationCallbacks* allocator,
    VkDebugReportCallbackEXT* callback) {
    VkDebugReportCallbackEXT driver_callback;
    VkResult result = GetDriverDispatch(instance).CreateDebugReportCallbackEXT(
        GetDriverInstance(instance), create_info, allocator, &driver_callback);
    if (result != VK_SUCCESS)
        return result;

    const VkAllocationCallbacks* alloc =
        allocator ? allocator : GetAllocator(instance);
    void* mem =
        alloc->pfnAllocation(alloc->pUserData, sizeof(Node), alignof(Node),
                             VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (!mem) {
        GetDriverDispatch(instance).DestroyDebugReportCallbackEXT(
            GetDriverInstance(instance), driver_callback, allocator);
        return VK_ERROR_OUT_OF_HOST_MEMORY;
    }

    std::lock_guard<decltype(rwmutex_)> lock(rwmutex_);
    head_.next =
        new (mem) Node{head_.next, create_info->flags, create_info->pfnCallback,
                       create_info->pUserData, driver_callback};
    *callback =
        VkDebugReportCallbackEXT(reinterpret_cast<uintptr_t>(head_.next));
    return VK_SUCCESS;
}

void DebugReportCallbackList::DestroyCallback(
    VkInstance instance,
    VkDebugReportCallbackEXT callback,
    const VkAllocationCallbacks* allocator) {
    Node* node = reinterpret_cast<Node*>(uintptr_t(callback));
    std::unique_lock<decltype(rwmutex_)> lock(rwmutex_);
    Node* prev = &head_;
    while (prev && prev->next != node)
        prev = prev->next;
    prev->next = node->next;
    lock.unlock();

    GetDriverDispatch(instance).DestroyDebugReportCallbackEXT(
        GetDriverInstance(instance), node->driver_callback, allocator);

    const VkAllocationCallbacks* alloc =
        allocator ? allocator : GetAllocator(instance);
    alloc->pfnFree(alloc->pUserData, node);
}

void DebugReportCallbackList::Message(VkDebugReportFlagsEXT flags,
                                      VkDebugReportObjectTypeEXT object_type,
                                      uint64_t object,
                                      size_t location,
                                      int32_t message_code,
                                      const char* layer_prefix,
                                      const char* message) {
    std::shared_lock<decltype(rwmutex_)> lock(rwmutex_);
    Node* node = &head_;
    while ((node = node->next)) {
        if ((node->flags & flags) != 0) {
            node->callback(flags, object_type, object, location, message_code,
                           layer_prefix, message, node->data);
        }
    }
}

VkResult CreateDebugReportCallbackEXT_Bottom(
    VkInstance instance,
    const VkDebugReportCallbackCreateInfoEXT* create_info,
    const VkAllocationCallbacks* allocator,
    VkDebugReportCallbackEXT* callback) {
    return GetDebugReportCallbacks(instance).CreateCallback(
        instance, create_info, allocator, callback);
}

void DestroyDebugReportCallbackEXT_Bottom(
    VkInstance instance,
    VkDebugReportCallbackEXT callback,
    const VkAllocationCallbacks* allocator) {
    if (callback)
        GetDebugReportCallbacks(instance).DestroyCallback(instance, callback,
                                                          allocator);
}

void DebugReportMessageEXT_Bottom(VkInstance instance,
                                  VkDebugReportFlagsEXT flags,
                                  VkDebugReportObjectTypeEXT object_type,
                                  uint64_t object,
                                  size_t location,
                                  int32_t message_code,
                                  const char* layer_prefix,
                                  const char* message) {
    GetDriverDispatch(instance).DebugReportMessageEXT(
        GetDriverInstance(instance), flags, object_type, object, location,
        message_code, layer_prefix, message);
    GetDebugReportCallbacks(instance).Message(flags, object_type, object,
                                              location, message_code,
                                              layer_prefix, message);
}

}  // namespace vulkan
Loading