From a82331f46657298d335c36f9276ab3007b327d4b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 16 Jul 2014 01:33:39 +0300 Subject: Add support for modern OpenGL in renderers tests. --- src/test/testlauncher.cpp | 6 ++-- src/test/testmain.cpp | 70 +++++++++++++++++++++++++++++++++++++++++------ src/test/testmain.h | 4 +++ 3 files changed, 68 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index abc22fc75..8dc292177 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -70,13 +70,13 @@ TestLauncher::~TestLauncher() int TestLauncher::exec() { - if (mTest == "1" || mTest == "2" || mTest == "3") + if (mTest == "1" || mTest == "2" || mTest == "3" || mTest == "19") return testBackend(); else if (mTest == "4") return testSound(); - else if (mTest == "5" || mTest == "6" || mTest == "7") + else if (mTest == "5" || mTest == "6" || mTest == "7" || mTest == "18") return testRescale(); - else if (mTest == "8" || mTest == "9" || mTest == "10") + else if (mTest == "8" || mTest == "9" || mTest == "10" || mTest == "17") return testFps(); else if (mTest == "11") return testBatches(); diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index a402cf2b8..5b860eb92 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -74,18 +74,19 @@ int TestMain::exec(const bool testAudio) initConfig(); int softwareTest = invokeSoftwareRenderTest("1"); int soundTest = -1; - int rescaleTest[3]; + int rescaleTest[5]; int softFps = 0; int normalOpenGLFps = 0; int safeOpenGLFps = 0; + int modernOpenGLFps = 0; int textureSize1 = 1024; + int textureSize2 = 1024; int textureSize3 = 1024; RenderType openGLMode = RENDER_SOFTWARE; int detectMode = 0; - rescaleTest[0] = -1; - rescaleTest[1] = -1; - rescaleTest[2] = -1; + for (int f = 0; f < f; f ++) + rescaleTest[f] = -1; std::string info; const int videoDetectTest = invokeTest("99"); @@ -94,13 +95,14 @@ int TestMain::exec(const bool testAudio) int normalOpenGLTest = invokeNormalOpenGLRenderTest("2"); int safeOpenGLTest = invokeSafeOpenGLRenderTest("3"); + int modernOpenGLTest = invokeModernOpenGLRenderTest("19"); if (testAudio) soundTest = invokeTest4(); else soundTest = 1; - info.append(strprintf("%d.%d,%d,%d.", soundTest, softwareTest, - normalOpenGLTest, safeOpenGLTest)); + info.append(strprintf("%d.%d,%d,%d,%d.", soundTest, softwareTest, + normalOpenGLTest, safeOpenGLTest, modernOpenGLTest)); if (!softwareTest) { @@ -127,6 +129,31 @@ int TestMain::exec(const bool testAudio) } } info.append("."); + if (!modernOpenGLTest) + { + int modernOpenGLFpsTest = invokeModernOpenGLRenderTest("17"); + info.append(strprintf("%d", modernOpenGLFpsTest)); + if (!modernOpenGLFpsTest) + { + modernOpenGLFps = readValue2(17); + info.append(strprintf(",%d", modernOpenGLFps)); + if (!modernOpenGLFps) + { + modernOpenGLTest = -1; + modernOpenGLFpsTest = -1; + } + else + { + rescaleTest[3] = invokeModernOpenGLRenderTest("18"); + info.append(strprintf(",%d", rescaleTest[3])); + } + } + else + { + modernOpenGLTest = -1; + } + } + info.append("."); if (!normalOpenGLTest) { int normalOpenGLFpsTest = invokeNormalOpenGLRenderTest("9"); @@ -184,6 +211,11 @@ int TestMain::exec(const bool testAudio) openGLMode = RENDER_NORMAL_OPENGL; maxFps = normalOpenGLFps; } + if (maxFps < modernOpenGLFps) + { + openGLMode = RENDER_MODERN_OPENGL; + maxFps = modernOpenGLFps; + } if (maxFps < safeOpenGLFps) { openGLMode = RENDER_SAFE_OPENGL; @@ -204,11 +236,13 @@ int TestMain::exec(const bool testAudio) if (!invokeNormalOpenBatchTest("14")) textureSize1 = readValue2(14); -// if (!invokeMobileOpenBatchTest("15")) -// textureSize2 = readValue2(15); + if (!invokeModernOpenBatchTest("15")) + textureSize2 = readValue2(15); if (!invokeSafeOpenBatchTest("16")) textureSize3 = readValue2(16); - info.append(strprintf(",%d,%d,-", textureSize1, textureSize3)); + info.append(strprintf(",%d,%d,%d,-", + textureSize1, textureSize2, textureSize3)); + textureSize1 = std::min(textureSize1, textureSize2); textureSize1 = std::min(textureSize1, textureSize3); if (textureSize1 < 1024) textureSize1 = 1024; @@ -344,6 +378,15 @@ int TestMain::invokeNormalOpenGLRenderTest(const std::string &test) return ret; } +int TestMain::invokeModernOpenGLRenderTest(const std::string &test) +{ + mConfig.setValue("opengl", static_cast(RENDER_MODERN_OPENGL)); + mConfig.write(); + const int ret = execFileWait(fileName, fileName, "-t", test, 30); + log->log("%s: %d", test.c_str(), ret); + return ret; +} + int TestMain::invokeNormalOpenBatchTest(const std::string &test) { mConfig.setValue("opengl", static_cast(RENDER_NORMAL_OPENGL)); @@ -353,6 +396,15 @@ int TestMain::invokeNormalOpenBatchTest(const std::string &test) return ret; } +int TestMain::invokeModernOpenBatchTest(const std::string &test) +{ + mConfig.setValue("opengl", static_cast(RENDER_MODERN_OPENGL)); + mConfig.write(); + const int ret = execFileWait(fileName, fileName, "-t", test, 30); +// log->log("%s: %d", test.c_str(), ret); + return ret; +} + int TestMain::invokeMobileOpenBatchTest(const std::string &test) { mConfig.setValue("opengl", static_cast(RENDER_GLES_OPENGL)); diff --git a/src/test/testmain.h b/src/test/testmain.h index bab01c7f3..93f305e22 100644 --- a/src/test/testmain.h +++ b/src/test/testmain.h @@ -64,6 +64,10 @@ class TestMain final int invokeNormalOpenBatchTest(const std::string &test); + int invokeModernOpenGLRenderTest(const std::string &test); + + int invokeModernOpenBatchTest(const std::string &test); + int invokeMobileOpenBatchTest(const std::string &test); int invokeSafeOpenBatchTest(const std::string &test); -- cgit v1.2.3-60-g2f50