Changes to allow LoadCPReg to work in a preprocess mode which affects a separate state.

This state will be used to calculate sizes for skipping over commands on
a separate thread.  An alternative to having these state variables would
be to have the preprocessor stash "state as we go" somewhere, but I
think that would be much uglier.

GetVertexSize now takes an extra argument to determine which state to
use, as does FifoCommandRunnable, which calls it.  While I'm modifying
FifoCommandRunnable, I also change it to take a buffer and size as
parameters rather than using g_pVideoData, which will also be necessary
later.  I also get rid of an unused overload.
This commit is contained in:
comex
2014-08-27 13:38:00 -04:00
parent f0131c2e09
commit e86ddacb18
5 changed files with 64 additions and 40 deletions

View File

@ -10,9 +10,12 @@
u8 *cached_arraybases[16];
CPState g_main_cp_state;
CPState g_preprocess_cp_state;
void DoCPState(PointerWrap& p)
{
// We don't save g_preprocess_cp_state separately because the GPU should be
// synced around state save/load.
p.DoArray(g_main_cp_state.array_bases, 16);
p.DoArray(g_main_cp_state.array_strides, 16);
p.Do(g_main_cp_state.matrix_index_a);
@ -20,4 +23,11 @@ void DoCPState(PointerWrap& p)
p.Do(g_main_cp_state.vtx_desc.Hex);
p.DoArray(g_main_cp_state.vtx_attr, 8);
p.DoMarker("CP Memory");
if (p.mode == PointerWrap::MODE_READ)
CopyPreprocessCPStateFromMain();
}
void CopyPreprocessCPStateFromMain()
{
memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
}