Skip to content

Commit

Permalink
fixed wrong draw up allocation logic
Browse files Browse the repository at this point in the history
also added ranged unlock to save some performance
  • Loading branch information
megai2 committed Jul 28, 2019
1 parent 143019e commit 0ecada6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions d912pxy/d912pxy_draw_up.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ UINT d912pxy_draw_up::BufferWrite(d912pxy_draw_up_buffer_name bid, UINT size, co
if ((tmpWP + size) >= buf[bid].endPoint)
{
UINT32 len = buf[bid].vstream->GetLength();
len = (len * 2) > 0x7FFFFFF ? 0x7FFFFFF : (len * 2);
len *= 2;

buf[bid].vstream->Unlock();
len = size > len ? size * 2 : len;

len = len >= 0x7FFFFFF ? 0x7FFFFFF : len;

buf[bid].vstream->UnlockRanged(0, buf[bid].offset);
buf[bid].vstream->Release();

AllocateBuffer(bid, len);
Expand Down

0 comments on commit 0ecada6

Please sign in to comment.