Update qt_openglrenderer.cpp: Port the version workaround from PCem.

This commit is contained in:
Miran Grča
2025-10-10 00:23:19 +02:00
committed by GitHub
parent 775b30f877
commit ef23521a77

View File

@@ -219,7 +219,14 @@ OpenGLRenderer::compile_shader(GLenum shader_type, const char *prepend, const ch
snprintf(version, 49, "%s\n", versionRegex.match(progSource).captured(1).toLatin1().data());
progSource.remove(versionRegex);
} else {
snprintf(version, 49, "%s\n", this->glslVersion.toLatin1().data());
int ver = this->glslVersion.toLatin1().data()[0] * 100 + this->glslVersion.toLatin1().data()[1] * 10;
if (ver == 300)
ver = 130;
else if (ver == 310)
ver = 140;
else if (ver == 320)
ver = 150;
snprintf(version, 49, "#version %d\n", ver);
}
/* Remove parameter lines. */