diff options
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) |
