Fix shader tests on Linux

Signed-off-by: renderexpert <expert@renderconsulting.co.uk>
This commit is contained in:
renderexpert
2025-06-19 11:41:53 +01:00
committed by Konstantin Pastbin
parent 6d0daf6fe7
commit 14b3e8fc8f
2 changed files with 16 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ GLProgramPool::GLProgramPool(dp::ApiVersion apiVersion)
if (m_apiVersion == dp::ApiVersion::OpenGLES3)
{
#if defined(OMIM_OS_DESKTOP) && !defined(OMIM_OS_LINUX)
#if defined(OMIM_OS_DESKTOP)
m_baseDefines = std::string(GL3_SHADER_VERSION);
#else
m_baseDefines = std::string(GLES3_SHADER_VERSION);

View File

@@ -112,9 +112,23 @@ void TestShaders(dp::ApiVersion apiVersion, std::string const & defines, QString
TEST(srcFile.open(), ("Temporary file can't be created!"));
std::string fullSrc;
if (apiVersion == dp::ApiVersion::OpenGLES3)
fullSrc = std::string(gpu::GLES3_SHADER_VERSION) + defines + src.second;
{
// Use desktop shader version for Linux
#ifdef OMIM_OS_LINUX
if (glslCompiler.contains(kCompilerOpenGLES.c_str()))
{
fullSrc = std::string(gpu::GL3_SHADER_VERSION) + defines + src.second;
}
else
#endif
{
fullSrc = std::string(gpu::GLES3_SHADER_VERSION) + defines + src.second;
}
}
else
{
fullSrc = defines + src.second;
}
WriteShaderToFile(srcFile, fullSrc);
RunShaderTest(apiVersion, src.first, glslCompiler, srcFile.fileName(), procPrepare, argsPrepare,
successChecker, errorLog);