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 <QRegExp>
#include <QStringList> #include <QStringList>
#include <QDebug> #include <QDebug>
#include <QOpenGLContext>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <X11/Xlib.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_ENUM: return QStringLiteral("GL_INVALID_ENUM");
case GL_INVALID_VALUE: return QStringLiteral("GL_INVALID_VALUE"); case GL_INVALID_VALUE: return QStringLiteral("GL_INVALID_VALUE");
case GL_INVALID_OPERATION: return QStringLiteral("GL_INVALID_OPERATION"); 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_OVERFLOW: return QStringLiteral("GL_STACK_OVERFLOW");
case GL_STACK_UNDERFLOW: return QStringLiteral("GL_STACK_UNDERFLOW"); case GL_STACK_UNDERFLOW: return QStringLiteral("GL_STACK_UNDERFLOW");
#endif
case GL_OUT_OF_MEMORY: return QStringLiteral("GL_OUT_OF_MEMORY"); case GL_OUT_OF_MEMORY: return QStringLiteral("GL_OUT_OF_MEMORY");
default: return QStringLiteral("0x") + QString::number(err, 16); 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) void GLShader::bindFragDataLocation(const char *name, int index)
{ {
#ifndef KWIN_HAVE_OPENGLES if (!GLPlatform::instance()->isGLES() && (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4"))))
if (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4")))
glBindFragDataLocation(mProgram, index, name); glBindFragDataLocation(mProgram, index, name);
#else
Q_UNUSED(name)
Q_UNUSED(index)
#endif
} }
void GLShader::bind() void GLShader::bind()
@ -1397,7 +1390,6 @@ static QString formatFramebufferStatus(GLenum status)
case GL_FRAMEBUFFER_UNSUPPORTED: case GL_FRAMEBUFFER_UNSUPPORTED:
// A format or the combination of formats of the attachments is unsupported // A format or the combination of formats of the attachments is unsupported
return QStringLiteral("GL_FRAMEBUFFER_UNSUPPORTED"); return QStringLiteral("GL_FRAMEBUFFER_UNSUPPORTED");
#ifndef KWIN_HAVE_OPENGLES
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
// Not all attached images have the same width and height // Not all attached images have the same width and height
return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT"); return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT");
@ -1413,7 +1405,6 @@ static QString formatFramebufferStatus(GLenum status)
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
// The read buffer is missing // The read buffer is missing
return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"); return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER");
#endif
default: default:
return QStringLiteral("Unknown (0x") + QString::number(status, 16) + QStringLiteral(")"); return QStringLiteral("Unknown (0x") + QString::number(status, 16) + QStringLiteral(")");
} }

View file

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