Skip to content
Permalink
Browse files
Merge pull request #6329 from stenzek/vulkan-crash
AbstractTexture: Fix crash in Vulkan backend when freeing texture
  • Loading branch information
degasus committed Jan 26, 2018
2 parents 9a6644d + 81ae88d commit 8d16a40
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
@@ -83,6 +83,7 @@ DXTexture::DXTexture(const TextureConfig& tex_config) : AbstractTexture(tex_conf

DXTexture::~DXTexture()
{
g_renderer->UnbindTexture(this);
m_texture->Release();
}

@@ -121,6 +121,7 @@ OGLTexture::OGLTexture(const TextureConfig& tex_config) : AbstractTexture(tex_co

OGLTexture::~OGLTexture()
{
g_renderer->UnbindTexture(this);
if (m_texId)
glDeleteTextures(1, &m_texId);

@@ -93,7 +93,7 @@ std::unique_ptr<VKTexture> VKTexture::Create(const TextureConfig& tex_config)
VKTexture::~VKTexture()
{
// Texture is automatically cleaned up, however, we don't want to leave it bound.
StateTracker::GetInstance()->UnbindTexture(m_texture->GetView());
g_renderer->UnbindTexture(this);
if (m_framebuffer != VK_NULL_HANDLE)
g_command_buffer_mgr->DeferFramebufferDestruction(m_framebuffer);
}
@@ -15,11 +15,6 @@ AbstractTexture::AbstractTexture(const TextureConfig& c) : m_config(c)
{
}

AbstractTexture::~AbstractTexture()
{
g_renderer->UnbindTexture(this);
}

bool AbstractTexture::Save(const std::string& filename, unsigned int level)
{
// We can't dump compressed textures currently (it would mean drawing them to a RGBA8
@@ -15,7 +15,7 @@ class AbstractTexture
{
public:
explicit AbstractTexture(const TextureConfig& c);
virtual ~AbstractTexture();
virtual ~AbstractTexture() = default;

virtual void CopyRectangleFromTexture(const AbstractTexture* src,
const MathUtil::Rectangle<int>& src_rect, u32 src_layer,

0 comments on commit 8d16a40

Please sign in to comment.