diff options
| author | comex <comexk@gmail.com> | 2014-09-28 21:59:27 -0400 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2014-09-28 21:59:27 -0400 |
| commit | fbabc03b3f684d57cc25bd8b86c0b1d30a237bb8 (patch) | |
| tree | 64695c3c67d9f975b7e1c7835e0e405620a562e9 /Source/Core/VideoCommon/XFStructs.cpp | |
| parent | 431fb4d82a9fa9597df3c35c27e55714ff3e27c0 (diff) | |
| parent | 6c0a68d50765c24a205f7133205b54c26ae1bbfb (diff) | |
Merge pull request #885 from comex/gpu-determinism
GPU determinism (apparently it is ready for merge)
Diffstat (limited to 'Source/Core/VideoCommon/XFStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/XFStructs.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index 650a4a913b..0552aa0986 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -6,6 +6,7 @@ #include "Core/HW/Memmap.h" #include "VideoCommon/CPMemory.h" #include "VideoCommon/DataReader.h" +#include "VideoCommon/Fifo.h" #include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VertexShaderManager.h" @@ -252,7 +253,15 @@ void LoadIndexedXF(u32 val, int refarray) //load stuff from array to address in xf mem u32* currData = (u32*)(&xfmem) + address; - u32* newData = (u32*)Memory::GetPointer(arraybases[refarray] + arraystrides[refarray] * index); + u32* newData; + if (g_use_deterministic_gpu_thread) + { + newData = (u32*)PopFifoAuxBuffer(size * sizeof(u32)); + } + else + { + newData = (u32*)Memory::GetPointer(g_main_cp_state.array_bases[refarray] + g_main_cp_state.array_strides[refarray] * index); + } bool changed = false; for (int i = 0; i < size; ++i) { @@ -269,3 +278,14 @@ void LoadIndexedXF(u32 val, int refarray) currData[i] = Common::swap32(newData[i]); } } + +void PreprocessIndexedXF(u32 val, int refarray) +{ + int index = val >> 16; + int size = ((val >> 12) & 0xF) + 1; + + u32* new_data = (u32*)Memory::GetPointer(g_preprocess_cp_state.array_bases[refarray] + g_preprocess_cp_state.array_strides[refarray] * index); + + size_t buf_size = size * sizeof(u32); + PushFifoAuxBuffer(new_data, buf_size); +} |
