sysGCM: Fix for getNextCommandBufferBeginEnd

We were sometimes using memory outside of buffer.
It fixes vertex attribute test.
This commit is contained in:
vlj 2015-06-22 00:48:15 +02:00
parent 9a91b188df
commit 0993ee08e6
1 changed files with 1 additions and 1 deletions

View File

@ -1164,7 +1164,7 @@ s32 cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 co
static std::pair<u32, u32> getNextCommandBufferBeginEnd(u32 current)
{
size_t currentRange = (current - g_defaultCommandBufferBegin) / (32 * 1024);
if (currentRange >= g_defaultCommandBufferFragmentCount)
if (currentRange >= g_defaultCommandBufferFragmentCount - 1)
return std::make_pair(g_defaultCommandBufferBegin + 4096, g_defaultCommandBufferBegin + 32 * 1024 - 4);
return std::make_pair(g_defaultCommandBufferBegin + (currentRange + 1) * 32 * 1024,
g_defaultCommandBufferBegin + (currentRange + 2) * 32 * 1024 - 4);