mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
fast commit :
make native mips loading an option to prevent performance lost in game that not need this functionality.( thanks to dorian.fevrier for point the performance lost.) added a patch from pierre@pirsoft.de to avoid vertex drops when index array is full in opengl implementation that do not support large index arrays git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5432 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -25,6 +25,7 @@ namespace VertexManager
|
||||
void AddVertices(int primitive, int numvertices);
|
||||
void Flush(); // flushes the current buffer
|
||||
int GetRemainingSize(); // remaining space in the current buffer.
|
||||
int GetRemainingVertices(int primitive); // remaining number of vertices that can be processed in one AddVertices call
|
||||
|
||||
// TODO: move, rename.
|
||||
extern u8* s_pCurBufferPointer;
|
||||
|
@ -602,9 +602,12 @@ void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
|
||||
int startv = 0, extraverts = 0;
|
||||
int v = 0;
|
||||
|
||||
int remainingVerts2 = VertexManager::GetRemainingVertices(primitive);
|
||||
while (v < count)
|
||||
{
|
||||
int remainingVerts = VertexManager::GetRemainingSize() / native_stride;
|
||||
if (remainingVerts2 - v + startv < remainingVerts)
|
||||
remainingVerts = remainingVerts2 - v + startv;
|
||||
if (remainingVerts < granularity) {
|
||||
INCSTAT(stats.thisFrame.numBufferSplits);
|
||||
// This buffer full - break current primitive and flush, to switch to the next buffer.
|
||||
@ -612,6 +615,7 @@ void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
|
||||
if (v - startv > 0)
|
||||
VertexManager::AddVertices(primitive, v - startv + extraverts);
|
||||
VertexManager::Flush();
|
||||
remainingVerts2 = VertexManager::GetRemainingVertices(primitive);
|
||||
// Why does this need to be so complicated?
|
||||
switch (primitive) {
|
||||
case 3: // triangle strip, copy last two vertices
|
||||
|
@ -53,9 +53,10 @@ void VideoConfig::Load(const char *ini_file)
|
||||
iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false);
|
||||
iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
|
||||
iniFile.Get("Settings", "Crop", &bCrop, false);
|
||||
iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
|
||||
iniFile.Get("Settings", "UseXFB", &bUseXFB, true);
|
||||
iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0);
|
||||
iniFile.Get("Settings", "AutoScale", &bAutoScale, true);
|
||||
iniFile.Get("Settings", "UseNativeMips", &bUseNativeMips, true);
|
||||
|
||||
iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings
|
||||
//Safe texture cache params
|
||||
@ -141,6 +142,8 @@ void VideoConfig::GameIniLoad(const char *ini_file)
|
||||
iniFile.Get("Video", "FIFOBPHack", &bFIFOBPhack, false);
|
||||
if (iniFile.Exists("Video", "ProjectionHack"))
|
||||
iniFile.Get("Video", "ProjectionHack", &iPhackvalue, 0);
|
||||
if (iniFile.Exists("Video", "UseNativeMips"))
|
||||
iniFile.Get("Video", "UseNativeMips", &bUseNativeMips, true);
|
||||
}
|
||||
|
||||
void VideoConfig::Save(const char *ini_file)
|
||||
@ -156,6 +159,7 @@ void VideoConfig::Save(const char *ini_file)
|
||||
iniFile.Set("Settings", "UseXFB", bUseXFB);
|
||||
iniFile.Set("Settings", "UseRealXFB", bUseRealXFB);
|
||||
iniFile.Set("Settings", "AutoScale", bAutoScale);
|
||||
iniFile.Set("Settings", "UseNativeMips", bUseNativeMips);
|
||||
|
||||
iniFile.Set("Settings", "SafeTextureCache", bSafeTextureCache);
|
||||
//safe texture cache params
|
||||
|
@ -76,6 +76,7 @@ struct VideoConfig
|
||||
bool bUseXFB;
|
||||
bool bUseRealXFB;
|
||||
bool bAutoScale; // Removes annoying borders without using XFB. Doesn't always work perfectly.
|
||||
bool bUseNativeMips;
|
||||
|
||||
// Enhancements
|
||||
int iMultisampleMode;
|
||||
|
Reference in New Issue
Block a user