mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
AbstractTexture: Fix crash in Vulkan backend when freeing texture
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user