diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2010-05-04 14:43:30 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2010-05-04 14:43:30 +0000 |
| commit | 0ea01d84628c4779a801d74bd01ce9006fe0372a (patch) | |
| tree | 03c3b6e940e517c1d7e9b4457f618a987bbbd96b /Source/Core/VideoCommon | |
| parent | a8659054acf6d48610ba59c4650c44b145a1f895 (diff) | |
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
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/NativeVertexWriter.h | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoader.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/NativeVertexWriter.h b/Source/Core/VideoCommon/Src/NativeVertexWriter.h index 1bbc8033aa..bd9d2d3f14 100644 --- a/Source/Core/VideoCommon/Src/NativeVertexWriter.h +++ b/Source/Core/VideoCommon/Src/NativeVertexWriter.h @@ -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; diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp index a2a70483c6..5981fde36d 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp @@ -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 diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index 11364e3808..92f6b55b6e 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -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 diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 75d39f9afa..8740590727 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -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; |
