summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Fifo.cpp
diff options
context:
space:
mode:
authorFiora <fioraaeterna@gmail.com>2014-12-08 18:49:57 -0800
committerFiora <fioraaeterna@gmail.com>2014-12-10 05:52:55 -0800
commit3effd08843efae54cf81b2d72cbb575d79b01346 (patch)
treef2ead9d1ad2801507aa5b4d900a68350ea2d0166 /Source/Core/VideoCommon/Fifo.cpp
parent4c139ca7cc816489feffc0b6ee0a3f1a6d85060e (diff)
FIFO: allocate slightly more for SIMD vertex loader overreads
May fix crashes in rare cases.
Diffstat (limited to 'Source/Core/VideoCommon/Fifo.cpp')
-rw-r--r--Source/Core/VideoCommon/Fifo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp
index 496ac0a851..9da3583a9d 100644
--- a/Source/Core/VideoCommon/Fifo.cpp
+++ b/Source/Core/VideoCommon/Fifo.cpp
@@ -94,7 +94,8 @@ void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock)
void Fifo_Init()
{
- s_video_buffer = (u8*)AllocateMemoryPages(FIFO_SIZE);
+ // Padded so that SIMD overreads in the vertex loader are safe
+ s_video_buffer = (u8*)AllocateMemoryPages(FIFO_SIZE + 4);
ResetVideoBuffer();
GpuRunningState = false;
Common::AtomicStore(CommandProcessor::VITicks, CommandProcessor::m_cpClockOrigin);
@@ -103,7 +104,7 @@ void Fifo_Init()
void Fifo_Shutdown()
{
if (GpuRunningState) PanicAlert("Fifo shutting down while active");
- FreeMemoryPages(s_video_buffer, FIFO_SIZE);
+ FreeMemoryPages(s_video_buffer, FIFO_SIZE + 4);
s_video_buffer = nullptr;
s_video_buffer_write_ptr = nullptr;
s_video_buffer_pp_read_ptr = nullptr;