From d772f51050c8326b4d4c4b3c22935d9196cddda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 26 Apr 2014 11:24:08 +0200 Subject: [PATCH] Hide texture state members which are not used on ES. Shaved eight bytes off total memory footprint, yay! --- src/Magnum/Implementation/TextureState.cpp | 11 +++++++++-- src/Magnum/Implementation/TextureState.h | 10 +++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index a2b04cc2e..3ac20d023 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -36,11 +36,18 @@ namespace Magnum { namespace Implementation { -TextureState::TextureState(Context& context, std::vector& extensions): maxSize{}, max3DSize{}, maxArrayLayers{}, maxCubeMapSize{}, +TextureState::TextureState(Context& context, std::vector& extensions): maxSize{}, max3DSize{}, maxCubeMapSize{}, + #ifndef MAGNUM_TARGET_GLES2 + maxArrayLayers{}, + #endif #ifndef MAGNUM_TARGET_GLES maxRectangleSize{}, maxBufferSize{}, #endif - maxTextureUnits(0), maxLodBias(0.0f), maxMaxAnisotropy(0.0f), currentTextureUnit(0) + maxTextureUnits(0), + #ifndef MAGNUM_TARGET_GLES + maxLodBias{0.0f}, + #endif + maxMaxAnisotropy(0.0f), currentTextureUnit(0) #ifndef MAGNUM_TARGET_GLES , maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0) #endif diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index d9f558cb5..668fd5f53 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -83,15 +83,19 @@ struct TextureState { GLint maxSize, max3DSize, - maxArrayLayers, maxCubeMapSize; + #ifndef MAGNUM_TARGET_GLES2 + GLint maxArrayLayers; + #endif #ifndef MAGNUM_TARGET_GLES GLint maxRectangleSize, maxBufferSize; #endif GLint maxTextureUnits; - GLfloat maxLodBias, - maxMaxAnisotropy; + #ifndef MAGNUM_TARGET_GLES + GLfloat maxLodBias; + #endif + GLfloat maxMaxAnisotropy; GLint currentTextureUnit; #ifndef MAGNUM_TARGET_GLES GLint maxColorSamples,