summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-09-02 23:27:30 -0400
committercomex <comexk@gmail.com>2014-09-02 23:27:30 -0400
commitdd5be7c0dc14bfaa7972ce24d07d85bd7189a090 (patch)
tree87192193c99c7e6310d797dedeccddb1d24511cb /Source/Core/VideoCommon/VertexLoaderManager.cpp
parent031beca9c9dac810011b65f275fbb156d2c03362 (diff)
parent608f9bcd6724c77fef9be8e45ec8f14b49e2b3fb (diff)
Merge pull request #924 from comex/fifo-command-runnable
Refactor opcode decoding a bit to kill FifoCommandRunnable.
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)