Limit texture upload transfer buffers to roughly 64 MB
This commit is contained in:
parent
9aeb78ae97
commit
796890bb98
3 changed files with 38 additions and 19 deletions
|
|
@ -209,15 +209,21 @@ void VulkanFrameBuffer::Update()
|
|||
Super::Update();
|
||||
}
|
||||
|
||||
void VulkanFrameBuffer::DeleteFrameObjects()
|
||||
void VulkanFrameBuffer::DeleteFrameObjects(bool uploadOnly)
|
||||
{
|
||||
FrameDeleteList.Images.clear();
|
||||
FrameDeleteList.ImageViews.clear();
|
||||
FrameDeleteList.Framebuffers.clear();
|
||||
FrameDeleteList.Buffers.clear();
|
||||
FrameDeleteList.Descriptors.clear();
|
||||
FrameDeleteList.DescriptorPools.clear();
|
||||
FrameDeleteList.CommandBuffers.clear();
|
||||
FrameTextureUpload.Buffers.clear();
|
||||
FrameTextureUpload.TotalSize = 0;
|
||||
|
||||
if (!uploadOnly)
|
||||
{
|
||||
FrameDeleteList.Images.clear();
|
||||
FrameDeleteList.ImageViews.clear();
|
||||
FrameDeleteList.Framebuffers.clear();
|
||||
FrameDeleteList.Buffers.clear();
|
||||
FrameDeleteList.Descriptors.clear();
|
||||
FrameDeleteList.DescriptorPools.clear();
|
||||
FrameDeleteList.CommandBuffers.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish, bool lastsubmit)
|
||||
|
|
@ -251,11 +257,12 @@ void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t cou
|
|||
mNextSubmit++;
|
||||
}
|
||||
|
||||
void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit)
|
||||
void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit, bool uploadOnly)
|
||||
{
|
||||
mRenderState->EndRenderPass();
|
||||
if (!uploadOnly)
|
||||
mRenderState->EndRenderPass();
|
||||
|
||||
if (mDrawCommands || mTransferCommands)
|
||||
if ((!uploadOnly && mDrawCommands) || mTransferCommands)
|
||||
{
|
||||
VulkanCommandBuffer *commands[2];
|
||||
size_t count = 0;
|
||||
|
|
@ -267,7 +274,7 @@ void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit)
|
|||
FrameDeleteList.CommandBuffers.push_back(std::move(mTransferCommands));
|
||||
}
|
||||
|
||||
if (mDrawCommands)
|
||||
if (!uploadOnly && mDrawCommands)
|
||||
{
|
||||
mDrawCommands->end();
|
||||
commands[count++] = mDrawCommands.get();
|
||||
|
|
@ -280,7 +287,7 @@ void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit)
|
|||
}
|
||||
}
|
||||
|
||||
void VulkanFrameBuffer::WaitForCommands(bool finish)
|
||||
void VulkanFrameBuffer::WaitForCommands(bool finish, bool uploadOnly)
|
||||
{
|
||||
if (finish)
|
||||
{
|
||||
|
|
@ -292,7 +299,7 @@ void VulkanFrameBuffer::WaitForCommands(bool finish)
|
|||
mPostprocess->DrawPresentTexture(mOutputLetterbox, true, false);
|
||||
}
|
||||
|
||||
FlushCommands(finish, true);
|
||||
FlushCommands(finish, true, uploadOnly);
|
||||
|
||||
if (finish)
|
||||
{
|
||||
|
|
@ -310,7 +317,7 @@ void VulkanFrameBuffer::WaitForCommands(bool finish)
|
|||
vkResetFences(device->device, numWaitFences, mSubmitWaitFences);
|
||||
}
|
||||
|
||||
DeleteFrameObjects();
|
||||
DeleteFrameObjects(uploadOnly);
|
||||
mNextSubmit = 0;
|
||||
|
||||
if (finish)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue