- 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

@ -37,12 +37,19 @@
#include "vulkan/renderer/vk_renderpass.h"
#include "vk_hwtexture.h"
VkHardwareTexture *VkHardwareTexture::First = nullptr;
VkHardwareTexture::VkHardwareTexture()
{
Next = First;
First = this;
if (Next) Next->Prev = this;
}
VkHardwareTexture::~VkHardwareTexture()
{
if (Next) Next->Prev = Prev;
if (!Prev) First = Next;
}
void VkHardwareTexture::Reset()