-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathCVulkanImage.cpp
More file actions
33 lines (26 loc) · 1.1 KB
/
CVulkanImage.cpp
File metadata and controls
33 lines (26 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "nbl/video/CVulkanImage.h"
#include "nbl/video/CVulkanSwapchain.h"
#include "nbl/video/CVulkanLogicalDevice.h"
namespace nbl::video
{
CVulkanImage::~CVulkanImage()
{
preDestroyStep();
if (!m_cachedCreationParams.skipHandleDestroy)
{
const CVulkanLogicalDevice* vulkanDevice = static_cast<const CVulkanLogicalDevice*>(getOriginDevice());
vulkanDevice->getFunctionTable()->vk.vkDestroyImage(vulkanDevice->getInternalObject(),getInternalObject(), nullptr);
}
}
void CVulkanImage::setObjectDebugName(const char* label) const
{
IBackendObject::setObjectDebugName(label);
if(vkSetDebugUtilsObjectNameEXT == 0) return;
const CVulkanLogicalDevice* vulkanDevice = static_cast<const CVulkanLogicalDevice*>(getOriginDevice());
VkDebugUtilsObjectNameInfoEXT nameInfo = {VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, nullptr};
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE;
nameInfo.objectHandle = reinterpret_cast<uint64_t>(getInternalObject());
nameInfo.pObjectName = getObjectDebugName();
vkSetDebugUtilsObjectNameEXT(vulkanDevice->getInternalObject(), &nameInfo);
}
}