Browse Source

Re-enable extension calls on OpenGL ES except for NaCl and Emscripten.

pull/68/head
Vladimír Vondruš 12 years ago
parent
commit
7468887e99
  1. 75
      src/Magnum/AbstractFramebuffer.cpp
  2. 42
      src/Magnum/AbstractObject.cpp
  3. 126
      src/Magnum/AbstractShaderProgram.cpp
  4. 24
      src/Magnum/AbstractTexture.cpp
  5. 30
      src/Magnum/Buffer.cpp
  6. 32
      src/Magnum/DebugMessage.cpp
  7. 6
      src/Magnum/Framebuffer.cpp
  8. 81
      src/Magnum/Mesh.cpp
  9. 10
      src/Magnum/MeshView.cpp
  10. 47
      src/Magnum/Query.cpp
  11. 6
      src/Magnum/Query.h
  12. 26
      src/Magnum/Renderbuffer.cpp
  13. 6
      src/Magnum/Renderer.cpp

75
src/Magnum/AbstractFramebuffer.cpp

@ -140,16 +140,28 @@ void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer&
}
#ifdef MAGNUM_TARGET_GLES2
void AbstractFramebuffer::blitImplementationANGLE(const Range2Di&, const Range2Di&, FramebufferBlitMask, FramebufferBlitFilter) {
/** @todo Re-enable when extension loader is available for ES */
CORRADE_INTERNAL_ASSERT(false);
//glBlitFramebufferANGLE(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter));
void AbstractFramebuffer::blitImplementationANGLE(const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, const FramebufferBlitMask mask, const FramebufferBlitFilter filter) {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glBlitFramebufferANGLE(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter));
#else
static_cast<void>(sourceRectangle);
static_cast<void>(destinationRectangle);
static_cast<void>(mask);
static_cast<void>(filter);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void AbstractFramebuffer::blitImplementationNV(const Range2Di&, const Range2Di&, FramebufferBlitMask, FramebufferBlitFilter) {
/** @todo Re-enable when extension loader is available for ES */
CORRADE_INTERNAL_ASSERT(false);
//glBlitFramebufferNV(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter));
void AbstractFramebuffer::blitImplementationNV(const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, const FramebufferBlitMask mask, const FramebufferBlitFilter filter) {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glBlitFramebufferNV(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter));
#else
static_cast<void>(sourceRectangle);
static_cast<void>(destinationRectangle);
static_cast<void>(mask);
static_cast<void>(filter);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif
@ -218,14 +230,14 @@ void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Buf
void AbstractFramebuffer::invalidateImplementationNoOp(GLsizei, const GLenum* const) {}
void AbstractFramebuffer::invalidateImplementationDefault(const GLsizei count, const GLenum* const attachments) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glInvalidateFramebuffer(GLenum(bindInternal()), count, attachments);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDiscardFramebufferEXT(GLenum(bindInternal()), count, attachments);
#else
static_cast<void>(count);
static_cast<void>(attachments);
CORRADE_INTERNAL_ASSERT(false);
//glDiscardFramebufferEXT(GLenum(bindInternal()), count, attachments);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -249,17 +261,20 @@ GLenum AbstractFramebuffer::checkStatusImplementationDSA(const FramebufferTarget
#endif
void AbstractFramebuffer::drawBuffersImplementationDefault(GLsizei count, const GLenum* buffers) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES2
bindInternal(FramebufferTarget::Draw);
#else
bindInternal(drawTarget);
bindInternal(Context::current()->state().framebuffer->drawTarget);
#endif
#ifndef MAGNUM_TARGET_GLES2
glDrawBuffers(count, buffers);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawBuffersNV(count, buffers);
#else
static_cast<void>(count);
static_cast<void>(buffers);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -270,22 +285,21 @@ void AbstractFramebuffer::drawBuffersImplementationDSA(GLsizei count, const GLen
#endif
void AbstractFramebuffer::drawBufferImplementationDefault(GLenum buffer) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES2
bindInternal(FramebufferTarget::Draw);
#else
bindInternal(drawTarget);
bindInternal(Context::current()->state().framebuffer->drawTarget);
#endif
#ifndef MAGNUM_TARGET_GLES3
#ifndef MAGNUM_TARGET_GLES
glDrawBuffer(buffer);
#else
#elif !defined(MAGNUM_TARGET_GLES2)
glDrawBuffers(1, &buffer);
#endif
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawBuffersNV(1, &buffer);
#else
static_cast<void>(buffer);
CORRADE_INTERNAL_ASSERT(false);
//glDrawBuffersNV(1, &buffer);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -296,18 +310,19 @@ void AbstractFramebuffer::drawBufferImplementationDSA(GLenum buffer) {
#endif
void AbstractFramebuffer::readBufferImplementationDefault(GLenum buffer) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES2
bindInternal(FramebufferTarget::Read);
#else
bindInternal(readTarget);
bindInternal(Context::current()->state().framebuffer->readTarget);
#endif
#ifndef MAGNUM_TARGET_GLES2
glReadBuffer(buffer);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glReadBufferNV(buffer);
#else
static_cast<void>(buffer);
CORRADE_INTERNAL_ASSERT(false);
//glReadBufferNV(buffer);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -322,9 +337,10 @@ void AbstractFramebuffer::readImplementationDefault(const Vector2i& offset, cons
}
void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t dataSize, GLvoid* const data) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
glReadnPixelsARB(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), dataSize, data);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), dataSize, data);
#else
static_cast<void>(offset);
static_cast<void>(size);
@ -332,8 +348,7 @@ void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, c
static_cast<void>(type);
static_cast<void>(dataSize);
static_cast<void>(data);
CORRADE_INTERNAL_ASSERT(false);
//glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data);
CORRADE_ASSERT_UNREACHABLE();
#endif
}

