inexorgame / vulkan-renderer

A new 3D game engine for Linux and Windows using C++20 and Vulkan API 1.3, in very early but ongoing development
https://inexor.org
MIT License
777 stars 34 forks source link

Refactor debug markers #456

Closed IAmNotHanni closed 1 year ago

IAmNotHanni commented 2 years ago

Is your feature request related to a problem?

Currently, we are using the following code for internal naming of Vulkan objects:

void Device::set_debug_marker_name(void *object, VkDebugReportObjectTypeEXT object_type,
                                   const std::string &name) const {
#ifndef NDEBUG
    if (!m_enable_vulkan_debug_markers) {
        return;
    }

    assert(object);
    assert(!name.empty());
    assert(m_vk_debug_marker_set_object_name);

    auto name_info = make_info<VkDebugMarkerObjectNameInfoEXT>();
    name_info.objectType = object_type;
    name_info.object = reinterpret_cast<std::uint64_t>(object); // NOLINT
    name_info.pObjectName = name.c_str();

    if (const auto result = m_vk_debug_marker_set_object_name(m_device, &name_info); result != VK_SUCCESS) {
        throw VulkanException("Failed to assign Vulkan debug marker name " + name + "!", result);
    }
#endif
}

Description

We must use a unified way of naming Vulkan objects in the code. This means

Alternatives

-

Affected Code

-

Operating System

-

Additional Context

none

IAmNotHanni commented 1 year ago

I close this because it's part of https://github.com/inexorgame/vulkan-renderer/issues/537