Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-05-16 14:42:32 +0300
committerGitHub <noreply@github.com>2017-05-16 14:42:32 +0300
commitd2f79bd2c7004af2d1459e8d5b7748763f241a54 (patch)
tree64300bccb750e59f7c3a05800eafcd5c3b3f89cb /drape_frontend/drape_frontend_tests/compile_shaders_test.cpp
parentaa6703383e8d4c2ff8445e8b3c27728846cdab4b (diff)
parent086d6f9cf247cea07cff6bc33d5567dc7c64806b (diff)
Merge pull request #6040 from rokuz/es3-supportbeta-810
Added OpenGL ES3 support
Diffstat (limited to 'drape_frontend/drape_frontend_tests/compile_shaders_test.cpp')
-rw-r--r--drape_frontend/drape_frontend_tests/compile_shaders_test.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/drape_frontend/drape_frontend_tests/compile_shaders_test.cpp b/drape_frontend/drape_frontend_tests/compile_shaders_test.cpp
index fd0a246338..31e5fa637d 100644
--- a/drape_frontend/drape_frontend_tests/compile_shaders_test.cpp
+++ b/drape_frontend/drape_frontend_tests/compile_shaders_test.cpp
@@ -27,14 +27,6 @@ std::string const kCompilerOpenGLES3 = "GLSLESCompiler_Series6.mac";
std::string const kCompilerMaliOpenGLES3 = kMaliCompilerOpenGLES3Dir + "/malisc";
std::string DebugPrint(QString const & s) { return s.toStdString(); }
-std::string DebugPrint(dp::ApiVersion apiVersion)
-{
- if (apiVersion == dp::OpenGLES2)
- return "OpenGLES2";
- else if (apiVersion == dp::OpenGLES3)
- return "OpenGLES3";
- return "Unknown";
-}
namespace
{
@@ -139,7 +131,7 @@ UNIT_TEST(CompileShaders_Test)
args << fileName << fileName + ".bin" << shaderType;
};
- string defines = "";
+ std::string const defines = compiler.m_apiVersion == dp::ApiVersion::OpenGLES3 ? "#define GLES3\n" : "";
TestShaders(compiler.m_apiVersion, defines, gpu::GetVertexShaders(compiler.m_apiVersion),
compilerPath, [](QProcess const &) {}, argsPrepareFn, successChecker, ss);
shaderType = "-f";
@@ -148,27 +140,27 @@ UNIT_TEST(CompileShaders_Test)
TEST_EQUAL(errorLog.isEmpty(), true, ("PVR without defines :", errorLog));
- defines = "#define ENABLE_VTF\n";
+ std::string const defines2 = defines + "#define ENABLE_VTF\n";
errorLog.clear();
shaderType = "-v";
- TestShaders(compiler.m_apiVersion, defines, gpu::GetVertexShaders(compiler.m_apiVersion),
+ TestShaders(compiler.m_apiVersion, defines2, gpu::GetVertexShaders(compiler.m_apiVersion),
compilerPath, [](QProcess const &) {}, argsPrepareFn, successChecker, ss);
shaderType = "-f";
- TestShaders(compiler.m_apiVersion, defines, gpu::GetFragmentShaders(compiler.m_apiVersion),
+ TestShaders(compiler.m_apiVersion, defines2, gpu::GetFragmentShaders(compiler.m_apiVersion),
compilerPath, [](QProcess const &) {}, argsPrepareFn, successChecker, ss);
- TEST_EQUAL(errorLog.isEmpty(), true, ("PVR with defines : ", defines, "\n", errorLog));
+ TEST_EQUAL(errorLog.isEmpty(), true, ("PVR with defines : ", defines2, "\n", errorLog));
- defines = "#define SAMSUNG_GOOGLE_NEXUS\n";
+ std::string const defines3 = defines + "#define SAMSUNG_GOOGLE_NEXUS\n";
errorLog.clear();
shaderType = "-v";
- TestShaders(compiler.m_apiVersion, defines, gpu::GetVertexShaders(compiler.m_apiVersion),
+ TestShaders(compiler.m_apiVersion, defines3, gpu::GetVertexShaders(compiler.m_apiVersion),
compilerPath, [](QProcess const &) {}, argsPrepareFn, successChecker, ss);
shaderType = "-f";
- TestShaders(compiler.m_apiVersion, defines, gpu::GetFragmentShaders(compiler.m_apiVersion),
+ TestShaders(compiler.m_apiVersion, defines3, gpu::GetFragmentShaders(compiler.m_apiVersion),
compilerPath, [](QProcess const &) {}, argsPrepareFn, successChecker, ss);
- TEST_EQUAL(errorLog.isEmpty(), true, ("PVR with defines : ", defines, "\n", errorLog));
+ TEST_EQUAL(errorLog.isEmpty(), true, ("PVR with defines : ", defines3, "\n", errorLog));
}
}
@@ -262,7 +254,8 @@ UNIT_TEST(MALI_CompileShaders_Test)
<< "-r" << version.second << "-c" << version.first << "-d" << set.m_driverName
<< fileName;
};
- std::string defines = "";
+ std::string const defines =
+ compiler.m_apiVersion == dp::ApiVersion::OpenGLES3 ? "#define GLES3\n" : "";
QString const compilerPath = QString::fromStdString(compiler.m_compilerPath);
TestShaders(compiler.m_apiVersion, defines, gpu::GetVertexShaders(compiler.m_apiVersion),
compilerPath, procPrepare, argForming, successChecker, ss);