summaryrefslogtreecommitdiff
path: root/src/test/testmain.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-16 21:10:58 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-16 21:27:20 +0300
commit71a8401df046ac856d3bb02d6f44733890883f44 (patch)
treee37e6c9b47ff4a9c45a41860286a78bd12f61616 /src/test/testmain.cpp
parenta82331f46657298d335c36f9276ab3007b327d4b (diff)
downloadplus-71a8401df046ac856d3bb02d6f44733890883f44.tar.gz
plus-71a8401df046ac856d3bb02d6f44733890883f44.tar.bz2
plus-71a8401df046ac856d3bb02d6f44733890883f44.tar.xz
plus-71a8401df046ac856d3bb02d6f44733890883f44.zip
Add max texture size detection for all modes.
Diffstat (limited to 'src/test/testmain.cpp')
-rw-r--r--src/test/testmain.cpp78
1 files changed, 37 insertions, 41 deletions
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index 5b860eb92..f26366596 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -74,19 +74,21 @@ int TestMain::exec(const bool testAudio)
initConfig();
int softwareTest = invokeSoftwareRenderTest("1");
int soundTest = -1;
- int rescaleTest[5];
+ int rescaleTest[6];
int softFps = 0;
int normalOpenGLFps = 0;
int safeOpenGLFps = 0;
int modernOpenGLFps = 0;
- int textureSize1 = 1024;
- int textureSize2 = 1024;
- int textureSize3 = 1024;
+ int textureSize[6];
+ std::string textureSizeStr;
RenderType openGLMode = RENDER_SOFTWARE;
int detectMode = 0;
- for (int f = 0; f < f; f ++)
+ for (int f = 0; f < 6; f ++)
+ {
rescaleTest[f] = -1;
+ textureSize[f] = 1024;
+ }
std::string info;
const int videoDetectTest = invokeTest("99");
@@ -224,51 +226,45 @@ int TestMain::exec(const bool testAudio)
int batchSize = 256;
- // if OpenGL mode is normal mode we can try detect max batch sizes
- if (openGLMode == RENDER_NORMAL_OPENGL
- || openGLMode == RENDER_GLES_OPENGL
- || openGLMode == RENDER_MODERN_OPENGL)
+ if (!invokeNormalOpenBatchTest("11"))
+ batchSize = readValue2(11);
+ if (batchSize < 256)
+ batchSize = 256;
+
+ if (!invokeNormalOpenBatchTest("14"))
{
- if (!invokeNormalOpenBatchTest("11"))
- batchSize = readValue2(11);
- if (batchSize < 256)
- batchSize = 256;
-
- if (!invokeNormalOpenBatchTest("14"))
- textureSize1 = readValue2(14);
- if (!invokeModernOpenBatchTest("15"))
- textureSize2 = readValue2(15);
- if (!invokeSafeOpenBatchTest("16"))
- textureSize3 = readValue2(16);
- info.append(strprintf(",%d,%d,%d,-",
- textureSize1, textureSize2, textureSize3));
- textureSize1 = std::min(textureSize1, textureSize2);
- textureSize1 = std::min(textureSize1, textureSize3);
- if (textureSize1 < 1024)
- textureSize1 = 1024;
+ textureSize[static_cast<size_t>(RENDER_NORMAL_OPENGL)]
+ = readValue2(14);
}
- else if (openGLMode == RENDER_SAFE_OPENGL)
+ if (!invokeModernOpenBatchTest("15"))
{
- if (!invokeSafeOpenBatchTest("16"))
- textureSize3 = readValue2(16);
- textureSize1 = textureSize3;
- if (normalOpenGLTest != -1)
- {
- if (!invokeNormalOpenBatchTest("14"))
- textureSize1 = readValue2(14);
- }
- info.append(strprintf(",%d,%d,-", textureSize1, textureSize3));
- textureSize1 = std::min(textureSize1, textureSize3);
- if (textureSize1 < 1024)
- textureSize1 = 1024;
+ textureSize[static_cast<size_t>(RENDER_MODERN_OPENGL)]
+ = readValue2(15);
}
+ if (!invokeSafeOpenBatchTest("16"))
+ {
+ textureSize[static_cast<size_t>(RENDER_SAFE_OPENGL)]
+ = readValue2(16);
+ }
+ if (!invokeMobileOpenBatchTest("20"))
+ {
+ textureSize[static_cast<size_t>(RENDER_GLES_OPENGL)]
+ = readValue2(20);
+ }
+ for (int f = 0; f < 6; f ++)
+ info.append(strprintf(",%d", textureSize[f]));
+ info.append(",-");
+
+ textureSizeStr = toString(textureSize[0]);
+ for (int f = 1; f < 6; f ++)
+ textureSizeStr.append(strprintf(",%d", textureSize[f]));
// if OpenGL implimentation is not good, disable it.
if (!(detectMode & 15))
openGLMode = RENDER_SOFTWARE;
writeConfig(openGLMode, rescaleTest[static_cast<size_t>(openGLMode)],
- soundTest, info, batchSize, textureSize1, detectMode);
+ soundTest, info, batchSize, textureSizeStr, detectMode);
return 0;
}
@@ -277,7 +273,7 @@ void TestMain::writeConfig(const RenderType openGLMode,
const int sound,
const std::string &info,
const int batchSize A_UNUSED,
- const int textureSize,
+ const std::string &textureSize,
const int detectMode)
{
mConfig.init(settings.configDir + "/config.xml");