ULRE/src/SceneGraph/Vulkan/VKTexture.cpp

21 lines
472 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<hgl/graph/VKTexture.h>
#include<hgl/graph/VKImageView.h>
#include<hgl/graph/VKMemory.h>
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);
}
}
VK_NAMESPACE_END