- use a linked list to keep track of all allocated VkHardwareTexture objects

This commit is contained in:
Magnus Norddahl 2019-03-01 18:31:33 +01:00
commit 308c884d02
4 changed files with 16 additions and 7 deletions

View file

@ -66,6 +66,10 @@ VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevi
VulkanFrameBuffer::~VulkanFrameBuffer()
{
// All descriptors must be destroyed before the descriptor pool in renderpass manager is destroyed
for (VkHardwareTexture *cur = VkHardwareTexture::First; cur; cur = cur->Next)
cur->Reset();
delete MatricesUBO;
delete ColorsUBO;
delete GlowingWallsUBO;
@ -73,8 +77,6 @@ VulkanFrameBuffer::~VulkanFrameBuffer()
delete mSkyData;
delete mViewpoints;
delete mLights;
for (auto tex : AllTextures)
tex->Reset();
}
void VulkanFrameBuffer::InitializeState()
@ -277,9 +279,7 @@ void VulkanFrameBuffer::CleanForRestart()
IHardwareTexture *VulkanFrameBuffer::CreateHardwareTexture()
{
auto texture = new VkHardwareTexture();
AllTextures.Push(texture);
return texture;
return new VkHardwareTexture();
}
FModelRenderer *VulkanFrameBuffer::CreateModelRenderer(int mli)