42
src/Magnum/AbstractObject.cpp

@ -36,6 +36,7 @@
namespace Magnum {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
namespace {
inline GLenum extTypeFromKhrIdentifier(GLenum khrIdentifier) {
switch(khrIdentifier) {
@ -106,6 +107,7 @@ namespace {
CORRADE_ASSERT_UNREACHABLE();
}
}
#endif
Int AbstractObject::maxLabelLength() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
@ -127,28 +129,27 @@ Int AbstractObject::maxLabelLength() {
void AbstractObject::labelImplementationNoOp(GLenum, GLuint, Containers::ArrayReference<const char>) {}
void AbstractObject::labelImplementationKhr(const GLenum identifier, const GLuint name, const Containers::ArrayReference<const char> label) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
glObjectLabel(identifier, name, label.size(), label);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glObjectLabelKHR(identifier, name, label.size(), label);
#else
static_cast<void>(identifier);
static_cast<void>(name);
static_cast<void>(label);
CORRADE_INTERNAL_ASSERT(false);
//glObjectLabelKHR(identifier, name, label.size(), label);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void AbstractObject::labelImplementationExt(const GLenum identifier, const GLuint name, const Containers::ArrayReference<const char> label) {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
const GLenum type = extTypeFromKhrIdentifier(identifier);
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
glLabelObjectEXT(type, name, label.size(), label);
#else
static_cast<void>(type);
static_cast<void>(identifier);
static_cast<void>(name);
static_cast<void>(label);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -157,24 +158,25 @@ std::string AbstractObject::getLabelImplementationNoOp(GLenum, GLuint) { return
std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, const GLuint name) {
/* Get label size (w/o null terminator) */
GLsizei size;
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
glGetObjectLabel(identifier, name, 0, &size, nullptr);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGetObjectLabelKHR(identifier, name, 0, &size, nullptr);
#else
static_cast<void>(identifier);
static_cast<void>(name);
CORRADE_INTERNAL_ASSERT(false);
//glGetObjectLabelKHR(identifier, name, 0, &size, nullptr);
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Make place also for the null terminator */
std::string label;
label.resize(size+1);
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
glGetObjectLabel(identifier, name, size+1, nullptr, &label[0]);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGetObjectLabelKHR(identifier, name, size+1, nullptr, &label[0]);
#else
//glGetObjectLabelKHR(identifier, name, size+1, nullptr, &label[0]);
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Pop null terminator and return the string */
@ -183,25 +185,25 @@ std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, c
}
std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, const GLuint name) {
const GLenum type = extTypeFromKhrIdentifier(identifier);
GLsizei size;
/* Get label size (w/o null terminator) */
GLsizei size;
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
const GLenum type = extTypeFromKhrIdentifier(identifier);
glGetObjectLabelEXT(type, name, 0, &size, nullptr);
#else
static_cast<void>(type);
static_cast<void>(identifier);
static_cast<void>(name);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Make place also for the null terminator */
std::string label;
label.resize(size+1);
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGetObjectLabelEXT(identifier, name, size+1, nullptr, &label[0]);
#else
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Pop null terminator and return the string */

126
src/Magnum/AbstractShaderProgram.cpp

@ -363,15 +363,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLfloat* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform1fv(_id, location, count, values);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform1fvEXT(_id, location, count, values);
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform1fvEXT(_id, location, count, values);
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -391,15 +391,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform2fv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform2fvEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform2fvEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -419,15 +419,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform3fv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform3fvEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform3fvEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -447,15 +447,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform4fv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform4fvEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform4fvEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -475,15 +475,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLint* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform1iv(_id, location, count, values);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform1ivEXT(_id, location, count, values);
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform1ivEXT(_id, location, count, values);
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -503,15 +503,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform2iv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform2ivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform2ivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -531,15 +531,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform3iv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform3ivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform3ivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -559,15 +559,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform4iv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform4ivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform4ivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -588,15 +588,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLuint* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform1uiv(_id, location, count, values);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform1uivEXT(_id, location, count, values);
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform1uivEXT(_id, location, count, values);
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -616,15 +616,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLuint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform2uiv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform2uivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform2uivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -644,15 +644,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLuint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform3uiv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform3uivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform3uivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -672,15 +672,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLuint>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniform4uiv(_id, location, count, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniform4uivEXT(_id, location, count, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniform4uivEXT(_id, location, count, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -771,15 +771,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix2fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix2fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix2fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -799,15 +799,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix3fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix3fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix3fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -827,15 +827,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix4fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix4fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix4fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -856,15 +856,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix2x3fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix2x3fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix2x3fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -884,15 +884,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix3x2fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix3x2fv(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix3x2fv(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -912,15 +912,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix2x4fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix2x4fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix2x4fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -940,15 +940,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix4x2fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix4x2fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix4x2fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -968,15 +968,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix3x4fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix3x4fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix3x4fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -996,15 +996,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c
}
void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* const values) {
/** @todo Enable when extension loader for ES is available */
#ifndef MAGNUM_TARGET_GLES
glProgramUniformMatrix4x3fv(_id, location, count, GL_FALSE, values[0].data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glProgramUniformMatrix4x3fvEXT(_id, location, count, GL_FALSE, values[0].data());
#else
CORRADE_INTERNAL_ASSERT(false);
//glProgramUniformMatrix4x3fvEXT(_id, location, count, GL_FALSE, values[0].data());
static_cast<void>(location);
static_cast<void>(count);
static_cast<void>(values);
CORRADE_ASSERT_UNREACHABLE();
#endif
}

24
src/Magnum/AbstractTexture.cpp

@ -891,16 +891,16 @@ void AbstractTexture::storageImplementationFallback(const GLenum target, const G
void AbstractTexture::storageImplementationDefault(GLenum target, GLsizei levels, TextureFormat internalFormat, const Vector2i& size) {
bindInternal();
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glTexStorage2D(target, levels, GLenum(internalFormat), size.x(), size.y());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glTexStorage2DEXT(target, levels, GLenum(internalFormat), size.x(), size.y());
#else
static_cast<void>(target);
static_cast<void>(levels);
static_cast<void>(internalFormat);
static_cast<void>(size);
CORRADE_INTERNAL_ASSERT(false);
//glTexStorage2DEXT(target, levels, GLenum(internalFormat), size.x(), size.y());
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -945,16 +945,16 @@ void AbstractTexture::storageImplementationFallback(GLenum target, GLsizei level
void AbstractTexture::storageImplementationDefault(GLenum target, GLsizei levels, TextureFormat internalFormat, const Vector3i& size) {
bindInternal();
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glTexStorage3D(target, levels, GLenum(internalFormat), size.x(), size.y(), size.z());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glTexStorage3DEXT(target, levels, GLenum(internalFormat), size.x(), size.y(), size.z());
#else
static_cast<void>(target);
static_cast<void>(levels);
static_cast<void>(internalFormat);
static_cast<void>(size);
CORRADE_INTERNAL_ASSERT(false);
//glTexStorage3DEXT(target, levels, GLenum(internalFormat), size.x(), size.y(), size.z());
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -1034,9 +1034,10 @@ void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, Texture
void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) {
bindInternal();
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glTexImage3D(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glTexImage3DOES(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data);
#else
static_cast<void>(target);
static_cast<void>(level);
@ -1045,8 +1046,7 @@ void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, Tex
static_cast<void>(format);
static_cast<void>(type);
static_cast<void>(data);
CORRADE_INTERNAL_ASSERT(false);
//glTexImage3DOES(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -1080,9 +1080,10 @@ void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, cons
void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, const Vector3i& offset, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) {
bindInternal();
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glTexSubImage3D(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glTexSubImage3DOES(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data);
#else
static_cast<void>(target);
static_cast<void>(level);
@ -1091,8 +1092,7 @@ void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level,
static_cast<void>(format);
static_cast<void>(type);
static_cast<void>(data);
CORRADE_INTERNAL_ASSERT(false);
//glTexSubImage3DOES(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data);
CORRADE_ASSERT_UNREACHABLE();
#endif
}

30
src/Magnum/Buffer.cpp

@ -212,15 +212,14 @@ void* Buffer::map(const MapAccess access) {
#ifdef MAGNUM_TARGET_GLES2
void* Buffer::mapSub(const GLintptr offset, const GLsizeiptr length, const MapAccess access) {
/** @todo Enable also in Emscripten (?) when extension loader is available */
#ifdef CORRADE_TARGET_NACL
CORRADE_ASSERT(!_mappedBuffer, "Buffer::mapSub(): the buffer is already mapped", nullptr);
return _mappedBuffer = glMapBufferSubDataCHROMIUM(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access));
#else
CORRADE_INTERNAL_ASSERT(false);
static_cast<void>(offset);
static_cast<void>(length);
static_cast<void>(access);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif
@ -238,13 +237,12 @@ bool Buffer::unmap() { return (this->*Context::current()->state().buffer->unmapI
#ifdef MAGNUM_TARGET_GLES2
void Buffer::unmapSub() {
/** @todo Enable also in Emscripten (?) when extension loader is available */
#ifdef CORRADE_TARGET_NACL
CORRADE_ASSERT(_mappedBuffer, "Buffer::unmapSub(): the buffer is not mapped", );
glUnmapBufferSubDataCHROMIUM(_mappedBuffer);
_mappedBuffer = nullptr;
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif
@ -324,13 +322,13 @@ void Buffer::invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length)
#endif
void* Buffer::mapImplementationDefault(MapAccess access) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
return glMapBuffer(GLenum(bindInternal(_targetHint)), GLenum(access));
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
return glMapBufferOES(GLenum(bindInternal(_targetHint)), GLenum(access));
#else
static_cast<void>(access);
CORRADE_INTERNAL_ASSERT(false);
//return glMapBufferOES(GLenum(bindInternal(_targetHint)), GLenum(access));
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -341,15 +339,15 @@ void* Buffer::mapImplementationDSA(MapAccess access) {
#endif
void* Buffer::mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
return glMapBufferRange(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access));
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
return glMapBufferRangeEXT(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access));
#else
static_cast<void>(offset);
static_cast<void>(length);
static_cast<void>(access);
CORRADE_INTERNAL_ASSERT(false);
//return glMapBufferRangeEXT(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access));
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -360,14 +358,14 @@ void* Buffer::mapRangeImplementationDSA(GLintptr offset, GLsizeiptr length, MapF
#endif
void Buffer::flushMappedRangeImplementationDefault(GLintptr offset, GLsizeiptr length) {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glFlushMappedBufferRange(GLenum(bindInternal(_targetHint)), offset, length);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glFlushMappedBufferRangeEXT(GLenum(bindInternal(_targetHint)), offset, length);
#else
static_cast<void>(offset);
static_cast<void>(length);
CORRADE_INTERNAL_ASSERT(false);
//glFlushMappedBufferRangeEXT(GLenum(bindInternal(_targetHint)), offset, length);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -378,12 +376,12 @@ void Buffer::flushMappedRangeImplementationDSA(GLintptr offset, GLsizeiptr lengt
#endif
bool Buffer::unmapImplementationDefault() {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
return glUnmapBuffer(GLenum(bindInternal(_targetHint)));
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
return glUnmapBufferOES(GLenum(bindInternal(_targetHint)));
#else
CORRADE_INTERNAL_ASSERT(false);
//return glUnmapBufferOES(GLenum(bindInternal(_targetHint)));
CORRADE_ASSERT_UNREACHABLE();
#endif
}

32
src/Magnum/DebugMessage.cpp

@ -36,8 +36,7 @@ namespace Magnum {
namespace {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
void
#ifdef CORRADE_TARGET_WINDOWS
APIENTRY
@ -113,27 +112,26 @@ void DebugMessage::insertInternal(const Source source, const Type type, const Un
void DebugMessage::insertImplementationNoOp(Source, Type, UnsignedInt, Severity, const Containers::ArrayReference<const char>) {}
void DebugMessage::insertImplementationKhr(const Source source, const Type type, const UnsignedInt id, const Severity severity, const Containers::ArrayReference<const char> string) {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
glDebugMessageInsert(GLenum(source), GLenum(type), id, GLenum(severity), string.size(), string.data());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDebugMessageInsertKHR(GLenum(source), GLenum(type), id, GLenum(severity), string.size(), string.data());
#else
static_cast<void>(source);
static_cast<void>(type);
static_cast<void>(id);
static_cast<void>(severity);
static_cast<void>(string);
CORRADE_INTERNAL_ASSERT(false);
//glDebugMessageInsertEXT(GLenum(source), GLenum(type), id, GLenum(severity), string.size(), string.data());
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void DebugMessage::insertImplementationExt(Source, Type, UnsignedInt, Severity, const Containers::ArrayReference<const char> string) {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glInsertEventMarkerEXT(string.size(), string.data());
#else
static_cast<void>(string);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -150,17 +148,17 @@ void DebugMessage::setEnabledInternal(const GLenum source, const GLenum type, co
void DebugMessage::controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool) {}
void DebugMessage::controlImplementationKhr(const GLenum source, const GLenum type, const GLenum severity, const std::initializer_list<UnsignedInt> ids, const bool enabled) {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
glDebugMessageControl(source, type, severity, ids.size(), ids.begin(), enabled);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDebugMessageControlKHR(source, type, severity, ids.size(), ids.begin(), enabled);
#else
static_cast<void>(source);
static_cast<void>(type);
static_cast<void>(severity);
static_cast<void>(ids);
static_cast<void>(enabled);
CORRADE_INTERNAL_ASSERT(false);
//glDebugMessageControlKHR(source, type, severity, ids.size(), ids.begin(), enabled);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -173,23 +171,23 @@ void DebugMessage::callbackImplementationKhr(const Callback callback, const void
/* Adding callback */
if(!original && callback) {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
glDebugMessageCallback(callbackWrapper, userParam);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDebugMessageCallbackKHR(callbackWrapper, userParam);
#else
static_cast<void>(userParam);
CORRADE_INTERNAL_ASSERT(false);
//glDebugMessageCallbackEXT(callbackWrapper, userParam);
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Deleting callback */
} else if(original && !callback) {
/** @todo Re-enable when extension wrangler is available for ES */
#ifndef MAGNUM_TARGET_GLES
glDebugMessageCallback(nullptr, nullptr);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDebugMessageCallbackKHR(nullptr, nullptr);
#else
CORRADE_INTERNAL_ASSERT(false);
//glDebugMessageCallbackEXT(nullptr, nullptr);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
}

6
src/Magnum/Framebuffer.cpp

@ -276,16 +276,16 @@ void Framebuffer::texture2DImplementationDSA(BufferAttachment attachment, GLenum
#endif
void Framebuffer::textureLayerImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint mipLevel, GLint layer) {
/** @todo Re-enable when extension loader is available for ES 2.0 */
#ifndef MAGNUM_TARGET_GLES2
glFramebufferTextureLayer(GLenum(bindInternal()), GLenum(attachment), textureId, mipLevel, layer);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glFramebufferTexture3DOES(GLenum(bindInternal()), GLenum(attachment), GL_TEXTURE_3D_OES, textureId, mipLevel, layer);
#else
static_cast<void>(attachment);
static_cast<void>(textureId);
static_cast<void>(mipLevel);
static_cast<void>(layer);
CORRADE_INTERNAL_ASSERT(false);
//glFramebufferTexture3DOES(GLenum(bindInternal()), GLenum(attachment), GL_TEXTURE_3D_OES, texture.id(), mipLevel, layer);
CORRADE_ASSERT_UNREACHABLE();
#endif
}

81
src/Magnum/Mesh.cpp

@ -285,14 +285,14 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i
}
void Mesh::bindVAO(GLuint vao) {
/** @todo Re-enable when extension loader is available for ES */
GLuint& current = Context::current()->state().mesh->currentVAO;
if(current != vao) {
#ifndef MAGNUM_TARGET_GLES2
glBindVertexArray(current = vao);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glBindVertexArrayOES(current = vao);
#else
CORRADE_INTERNAL_ASSERT(false);
//glBindVertexArrayOES(current = vao);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
}
@ -300,12 +300,12 @@ void Mesh::bindVAO(GLuint vao) {
void Mesh::createImplementationDefault() { _id = 0; }
void Mesh::createImplementationVAO() {
/** @todo Get some extension wrangler instead to avoid linker errors to glGenVertexArrays() on ES2 */
#ifndef MAGNUM_TARGET_GLES2
glGenVertexArrays(1, &_id);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGenVertexArraysOES(1, &_id);
#else
//glGenVertexArraysOES(1, &_id);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding);
}
@ -313,12 +313,12 @@ void Mesh::createImplementationVAO() {
void Mesh::destroyImplementationDefault() {}
void Mesh::destroyImplementationVAO() {
/** @todo Get some extension wrangler instead to avoid linker errors to glDeleteVertexArrays() on ES2 */
#ifndef MAGNUM_TARGET_GLES2
glDeleteVertexArrays(1, &_id);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDeleteVertexArraysOES(1, &_id);
#else
//glDeleteVertexArraysOES(1, &_id);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -426,24 +426,33 @@ void Mesh::vertexAttribPointer(const LongAttribute& attribute) {
#ifdef MAGNUM_TARGET_GLES2
void Mesh::vertexAttribDivisorImplementationANGLE(const GLuint index, const GLuint divisor) {
//glVertexAttribDivisorANGLE(index, divisor);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glVertexAttribDivisorANGLE(index, divisor);
#else
static_cast<void>(index);
static_cast<void>(divisor);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::vertexAttribDivisorImplementationEXT(const GLuint index, const GLuint divisor) {
//glVertexAttribDivisorEXT(index, divisor);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glVertexAttribDivisorEXT(index, divisor);
#else
static_cast<void>(index);
static_cast<void>(divisor);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::vertexAttribDivisorImplementationNV(const GLuint index, const GLuint divisor) {
//glVertexAttribDivisorNV(index, divisor);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glVertexAttribDivisorNV(index, divisor);
#else
static_cast<void>(index);
static_cast<void>(divisor);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif
@ -501,51 +510,69 @@ void Mesh::unbindImplementationVAO() {}
#ifdef MAGNUM_TARGET_GLES2
void Mesh::drawArraysInstancedImplementationANGLE(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) {
//glDrawArraysInstancedANGLE(GLenum(_primitive), baseVertex, count, instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawArraysInstancedANGLE(GLenum(_primitive), baseVertex, count, instanceCount);
#else
static_cast<void>(baseVertex);
static_cast<void>(count);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::drawArraysInstancedImplementationEXT(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) {
//glDrawArraysInstancedEXT(GLenum(_primitive), baseVertex, count, instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawArraysInstancedEXT(GLenum(_primitive), baseVertex, count, instanceCount);
#else
static_cast<void>(baseVertex);
static_cast<void>(count);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::drawArraysInstancedImplementationNV(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) {
//glDrawArraysInstancedNV(GLenum(_primitive), baseVertex, count, instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawArraysInstancedNV(GLenum(_primitive), baseVertex, count, instanceCount);
#else
static_cast<void>(baseVertex);
static_cast<void>(count);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::drawElementsInstancedImplementationANGLE(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) {
//glDrawElementsInstancedANGLE(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawElementsInstancedANGLE(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
#else
static_cast<void>(count);
static_cast<void>(indexOffset);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::drawElementsInstancedImplementationEXT(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) {
//glDrawElementsInstancedEXT(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawElementsInstancedEXT(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
#else
static_cast<void>(count);
static_cast<void>(indexOffset);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Mesh::drawElementsInstancedImplementationNV(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) {
//glDrawElementsInstancedNV(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
CORRADE_INTERNAL_ASSERT(false);
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glDrawElementsInstancedNV(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount);
#else
static_cast<void>(count);
static_cast<void>(indexOffset);
static_cast<void>(instanceCount);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif

10
src/Magnum/MeshView.cpp

@ -94,9 +94,10 @@ void MeshView::multiDrawImplementationDefault(std::initializer_list<std::referen
if(!original._indexBuffer) {
#ifndef MAGNUM_TARGET_GLES
glMultiDrawArrays(GLenum(original._primitive), baseVertex, count, meshes.size());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glMultiDrawArraysEXT(GLenum(original._primitive), baseVertex, count, meshes.size());
#else
//glMultiDrawArraysEXT(GLenum(original._primitive), baseVertex, count, meshes.size());
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
/* Indexed meshes */
@ -112,9 +113,10 @@ void MeshView::multiDrawImplementationDefault(std::initializer_list<std::referen
{
#ifndef MAGNUM_TARGET_GLES
glMultiDrawElements(GLenum(original._primitive), count, GLenum(original._indexType), indices, meshes.size());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glMultiDrawElementsEXT(GLenum(original._primitive), count, GLenum(original._indexType), indices, meshes.size());
#else
//glMultiDrawElements(GLenum(original._primitive), count, GLenum(original._indexType), indices, meshes.size());
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
}

47
src/Magnum/Query.cpp

@ -34,13 +34,12 @@
namespace Magnum {
AbstractQuery::AbstractQuery(): target() {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glGenQueries(1, &_id);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glGenQueriesEXT(1, &_id);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -48,13 +47,12 @@ AbstractQuery::~AbstractQuery() {
/* Moved out, nothing to do */
if(!_id) return;
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glDeleteQueries(1, &_id);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glDeleteQueriesEXT(1, &_id);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
@ -78,14 +76,13 @@ AbstractQuery& AbstractQuery::setLabelInternal(const Containers::ArrayReference<
bool AbstractQuery::resultAvailable() {
CORRADE_ASSERT(!target, "AbstractQuery::resultAvailable(): the query is currently running", false);
/** @todo Re-enable when extension loader is available for ES */
GLuint result;
#ifndef MAGNUM_TARGET_GLES2
glGetQueryObjectuiv(_id, GL_QUERY_RESULT_AVAILABLE, &result);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glGetQueryObjectuivEXT(_id, GL_QUERY_RESULT_AVAILABLE_EXT, &result);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
return result == GL_TRUE;
}
@ -94,14 +91,13 @@ bool AbstractQuery::resultAvailable() {
template<> UnsignedInt AbstractQuery::result<UnsignedInt>() {
CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {});
/** @todo Re-enable when extension loader is available for ES */
UnsignedInt result;
#ifndef MAGNUM_TARGET_GLES2
glGetQueryObjectuiv(_id, GL_QUERY_RESULT, &result);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glGetQueryObjectuivEXT(_id, GL_QUERY_RESULT_EXT, &result);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
return result;
}
@ -111,14 +107,13 @@ template<> bool AbstractQuery::result<bool>() { return result<UnsignedInt>() !=
template<> Int AbstractQuery::result<Int>() {
CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {});
/** @todo Re-enable when extension loader is available for ES */
Int result;
#ifndef MAGNUM_TARGET_GLES
glGetQueryObjectiv(_id, GL_QUERY_RESULT, &result);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glGetQueryObjectivEXT(_id, GL_QUERY_RESULT_EXT, &result);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
return result;
}
@ -127,13 +122,13 @@ template<> Int AbstractQuery::result<Int>() {
template<> UnsignedLong AbstractQuery::result<UnsignedLong>() {
CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {});
/** @todo Re-enable when extension loader is available for ES */
UnsignedLong result;
#ifndef MAGNUM_TARGET_GLES
glGetQueryObjectui64v(_id, GL_QUERY_RESULT, &result);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGetQueryObjectui64vEXT(_id, GL_QUERY_RESULT_EXT, &result);
#else
CORRADE_INTERNAL_ASSERT(false);
//glGetQueryObjectui64vEXT(_id, GL_QUERY_RESULT, &result);
CORRADE_ASSERT_UNREACHABLE();
#endif
return result;
}
@ -141,13 +136,13 @@ template<> UnsignedLong AbstractQuery::result<UnsignedLong>() {
template<> Long AbstractQuery::result<Long>() {
CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {});
/** @todo Re-enable when extension loader is available for ES */
Long result;
#ifndef MAGNUM_TARGET_GLES
glGetQueryObjecti64v(_id, GL_QUERY_RESULT, &result);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glGetQueryObjecti64vEXT(_id, GL_QUERY_RESULT_EXT, &result);
#else
CORRADE_INTERNAL_ASSERT(false);
//glGetQueryObjecti64vEXT(_id, GL_QUERY_RESULT, &result);
CORRADE_ASSERT_UNREACHABLE();
#endif
return result;
}
@ -157,27 +152,25 @@ template<> Long AbstractQuery::result<Long>() {
void AbstractQuery::begin(GLenum target) {
CORRADE_ASSERT(!this->target, "AbstractQuery::begin(): the query is already running", );
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glBeginQuery(this->target = target, id());
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glBeginQueryEXT(this->target = target, id());
#else
static_cast<void>(target);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void AbstractQuery::end() {
CORRADE_ASSERT(target, "AbstractQuery::end(): the query is not running", );
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
glEndQuery(target);
#elif defined(CORRADE_TARGET_NACL)
#elif !defined(CORRADE_TARGET_EMSCRIPTEN)
glEndQueryEXT(target);
#else
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
target = {};
}

6
src/Magnum/Query.h

@ -447,12 +447,12 @@ class TimeQuery: public AbstractQuery {
* @see @fn_gl{QueryCounter} with @def_gl{TIMESTAMP}
*/
void timestamp() {
/** @todo Enable when extension wrangler for ES is available */
#ifndef MAGNUM_TARGET_GLES
glQueryCounter(id(), GL_TIMESTAMP);
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
glQueryCounterEXT(id(), GL_TIMESTAMP_EXT);
#else
//glQueryCounterEXT(id(), GL_TIMESTAMP);
CORRADE_INTERNAL_ASSERT(false);
CORRADE_ASSERT_UNREACHABLE();
#endif
}

26
src/Magnum/Renderbuffer.cpp

@ -114,24 +114,34 @@ void Renderbuffer::storageImplementationDSA(RenderbufferFormat internalFormat, c
}
#endif
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES2
void Renderbuffer::storageMultisampleImplementationDefault(const GLsizei samples, const RenderbufferFormat internalFormat, const Vector2i& size) {
bind();
glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, GLenum(internalFormat), size.x(), size.y());
}
#else
void Renderbuffer::storageMultisampleImplementationANGLE(GLsizei, RenderbufferFormat, const Vector2i&) {
CORRADE_INTERNAL_ASSERT(false);
void Renderbuffer::storageMultisampleImplementationANGLE(const GLsizei samples, const RenderbufferFormat internalFormat, const Vector2i& size) {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
bind();
//glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER, samples, internalFormat, size.x(), size.y());
glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER, samples, GLenum(internalFormat), size.x(), size.y());
#else
static_cast<void>(samples);
static_cast<void>(internalFormat);
static_cast<void>(size);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
void Renderbuffer::storageMultisampleImplementationNV(GLsizei, RenderbufferFormat, const Vector2i&) {
CORRADE_INTERNAL_ASSERT(false);
void Renderbuffer::storageMultisampleImplementationNV(const GLsizei samples, const RenderbufferFormat internalFormat, const Vector2i& size) {
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
bind();
//glRenderbufferStorageMultisampleNV(GL_RENDERBUFFER, samples, internalFormat, size.x(), size.y());
glRenderbufferStorageMultisampleNV(GL_RENDERBUFFER, samples, GLenum(internalFormat), size.x(), size.y());
#else
static_cast<void>(samples);
static_cast<void>(internalFormat);
static_cast<void>(size);
CORRADE_ASSERT_UNREACHABLE();
#endif
}
#endif

6
src/Magnum/Renderer.cpp

@ -212,12 +212,12 @@ Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationDefault
}
Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationRobustness() {
/** @todo Re-enable when extension loader is available for ES */
#ifndef MAGNUM_TARGET_GLES
return GraphicsResetStatus(glGetGraphicsResetStatusARB());
#elif !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL)
return GraphicsResetStatus(glGetGraphicsResetStatusEXT());
#else
CORRADE_INTERNAL_ASSERT(false);
//return GraphicsResetStatus(glGetGraphicsResetStatusEXT());
CORRADE_ASSERT_UNREACHABLE();
#endif
}

Loading…
Cancel
Save