Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor debug markers #456

Closed
IAmNotHanni opened this issue Mar 13, 2022 · 1 comment
Closed

Refactor debug markers #456

IAmNotHanni opened this issue Mar 13, 2022 · 1 comment
Labels
cat:refactor refactor/clean up/simplifications/etc. prio:low This has low priority.

Comments

@IAmNotHanni
Copy link
Member

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

  • Take the name as a std::string and std::move it
  • Use VK_EXT_debug_utils

Alternatives

Affected Code

Operating System

Additional Context

none

@IAmNotHanni
Copy link
Member Author

I close this because it's part of #537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:refactor refactor/clean up/simplifications/etc. prio:low This has low priority.
Projects
None yet
Development

No branches or pull requests

1 participant