summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index b74fc029db..7ff21d103b 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -151,17 +151,21 @@ static VertexLoaderCacheItem RefreshLoader(int vtx_attr_group)
return s_VertexLoaders[vtx_attr_group];
}
-void RunVertices(int vtx_attr_group, int primitive, int count)
+bool RunVertices(int vtx_attr_group, int primitive, int count, size_t buf_size)
{
if (!count)
- return;
+ return true;
auto loader = RefreshLoader(vtx_attr_group);
+ size_t size = count * loader.first->GetVertexSize();
+ if (buf_size < size)
+ return false;
+
if (bpmem.genMode.cullmode == GenMode::CULL_ALL && primitive < 5)
{
// if cull mode is CULL_ALL, ignore triangles and quads
- DataSkip(count * loader.first->GetVertexSize());
- return;
+ DataSkip((u32)size);
+ return true;
}
// If the native vertex format changed, force a flush.
@@ -178,6 +182,7 @@ void RunVertices(int vtx_attr_group, int primitive, int count)
ADDSTAT(stats.thisFrame.numPrims, count);
INCSTAT(stats.thisFrame.numPrimitiveJoins);
+ return true;
}
int GetVertexSize(int vtx_attr_group)