VertexLoader: Remove more global state dependencies (this time IndexGenerator and VertexManager)

This commit is contained in:
Pierre Bourdon 2014-08-01 23:42:15 -07:00
parent 8b26d7bf1e
commit 6f715a1fbe
2 changed files with 10 additions and 10 deletions

View File

@ -12,16 +12,13 @@
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/DataReader.h"
#include "VideoCommon/IndexGenerator.h"
#include "VideoCommon/LookUpTables.h"
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexLoader.h"
#include "VideoCommon/VertexLoader_Color.h"
#include "VideoCommon/VertexLoader_Normal.h"
#include "VideoCommon/VertexLoader_Position.h"
#include "VideoCommon/VertexLoader_TextCoord.h"
#include "VideoCommon/VertexLoaderManager.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
@ -866,13 +863,7 @@ void VertexLoader::RunVertices(const VAT& vat, int primitive, int const count)
return;
}
SetupRunVertices(vat, primitive, count);
VertexManager::PrepareForAdditionalData(primitive, count,
m_native_vtx_decl.stride);
ConvertVertices(count);
IndexGenerator::AddIndices(primitive, count);
ADDSTAT(stats.thisFrame.numPrims, count);
INCSTAT(stats.thisFrame.numPrimitiveJoins);
}
void VertexLoader::SetVAT(const VAT& vat)

View File

@ -9,6 +9,7 @@
#include "Core/HW/Memmap.h"
#include "VideoCommon/IndexGenerator.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexLoader.h"
#include "VideoCommon/VertexLoaderManager.h"
@ -152,7 +153,15 @@ void RunVertices(int vtx_attr_group, int primitive, int count)
VertexManager::Flush();
s_current_vtx_fmt = required_vtx_fmt;
RefreshLoader(vtx_attr_group)->RunVertices(g_VtxAttr[vtx_attr_group], primitive, count);
VertexManager::PrepareForAdditionalData(primitive, count,
loader->GetNativeVertexDeclaration().stride);
loader->RunVertices(g_VtxAttr[vtx_attr_group], primitive, count);
IndexGenerator::AddIndices(primitive, count);
ADDSTAT(stats.thisFrame.numPrims, count);
INCSTAT(stats.thisFrame.numPrimitiveJoins);
}
int GetVertexSize(int vtx_attr_group)