Remove remaining compile time checks for OpenGLES

This commit is contained in:
Martin Gräßlin 2015-10-30 13:47:16 +01:00
parent 004b928c8d
commit d5a5725db1
3 changed files with 3 additions and 19 deletions

View file

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QRegExp>
#include <QStringList>
#include <QDebug>
#include <QOpenGLContext>
#include <sys/utsname.h>
#include <X11/Xlib.h>

View file

@ -181,10 +181,8 @@ static QString formatGLError(GLenum err)
case GL_INVALID_ENUM: return QStringLiteral("GL_INVALID_ENUM");
case GL_INVALID_VALUE: return QStringLiteral("GL_INVALID_VALUE");
case GL_INVALID_OPERATION: return QStringLiteral("GL_INVALID_OPERATION");
#ifndef KWIN_HAVE_OPENGLES
case GL_STACK_OVERFLOW: return QStringLiteral("GL_STACK_OVERFLOW");
case GL_STACK_UNDERFLOW: return QStringLiteral("GL_STACK_UNDERFLOW");
#endif
case GL_OUT_OF_MEMORY: return QStringLiteral("GL_OUT_OF_MEMORY");
default: return QStringLiteral("0x") + QString::number(err, 16);
}
@ -391,13 +389,8 @@ void GLShader::bindAttributeLocation(const char *name, int index)
void GLShader::bindFragDataLocation(const char *name, int index)
{
#ifndef KWIN_HAVE_OPENGLES
if (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4")))
if (!GLPlatform::instance()->isGLES() && (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4"))))
glBindFragDataLocation(mProgram, index, name);
#else
Q_UNUSED(name)
Q_UNUSED(index)
#endif
}
void GLShader::bind()
@ -1397,7 +1390,6 @@ static QString formatFramebufferStatus(GLenum status)
case GL_FRAMEBUFFER_UNSUPPORTED:
// A format or the combination of formats of the attachments is unsupported
return QStringLiteral("GL_FRAMEBUFFER_UNSUPPORTED");
#ifndef KWIN_HAVE_OPENGLES
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
// Not all attached images have the same width and height
return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT");
@ -1413,7 +1405,6 @@ static QString formatFramebufferStatus(GLenum status)
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
// The read buffer is missing
return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER");
#endif
default:
return QStringLiteral("Unknown (0x") + QString::number(status, 16) + QStringLiteral(")");
}

View file

@ -84,19 +84,12 @@ void eglResolveFunctions()
void glResolveFunctions(OpenGLPlatformInterface platformInterface)
{
#ifndef KWIN_HAVE_OPENGLES
if (hasGLExtension(QByteArrayLiteral("GL_ARB_robustness"))) {
// See http://www.opengl.org/registry/specs/ARB/robustness.txt
GL_RESOLVE_WITH_EXT(glGetGraphicsResetStatus, glGetGraphicsResetStatusARB);
GL_RESOLVE_WITH_EXT(glReadnPixels, glReadnPixelsARB);
GL_RESOLVE_WITH_EXT(glGetnUniformfv, glGetnUniformfvARB);
} else {
glGetGraphicsResetStatus = KWin::GetGraphicsResetStatus;
glReadnPixels = KWin::ReadnPixels;
glGetnUniformfv = KWin::GetnUniformfv;
}
#else
if (hasGLExtension(QByteArrayLiteral("GL_EXT_robustness"))) {
} else if (hasGLExtension(QByteArrayLiteral("GL_EXT_robustness"))) {
// See http://www.khronos.org/registry/gles/extensions/EXT/EXT_robustness.txt
glGetGraphicsResetStatus = (glGetGraphicsResetStatus_func) eglGetProcAddress("glGetGraphicsResetStatusEXT");
glReadnPixels = (glReadnPixels_func) eglGetProcAddress("glReadnPixelsEXT");
@ -106,7 +99,6 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface)
glReadnPixels = KWin::ReadnPixels;
glGetnUniformfv = KWin::GetnUniformfv;
}
#endif // KWIN_HAVE_OPENGLES
}
static GLenum GetGraphicsResetStatus()