diff options
| author | degasus <wickmarkus@web.de> | 2014-12-09 08:35:04 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-12-09 18:56:27 +0100 |
| commit | 3fc7e55cc4623c1c49efb4c317ab0202499bb5fd (patch) | |
| tree | 209e1cfa9fdd77efb6c4cead86c4b797b6d1edd1 /Source/Core/VideoCommon/VertexLoaderManager.cpp | |
| parent | 02cdb41d3d3eec73d2c843fe865ff906e01b44a4 (diff) | |
VideoCommon: clean up VertexLoader
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index 0262cafb2d..cf638c2495 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -130,24 +130,23 @@ static VertexLoader* RefreshLoader(int vtx_attr_group, CPState* state) return loader; } -bool RunVertices(int vtx_attr_group, int primitive, int count, DataReader& src, bool skip_drawing) +int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool skip_drawing) { if (!count) - return true; + return 0; CPState* state = &g_main_cp_state; VertexLoader* loader = RefreshLoader(vtx_attr_group, state); - size_t size = count * loader->GetVertexSize(); - if (src.size() < size) - return false; + int size = count * loader->GetVertexSize(); + if ((int)src.size() < size) + return -1; if (skip_drawing || (bpmem.genMode.cullmode == GenMode::CULL_ALL && primitive < 5)) { // if cull mode is CULL_ALL, ignore triangles and quads - src.Skip(size); - return true; + return size; } NativeVertexFormat* native = loader->GetNativeVertexFormat(); @@ -157,19 +156,18 @@ bool RunVertices(int vtx_attr_group, int primitive, int count, DataReader& src, VertexManager::Flush(); s_current_vtx_fmt = native; - VertexManager::PrepareForAdditionalData(primitive, count, + DataReader dst = VertexManager::PrepareForAdditionalData(primitive, count, loader->GetNativeVertexDeclaration().stride); - - src.WritePointer(&g_video_buffer_read_ptr); - loader->RunVertices(state->vtx_attr[vtx_attr_group], primitive, count); - src = g_video_buffer_read_ptr; + count = loader->RunVertices(state->vtx_attr[vtx_attr_group], primitive, count, src, dst); IndexGenerator::AddIndices(primitive, count); + VertexManager::FlushData(count, loader->GetNativeVertexDeclaration().stride); + ADDSTAT(stats.thisFrame.numPrims, count); INCSTAT(stats.thisFrame.numPrimitiveJoins); - return true; + return size; } int GetVertexSize(int vtx_attr_group, bool preprocess) |
