Skip to content

Commit

Permalink
Add support for Vulkan native object debug and buffer device address
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBeckebans committed Feb 26, 2024
1 parent 15bf887 commit 13c2442
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/vulkan/vulkan-buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ namespace nvrhi::vulkan
buffer->desc = desc;
buffer->managed = false;

m_Context.nameVKObject(VkBuffer(buffer->buffer), vk::DebugReportObjectTypeEXT::eBuffer, desc.debugName.c_str());

if (!desc.isVirtual)
{
if (m_Context.extensions.buffer_device_address)
{
auto addressInfo = vk::BufferDeviceAddressInfo().setBuffer(buffer->buffer);

buffer->deviceAddress = m_Context.device.getBufferAddress(addressInfo);
}
}

return BufferHandle::Create(buffer);
}

Expand Down
2 changes: 2 additions & 0 deletions src/vulkan/vulkan-texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ namespace nvrhi::vulkan
texture->image = image;
texture->managed = false;

m_Context.nameVKObject(texture->image, vk::DebugReportObjectTypeEXT::eImage, desc.debugName.c_str());

return TextureHandle::Create(texture);
}

Expand Down

0 comments on commit 13c2442

Please sign in to comment.