ULRE/src/SceneGraph/Vulkan/VKTexture.cpp

21 lines
472 B
C++
Raw Normal View History

#include<hgl/graph/VKTexture.h>
#include<hgl/graph/VKImageView.h>
#include<hgl/graph/VKMemory.h>
2019-05-18 15:41:49 +08:00
VK_NAMESPACE_BEGIN
Texture::~Texture()
{
if(!data)return;
if(data->image_view)
delete data->image_view;
if(data->memory) //没有memory的纹理都是从其它地方借来的所以就不存在删除
{
delete data->memory;
if(data->image)
vkDestroyImage(device,data->image,nullptr);
}
}
2019-05-18 15:41:49 +08:00
VK_NAMESPACE_END