Clean up cached_arraybases. Update VideoSW to new scheme.

Move ownership of cached_arraybases from CPMemory to VertexLoaderManager
to better match it usage.
This commit is contained in:
Scott Mansell
2015-05-30 00:42:45 +12:00
parent 6d916762fb
commit f57517f1a0
13 changed files with 48 additions and 35 deletions

View File

@ -16,6 +16,7 @@
#include "VideoCommon/DataReader.h"
#include "VideoCommon/OpcodeDecoding.h"
#include "VideoCommon/VertexLoaderBase.h"
#include "VideoCommon/VertexLoaderManager.h"
TEST(VertexLoaderUID, UniqueEnough)
{
@ -151,7 +152,7 @@ TEST_P(VertexLoaderParamTest, PositionAll)
Input<u8>(i);
else
Input<u16>(i);
cached_arraybases[ARRAY_POSITION] = m_src.GetPointer();
VertexLoaderManager::cached_arraybases[ARRAY_POSITION] = m_src.GetPointer();
g_main_cp_state.array_strides[ARRAY_POSITION] = elements * elem_size;
}
CreateAndCheckSizes(input_size, elements * sizeof(float));
@ -192,7 +193,7 @@ TEST_F(VertexLoaderTest, PositionIndex16FloatXY)
m_vtx_attr.g0.PosFormat = FORMAT_FLOAT;
CreateAndCheckSizes(sizeof(u16), 2 * sizeof(float));
Input<u16>(1); Input<u16>(0);
cached_arraybases[ARRAY_POSITION] = m_src.GetPointer();
VertexLoaderManager::cached_arraybases[ARRAY_POSITION] = m_src.GetPointer();
g_main_cp_state.array_strides[ARRAY_POSITION] = sizeof(float); // ;)
Input(1.f); Input(2.f); Input(3.f);
RunVertices(2);
@ -297,9 +298,9 @@ TEST_F(VertexLoaderTest, LargeFloatVertexSpeed)
CreateAndCheckSizes(33, 156);
for (int i = 0; i < 16; i++)
for (int i = 0; i < 12; i++)
{
cached_arraybases[i] = m_src.GetPointer();
VertexLoaderManager::cached_arraybases[i] = m_src.GetPointer();
g_main_cp_state.array_strides[i] = 129;
}