mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Optimize vertex loader with a mini JIT (only first step, more optimizations may follow). Some various error message and warning fixes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1276 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -108,6 +108,12 @@ void AddVertices(int primitive, int numvertices)
|
||||
_assert_( numvertices > 0 );
|
||||
|
||||
ADDSTAT(stats.thisFrame.numPrims, numvertices);
|
||||
/*
|
||||
if (s_vStoredPrimitives.size() && s_vStoredPrimitives[s_vStoredPrimitives.size() - 1].first == primitive) {
|
||||
// Actually, just count potential primitive joins.
|
||||
// Doesn't seem worth it in Metroid Prime games.
|
||||
INCSTAT(stats.thisFrame.numPrimitiveJoins);
|
||||
}*/
|
||||
s_vStoredPrimitives.push_back(std::pair<int, int>(c_primitiveType[primitive], numvertices));
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
@ -150,7 +156,7 @@ void Flush()
|
||||
|
||||
DVSTARTPROFILE();
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, s_vboBuffers[s_nCurVBOIndex]);
|
||||
glBufferData(GL_ARRAY_BUFFER, s_pCurBufferPointer - s_pBaseBufferPointer, s_pBaseBufferPointer, GL_STREAM_DRAW);
|
||||
@ -263,6 +269,7 @@ void Flush()
|
||||
int offset = 0;
|
||||
for (std::vector< std::pair<int, int> >::const_iterator it = s_vStoredPrimitives.begin(); it != s_vStoredPrimitives.end(); ++it)
|
||||
{
|
||||
INCSTAT(stats.thisFrame.numDrawCalls);
|
||||
glDrawArrays(it->first, offset, it->second);
|
||||
offset += it->second;
|
||||
}
|
||||
|
Reference in New Issue
Block a user