From c70431d73da9c821cfedbd162c7d2447b7057459 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Oct 2012 16:27:33 +0300 Subject: Add functions for future batch size detection. --- src/test/testmain.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/test/testmain.cpp') 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 -- cgit v1.2.3-60-g2f50