From 48d4aa03fac4c20f40bbc35d2395a12a4714ca2c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 25 May 2014 22:01:42 +0300 Subject: Detect max texture size also in safe OpenGL mode. --- src/test/testlauncher.cpp | 2 +- src/test/testmain.cpp | 35 +++++++++++++++++++++++++++++++---- src/test/testmain.h | 2 ++ 3 files changed, 34 insertions(+), 5 deletions(-) (limited to 'src/test') diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index c3b424368..7ed08ad50 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -74,7 +74,7 @@ int TestLauncher::exec() return testFps(); else if (mTest == "11") return testBatches(); - else if (mTest == "14" || mTest == "15") + else if (mTest == "14" || mTest == "15" || mTest == "16") return testTextures(); else if (mTest == "99") return testVideoDetection(); diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index 4cc4966d8..b51947f8d 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -81,6 +81,7 @@ int TestMain::exec(const bool testAudio) int safeOpenGLFps = 0; int textureSize1 = 1024; int textureSize2 = 1024; + int textureSize3 = 1024; RenderType openGLMode = RENDER_SOFTWARE; int detectMode = 0; @@ -204,10 +205,27 @@ int TestMain::exec(const bool testAudio) if (!invokeFastOpenBatchTest("14")) textureSize1 = readValue2(14); - if (!invokeFastOpenBatchTest("15")) - textureSize2 = readValue2(15); - info.append(strprintf(",%d,%d", textureSize1, textureSize2)); - textureSize1 = std::min(textureSize1, textureSize2); +// if (!invokeMobileOpenBatchTest("15")) +// textureSize2 = readValue2(15); + if (!invokeSafeOpenBatchTest("16")) + textureSize3 = readValue2(16); + info.append(strprintf(",%d,%d,-", textureSize1, textureSize3)); + textureSize1 = std::min(textureSize1, textureSize3); + if (textureSize1 < 1024) + textureSize1 = 1024; + } + else if (openGLMode == RENDER_SAFE_OPENGL) + { + if (!invokeSafeOpenBatchTest("16")) + textureSize3 = readValue2(16); + textureSize1 = textureSize3; + if (fastOpenGLTest != -1) + { + if (!invokeFastOpenBatchTest("14")) + textureSize1 = readValue2(14); + } + info.append(strprintf(",%d,%d,-", textureSize1, textureSize3)); + textureSize1 = std::min(textureSize1, textureSize3); if (textureSize1 < 1024) textureSize1 = 1024; } @@ -345,6 +363,15 @@ int TestMain::invokeMobileOpenBatchTest(const std::string &test) return ret; } +int TestMain::invokeSafeOpenBatchTest(const std::string &test) +{ + mConfig.setValue("opengl", static_cast(RENDER_SAFE_OPENGL)); + mConfig.write(); + const int ret = execFileWait(fileName, fileName, "-t", test, 30); +// log->log("%s: %d", test.c_str(), ret); + return ret; +} + int TestMain::invokeSafeOpenGLRenderTest(const std::string &test) { mConfig.setValue("opengl", static_cast(RENDER_SAFE_OPENGL)); diff --git a/src/test/testmain.h b/src/test/testmain.h index d4bae14ce..1eed577a0 100644 --- a/src/test/testmain.h +++ b/src/test/testmain.h @@ -66,6 +66,8 @@ class TestMain final int invokeMobileOpenBatchTest(const std::string &test); + int invokeSafeOpenBatchTest(const std::string &test); + int invokeSafeOpenGLRenderTest(const std::string &test); void testsMain(); -- cgit v1.2.3-60-g2f50