D3D various: "Safe texture cache" option, texture replace instead of destroy/create when possible, a commented out "optimization" that didn't speed things up (use DrawPrimitive instead of DrawIndexedPrimitive when possible), reduce code duplication in Flush(), don't periodically clean out the shader caches since it's not really beneficial - shaders are cheap to keep. some code cleanup.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4302 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-09-19 13:14:55 +00:00
parent dae1a68bfc
commit 7a8f6bdd6d
17 changed files with 259 additions and 170 deletions

View File

@ -31,6 +31,8 @@ void IndexGenerator::Start(unsigned short *startptr)
ptr = startptr;
index = 0;
numPrims = 0;
adds = 0;
onlyLists = true;
}
void IndexGenerator::AddList(int numVerts)
@ -45,6 +47,7 @@ void IndexGenerator::AddList(int numVerts)
}
index += numVerts;
numPrims += numTris;
adds++;
}
void IndexGenerator::AddStrip(int numVerts)
@ -61,6 +64,8 @@ void IndexGenerator::AddStrip(int numVerts)
}
index += numVerts;
numPrims += numTris;
adds++;
onlyLists = false;
}
void IndexGenerator::AddLineList(int numVerts)
@ -74,6 +79,7 @@ void IndexGenerator::AddLineList(int numVerts)
}
index += numVerts;
numPrims += numLines;
adds++;
}
void IndexGenerator::AddLineStrip(int numVerts)
@ -87,9 +93,10 @@ void IndexGenerator::AddLineStrip(int numVerts)
}
index += numVerts;
numPrims += numLines;
adds++;
onlyLists = false;
}
void IndexGenerator::AddFan(int numVerts)
{
int numTris = numVerts - 2;
@ -102,6 +109,8 @@ void IndexGenerator::AddFan(int numVerts)
}
index += numVerts;
numPrims += numTris;
adds++;
onlyLists = false;
}
void IndexGenerator::AddQuads(int numVerts)
@ -119,10 +128,13 @@ void IndexGenerator::AddQuads(int numVerts)
}
index += numVerts;
numPrims += numTris;
adds++;
onlyLists = false;
}
void IndexGenerator::AddPointList(int numVerts)
void IndexGenerator::AddPoints(int numVerts)
{
index += numVerts;
}
numPrims += numVerts;
adds++;
}