Browse Source

GL: these helpers are never used on WebGL, compile them away.

pull/680/head
Vladimír Vondruš 10 months ago
parent
commit
cfb18081bb
  1. 2
      src/Magnum/GL/AbstractFramebuffer.cpp
  2. 2
      src/Magnum/GL/AbstractFramebuffer.h
  3. 2
      src/Magnum/GL/AbstractTexture.cpp
  4. 2
      src/Magnum/GL/AbstractTexture.h
  5. 2
      src/Magnum/GL/Buffer.cpp
  6. 2
      src/Magnum/GL/Buffer.h
  7. 2
      src/Magnum/GL/Mesh.cpp
  8. 2
      src/Magnum/GL/Mesh.h
  9. 2
      src/Magnum/GL/Renderbuffer.cpp
  10. 2
      src/Magnum/GL/Renderbuffer.h
  11. 2
      src/Magnum/GL/TransformFeedback.cpp
  12. 2
      src/Magnum/GL/TransformFeedback.h

2
src/Magnum/GL/AbstractFramebuffer.cpp

@ -103,6 +103,7 @@ Int AbstractFramebuffer::maxDualSourceDrawBuffers() {
} }
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL
void AbstractFramebuffer::createIfNotAlready() { void AbstractFramebuffer::createIfNotAlready() {
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -113,6 +114,7 @@ void AbstractFramebuffer::createIfNotAlready() {
bindInternal(); bindInternal();
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
void AbstractFramebuffer::bind() { void AbstractFramebuffer::bind() {
bindInternal(FramebufferTarget::Draw); bindInternal(FramebufferTarget::Draw);

2
src/Magnum/GL/AbstractFramebuffer.h

@ -778,7 +778,9 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
return *this; return *this;
} }
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
void MAGNUM_GL_LOCAL bindInternal(FramebufferTarget target); void MAGNUM_GL_LOCAL bindInternal(FramebufferTarget target);
FramebufferTarget MAGNUM_GL_LOCAL bindInternal(); FramebufferTarget MAGNUM_GL_LOCAL bindInternal();

2
src/Magnum/GL/AbstractTexture.cpp

@ -252,6 +252,7 @@ AbstractTexture::~AbstractTexture() {
glDeleteTextures(1, &_id); glDeleteTextures(1, &_id);
} }
#ifndef MAGNUM_TARGET_WEBGL
void AbstractTexture::createIfNotAlready() { void AbstractTexture::createIfNotAlready() {
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -262,6 +263,7 @@ void AbstractTexture::createIfNotAlready() {
bindInternal(); bindInternal();
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Containers::String AbstractTexture::label() { Containers::String AbstractTexture::label() {

2
src/Magnum/GL/AbstractTexture.h

@ -453,7 +453,9 @@ class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject {
explicit AbstractTexture(NoCreateT, GLenum target) noexcept: _target{target}, _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {} explicit AbstractTexture(NoCreateT, GLenum target) noexcept: _target{target}, _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {}
explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {} explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {}
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void bindImageInternal(Int imageUnit, Int level, bool layered, Int layer, ImageAccess access, ImageFormat format); void bindImageInternal(Int imageUnit, Int level, bool layered, Int layer, ImageAccess access, ImageFormat format);

2
src/Magnum/GL/Buffer.cpp

@ -230,6 +230,7 @@ void Buffer::setTargetHintImplementationSwiftShader(Buffer& self, const TargetHi
} }
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL
void Buffer::createIfNotAlready() { void Buffer::createIfNotAlready() {
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -241,6 +242,7 @@ void Buffer::createIfNotAlready() {
bindSomewhereInternal(_targetHint); bindSomewhereInternal(_targetHint);
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Containers::String Buffer::label() { Containers::String Buffer::label() {

2
src/Magnum/GL/Buffer.h

@ -1419,7 +1419,9 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
static void MAGNUM_GL_LOCAL setTargetHintImplementationSwiftShader(Buffer& self, TargetHint hint); static void MAGNUM_GL_LOCAL setTargetHintImplementationSwiftShader(Buffer& self, TargetHint hint);
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
static void MAGNUM_GL_LOCAL storageImplementationDefault(Buffer& self, Containers::ArrayView<const void> data, StorageFlags flags); static void MAGNUM_GL_LOCAL storageImplementationDefault(Buffer& self, Containers::ArrayView<const void> data, StorageFlags flags);

2
src/Magnum/GL/Mesh.cpp

@ -391,6 +391,7 @@ Mesh& Mesh::operator=(Mesh&& other) noexcept {
Mesh::Mesh(const GLuint id, const MeshPrimitive primitive, const ObjectFlags flags): _id{id}, _primitive{primitive}, _flags{flags} {} Mesh::Mesh(const GLuint id, const MeshPrimitive primitive, const ObjectFlags flags): _id{id}, _primitive{primitive}, _flags{flags} {}
#ifndef MAGNUM_TARGET_WEBGL
inline void Mesh::createIfNotAlready() { inline void Mesh::createIfNotAlready() {
/* If VAO extension is not available, the following is always true */ /* If VAO extension is not available, the following is always true */
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -402,6 +403,7 @@ inline void Mesh::createIfNotAlready() {
bindVAO(); bindVAO();
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Containers::String Mesh::label() { Containers::String Mesh::label() {

2
src/Magnum/GL/Mesh.h

@ -1208,7 +1208,9 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
/* Used by wrap() */ /* Used by wrap() */
explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags); explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags);
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
/* Computing stride of interleaved vertex attributes */ /* Computing stride of interleaved vertex attributes */
template<UnsignedInt location, class T, class ...U> static GLsizei strideOfInterleaved(const Attribute<location, T>& attribute, const U&... attributes) { template<UnsignedInt location, class T, class ...U> static GLsizei strideOfInterleaved(const Attribute<location, T>& attribute, const U&... attributes) {

2
src/Magnum/GL/Renderbuffer.cpp

@ -99,6 +99,7 @@ Renderbuffer::~Renderbuffer() {
glDeleteRenderbuffers(1, &_id); glDeleteRenderbuffers(1, &_id);
} }
#ifndef MAGNUM_TARGET_WEBGL
inline void Renderbuffer::createIfNotAlready() { inline void Renderbuffer::createIfNotAlready() {
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -109,6 +110,7 @@ inline void Renderbuffer::createIfNotAlready() {
bind(); bind();
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Containers::String Renderbuffer::label() { Containers::String Renderbuffer::label() {

2
src/Magnum/GL/Renderbuffer.h

@ -264,7 +264,9 @@ class MAGNUM_GL_EXPORT Renderbuffer: public AbstractObject {
static void MAGNUM_GL_LOCAL createImplementationDSA(Renderbuffer& self); static void MAGNUM_GL_LOCAL createImplementationDSA(Renderbuffer& self);
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
static void MAGNUM_GL_LOCAL storageImplementationDefault(Renderbuffer& self, RenderbufferFormat internalFormat, const Vector2i& size); static void MAGNUM_GL_LOCAL storageImplementationDefault(Renderbuffer& self, RenderbufferFormat internalFormat, const Vector2i& size);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

2
src/Magnum/GL/TransformFeedback.cpp

@ -153,6 +153,7 @@ void TransformFeedback::bindInternal() {
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, _id); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, _id);
} }
#ifndef MAGNUM_TARGET_WEBGL
inline void TransformFeedback::createIfNotAlready() { inline void TransformFeedback::createIfNotAlready() {
if(_flags & ObjectFlag::Created) return; if(_flags & ObjectFlag::Created) return;
@ -163,6 +164,7 @@ inline void TransformFeedback::createIfNotAlready() {
bindInternal(); bindInternal();
CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created); CORRADE_INTERNAL_ASSERT(_flags & ObjectFlag::Created);
} }
#endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Containers::String TransformFeedback::label() { Containers::String TransformFeedback::label() {

2
src/Magnum/GL/TransformFeedback.h

@ -436,7 +436,9 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject {
void bindInternal(); void bindInternal();
#ifndef MAGNUM_TARGET_WEBGL
void MAGNUM_GL_LOCAL createIfNotAlready(); void MAGNUM_GL_LOCAL createIfNotAlready();
#endif
static void MAGNUM_GL_LOCAL createImplementationDefault(TransformFeedback& self); static void MAGNUM_GL_LOCAL createImplementationDefault(TransformFeedback& self);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save