summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexLoader.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-02-26 22:47:50 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-02-27 01:57:02 -0600
commit6b80e6f83cf4557eff89402484c1d5b2f5606a5f (patch)
tree4004d63325fafb51c254b454ac517cdffc9f7849 /Source/Core/VideoCommon/Src/VertexLoader.cpp
parentbd14ad5300c3c708d564d039298d1190ba332e22 (diff)
Tweak Vertex/Index buffer handling a bit.
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp
index 7d1b9d99a5..ca128b4f86 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp
@@ -517,7 +517,7 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
#endif
}
-void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
+void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int const count)
{
m_numLoadedVertices += count;
@@ -560,21 +560,11 @@ void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
for (int i = 0; i < 2; i++)
colElements[i] = m_VtxAttr.color[i].Elements;
- if (VertexManager::GetRemainingSize() < count * native_stride)
- {
- VertexManager::Flush();
-
- if (VertexManager::GetRemainingSize() < count * native_stride)
- ERROR_LOG(VIDEO, "VertexManager: Buffer not large enough for all vertices! "
- "Increase MAXVBUFFERSIZE or we need primitive breaking afterall.");
- }
-
+ VertexManager::PrepareForAdditionalData(primitive, count, native_stride);
ConvertVertices(count);
VertexManager::AddVertices(primitive, count);
- //VertexManager::Flush();
}
-
void VertexLoader::ConvertVertices ( int count )
{
#ifdef USE_JIT
@@ -598,7 +588,7 @@ void VertexLoader::ConvertVertices ( int count )
-void VertexLoader::RunCompiledVertices(int vtx_attr_group, int primitive, int count, u8* Data)
+void VertexLoader::RunCompiledVertices(int vtx_attr_group, int primitive, int const count, u8* Data)
{
m_numLoadedVertices += count;
@@ -641,16 +631,15 @@ void VertexLoader::RunCompiledVertices(int vtx_attr_group, int primitive, int co
for (int i = 0; i < 2; i++)
colElements[i] = m_VtxAttr.color[i].Elements;
- if(VertexManager::GetRemainingSize() < native_stride * count)
- VertexManager::Flush();
+ VertexManager::PrepareForAdditionalData(primitive, count, native_stride);
+
memcpy_gc(VertexManager::s_pCurBufferPointer, Data, native_stride * count);
VertexManager::s_pCurBufferPointer += native_stride * count;
DataSkip(count * m_VertexSize);
+
VertexManager::AddVertices(primitive, count);
}
-
-
void VertexLoader::SetVAT(u32 _group0, u32 _group1, u32 _group2)
{
VAT vat;