summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-01-30 14:48:23 +0100
committerdegasus <wickmarkus@web.de>2014-01-31 07:31:03 +0100
commit3437c7f060a63b13f0f353949a53a0be25ad4585 (patch)
treeb92d16fd6c9f4a1b75e4588d58b8ce413d6cfead /Source/Core/VideoCommon/VertexLoader.cpp
parent010a0d481ad0f5dd19182eafc411feec387404db (diff)
VideoCommon: small VertexLoader(Manager)? refactoring
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index 03f480dac8..a2825da1c7 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -19,6 +19,7 @@
#include "BPMemory.h"
#include "DataReader.h"
#include "VertexManagerBase.h"
+#include "IndexGenerator.h"
#include "VertexLoader_Position.h"
#include "VertexLoader_Normal.h"
@@ -836,7 +837,7 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
}
#endif
-int VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const count)
+void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const count)
{
m_numLoadedVertices += count;
@@ -851,13 +852,6 @@ int VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const
}
g_nativeVertexFmt = m_NativeFmt;
- if (bpmem.genMode.cullmode == 3 && primitive < 5)
- {
- // if cull mode is none, ignore triangles and quads
- DataSkip(count * m_VertexSize);
- return 0;
- }
-
// Load position and texcoord scale factors.
m_VtxAttr.PosFrac = g_VtxAttr[vtx_attr_group].g0.PosFrac;
m_VtxAttr.texCoord[0].Frac = g_VtxAttr[vtx_attr_group].g0.Tex0Frac;
@@ -881,17 +875,6 @@ int VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const
s_bbox_primitive = primitive;
s_bbox_currPoint = 0;
s_bbox_loadedPoints = 0;
-
- VertexManager::PrepareForAdditionalData(primitive, count, native_stride);
-
- return count;
-}
-
-void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int const count)
-{
- auto const new_count = SetupRunVertices(vtx_attr_group, primitive, count);
- ConvertVertices(new_count);
- VertexManager::AddVertices(primitive, new_count);
}
void VertexLoader::ConvertVertices ( int count )
@@ -915,6 +898,23 @@ void VertexLoader::ConvertVertices ( int count )
#endif
}
+void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int const count)
+{
+ if (bpmem.genMode.cullmode == 3 && primitive < 5)
+ {
+ // if cull mode is none, ignore triangles and quads
+ DataSkip(count * m_VertexSize);
+ return;
+ }
+ SetupRunVertices(vtx_attr_group, primitive, count);
+ VertexManager::PrepareForAdditionalData(primitive, count, native_stride);
+ ConvertVertices(count);
+ IndexGenerator::AddIndices(primitive, count);
+
+ ADDSTAT(stats.thisFrame.numPrims, count);
+ INCSTAT(stats.thisFrame.numPrimitiveJoins);
+}
+
void VertexLoader::SetVAT(u32 _group0, u32 _group1, u32 _group2)
{
VAT vat;