mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 21:58:48 +00:00
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:
parent
dae1a68bfc
commit
7a8f6bdd6d
17 changed files with 259 additions and 170 deletions
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -28,16 +28,20 @@ public:
|
|||
void AddList(int numVerts);
|
||||
void AddStrip(int numVerts);
|
||||
void AddLineList(int numVerts);
|
||||
void AddPointList(int numVerts); //dummy for counting vertices
|
||||
void AddLineStrip(int numVerts);
|
||||
void AddFan(int numVerts);
|
||||
void AddQuads(int numVerts);
|
||||
void AddPoints(int numVerts);
|
||||
int GetNumPrims() {return numPrims;} //returns numprimitives
|
||||
int GetNumVerts() {return index;} //returns numprimitives
|
||||
int GetNumAdds() {return adds;}
|
||||
bool GetOnlyLists() {return onlyLists;}
|
||||
private:
|
||||
unsigned short *ptr;
|
||||
int numPrims;
|
||||
int index;
|
||||
int adds;
|
||||
bool onlyLists;
|
||||
};
|
||||
|
||||
#endif // _INDEXGENERATOR_H
|
|
@ -57,6 +57,7 @@ char *Statistics::ToString(char *ptr)
|
|||
p+=sprintf(p,"dlists alive: %i\n",stats.numDListsAlive);
|
||||
p+=sprintf(p,"primitive joins: %i\n",stats.thisFrame.numPrimitiveJoins);
|
||||
p+=sprintf(p,"draw calls: %i\n",stats.thisFrame.numDrawCalls);
|
||||
p+=sprintf(p,"indexed draw calls: %i\n",stats.thisFrame.numIndexedDrawCalls);
|
||||
p+=sprintf(p,"buffer splits: %i\n",stats.thisFrame.numBufferSplits);
|
||||
p+=sprintf(p,"primitives: %i\n",stats.thisFrame.numPrims);
|
||||
p+=sprintf(p,"primitives (DL): %i\n",stats.thisFrame.numDLPrims);
|
||||
|
|
|
@ -67,6 +67,7 @@ struct Statistics
|
|||
|
||||
int numPrimitiveJoins;
|
||||
int numDrawCalls;
|
||||
int numIndexedDrawCalls;
|
||||
int numBufferSplits;
|
||||
|
||||
int numDListsCalled;
|
||||
|
|
|
@ -142,6 +142,12 @@ struct TargetRectangle : public MathUtil::Rectangle<int>
|
|||
|
||||
#define LOG_VTX()
|
||||
|
||||
#ifdef _WIN32
|
||||
#define ERASE_THROUGH_ITERATOR(container, iterator) iterator = container.erase(iterator)
|
||||
#else
|
||||
#define ERASE_THROUGH_ITERATOR(container, iterator) container.erase(iterator++)
|
||||
#endif
|
||||
|
||||
bool IsD3D();
|
||||
|
||||
#endif // _VIDEOCOMMON_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue