mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 06:53:46 +00:00
[Drape] Remove GLES2-related code
Signed-off-by: renderexpert <expert@renderconsulting.co.uk>
This commit is contained in:
committed by
Konstantin Pastbin
parent
705c715356
commit
b23c2ba3e3
@@ -107,7 +107,7 @@ void MapWidget::CreateEngine()
|
||||
{
|
||||
Framework::DrapeCreationParams p;
|
||||
|
||||
p.m_apiVersion = m_apiOpenGLES3 ? dp::ApiVersion::OpenGLES3 : dp::ApiVersion::OpenGLES2;
|
||||
p.m_apiVersion = dp::ApiVersion::OpenGLES3;
|
||||
|
||||
p.m_surfaceWidth = m_screenshotMode ? width() : static_cast<int>(m_ratio * width());
|
||||
p.m_surfaceHeight = m_screenshotMode ? height() : static_cast<int>(m_ratio * height());
|
||||
@@ -232,8 +232,6 @@ void MapWidget::Build()
|
||||
{
|
||||
std::string_view vertexSrc;
|
||||
std::string_view fragmentSrc;
|
||||
if (m_apiOpenGLES3)
|
||||
{
|
||||
#if defined(OMIM_OS_LINUX)
|
||||
vertexSrc = ":common/shaders/gles_300.vsh.glsl";
|
||||
fragmentSrc = ":common/shaders/gles_300.fsh.glsl";
|
||||
@@ -241,12 +239,6 @@ void MapWidget::Build()
|
||||
vertexSrc = ":common/shaders/gl_150.vsh.glsl";
|
||||
fragmentSrc = ":common/shaders/gl_150.fsh.glsl";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
vertexSrc = ":common/shaders/gles_200.vsh.glsl";
|
||||
fragmentSrc = ":common/shaders/gles_200.fsh.glsl";
|
||||
}
|
||||
|
||||
m_program = std::make_unique<QOpenGLShaderProgram>(this);
|
||||
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, vertexSrc.data());
|
||||
@@ -348,8 +340,6 @@ void MapWidget::initializeGL()
|
||||
if (!m_screenshotMode)
|
||||
m_ratio = devicePixelRatio();
|
||||
|
||||
m_apiOpenGLES3 = true;
|
||||
|
||||
#if defined(OMIM_OS_LINUX)
|
||||
{
|
||||
QOpenGLFunctions * funcs = context()->functions();
|
||||
@@ -367,29 +357,14 @@ void MapWidget::initializeGL()
|
||||
auto fmt = context()->format();
|
||||
if (context()->format().version() < qMakePair(3, 0))
|
||||
{
|
||||
LOG(LINFO, ("OpenGL ES version is below 3.0, taking the OpenGL ES 2.0 path"));
|
||||
m_apiOpenGLES3 = false;
|
||||
|
||||
constexpr const char* requiredExtensions[3] =
|
||||
{ "GL_EXT_map_buffer_range", "GL_OES_mapbuffer", "GL_OES_vertex_array_object" };
|
||||
for (auto & requiredExtension : requiredExtensions)
|
||||
{
|
||||
if (context()->hasExtension(QByteArray::fromStdString(requiredExtension)))
|
||||
LOG(LDEBUG, ("Found OpenGL ES 2.0 extension: ", requiredExtension));
|
||||
else
|
||||
LOG(LCRITICAL, ("A required OpenGL ES 2.0 extension is missing:", requiredExtension));
|
||||
}
|
||||
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
fmt.setVersion(2, 0);
|
||||
CHECK(false, ("OpenGL ES2 is not supported"));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LINFO, ("OpenGL version is at least 3.0, enabling GLSL '#version 300 es'"));
|
||||
m_apiOpenGLES3 = true;
|
||||
fmt.setVersion(3, 0);
|
||||
}
|
||||
|
||||
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user