mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
fixed delayed RHI buffer deletions
This commit is contained in:
parent
5c4cf3d720
commit
c937948f8f
1 changed files with 4 additions and 2 deletions
|
@ -3738,6 +3738,8 @@ namespace RHI
|
|||
backEnd.renderFrame = qtrue;
|
||||
}
|
||||
|
||||
rhi.buffersToDelete.Clear();
|
||||
|
||||
if(!destroyWindow)
|
||||
{
|
||||
WaitUntilDeviceIsIdle();
|
||||
|
@ -3918,7 +3920,7 @@ namespace RHI
|
|||
|
||||
for(uint32_t b = 0; b < rhi.buffersToDelete.count; )
|
||||
{
|
||||
if(rhi.buffersToDelete[b].beginFrameCounter >= rhi.beginFrameCounter)
|
||||
if(rhi.beginFrameCounter >= rhi.buffersToDelete[b].beginFrameCounter)
|
||||
{
|
||||
DestroyBuffer(rhi.buffersToDelete[b].buffer);
|
||||
rhi.buffersToDelete.Remove(b);
|
||||
|
@ -4120,7 +4122,7 @@ namespace RHI
|
|||
}
|
||||
|
||||
BufferToDelete b = {};
|
||||
b.beginFrameCounter = rhi.beginFrameCounter + 2;
|
||||
b.beginFrameCounter = rhi.beginFrameCounter + FrameCount + 1;
|
||||
b.buffer = buffer;
|
||||
rhi.buffersToDelete.Add(b);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue