diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-08 16:27:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-08 16:27:33 +0300 |
commit | c70431d73da9c821cfedbd162c7d2447b7057459 (patch) | |
tree | b6c1ea809a790415e26edad92d9283977ad72a48 /src/test/testmain.cpp | |
parent | 0c2def29e3bf56a686305ba7385de45214ec86a4 (diff) | |
download | manaplus-c70431d73da9c821cfedbd162c7d2447b7057459.tar.gz manaplus-c70431d73da9c821cfedbd162c7d2447b7057459.tar.bz2 manaplus-c70431d73da9c821cfedbd162c7d2447b7057459.tar.xz manaplus-c70431d73da9c821cfedbd162c7d2447b7057459.zip |
Add functions for future batch size detection.
Diffstat (limited to 'src/test/testmain.cpp')
-rw-r--r-- | src/test/testmain.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index 61c08f442..94914c41b 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -182,16 +182,30 @@ int TestMain::exec(const bool testAudio) maxFps = safeOpenGLFps; } + int batchSize = 256; +/* + // if OpenGL mode is fast mode we can try detect max batch sizes + if (openGLMode == 1) + { + if (!invokeFastOpenBatchTest("11")) + batchSize = readValue2(11); + if (batchSize < 256) + batchSize = 256; + } +*/ + // if OpenGL implimentation is not good, disable it. if (!detectMode) openGLMode = 0; - writeConfig(openGLMode, rescaleTest[openGLMode], soundTest, info); + writeConfig(openGLMode, rescaleTest[openGLMode], + soundTest, info, batchSize); return 0; } void TestMain::writeConfig(const int openGLMode, const int rescale, - const int sound, const std::string &info) + const int sound, const std::string &info, + const int batchSize) { mConfig.init(Client::getConfigDirectory() + "/config.xml"); @@ -209,6 +223,9 @@ void TestMain::writeConfig(const int openGLMode, const int rescale, mConfig.setValue("safemode", false); mConfig.setValue("enableMapReduce", true); + // max batch size +// mConfig.setValue("batchsize", batchSize); + // stats mConfig.setValue("testInfo", info); @@ -285,6 +302,19 @@ int TestMain::invokeFastOpenGLRenderTest(std::string test) #endif } +int TestMain::invokeFastOpenBatchTest(std::string test) +{ +#if defined USE_OPENGL + mConfig.setValue("opengl", 1); + mConfig.write(); + const int ret = execFileWait(fileName, fileName, "-t", test, 30); +// log->log("%s: %d", test.c_str(), ret); + return ret; +#else + return -1; +#endif +} + int TestMain::invokeSafeOpenGLRenderTest(std::string test) { #if defined USE_OPENGL |