- fix enough bugs to finally get some visuals

This commit is contained in:
Magnus Norddahl 2019-02-26 20:19:54 +01:00
commit fe67a2c24f
13 changed files with 93 additions and 19 deletions

View file

@ -5,6 +5,16 @@
#include "vulkan/renderer/vk_renderstate.h"
#include "doomerrors.h"
VKBuffer::~VKBuffer()
{
if (map)
mBuffer->Unmap();
auto fb = GetVulkanFrameBuffer();
if (fb && mBuffer)
fb->mFrameDeleteList.push_back(std::move(mBuffer));
}
void VKBuffer::SetData(size_t size, const void *data, bool staticdata)
{
auto fb = GetVulkanFrameBuffer();
@ -37,6 +47,8 @@ void VKBuffer::SetData(size_t size, const void *data, bool staticdata)
if (mPersistent)
{
map = mBuffer->Map(0, size);
if (data)
memcpy(map, data, size);
}
else if (data)
{