vk: make sure default render target is not removed (#9213)
We need to have an reference to the default render target for the duration of the backend lifetime. So even if the client tries to destroy the default render target, we don't actually destroy it. Note that it will be destroyed on driver shutdown.
This commit is contained in:
@@ -818,10 +818,8 @@ void VulkanDriver::destroyRenderTarget(Handle<HwRenderTarget> rth) {
|
||||
}
|
||||
|
||||
auto rt = resource_ptr<VulkanRenderTarget>::cast(&mResourceManager, rth);
|
||||
if (UTILS_UNLIKELY(rt == mDefaultRenderTarget)) {
|
||||
// Note that this should only happen on driver shutdown.
|
||||
mDefaultRenderTarget = {};
|
||||
} else {
|
||||
// Note that the default render target will be destroyed on shutdown
|
||||
if (UTILS_LIKELY(rt != mDefaultRenderTarget)) {
|
||||
rt.dec();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user