diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index ce784acd6..fc7da571c 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -38,8 +38,8 @@ TextureData::TextureData(bool tile) , mScalableNonAspect {false} , mHasRGBAData {false} , mPendingRasterization {false} - , mLinearMagnify {false} , mMipmapping {false} + , mLinearMagnify {false} { } @@ -314,8 +314,14 @@ void TextureData::setSourceSize(float width, float height) size_t TextureData::getVRAMUsage() { - if (mHasRGBAData || mTextureID != 0) - return mWidth * mHeight * 4; - else + if (mHasRGBAData || mTextureID != 0) { + // The estimated increase in VRAM usage with mipmapping enabled is 33% + if (mMipmapping) + return {static_cast(static_cast(mWidth * mHeight * 4) * 1.33f)}; + else + return mWidth * mHeight * 4; + } + else { return 0; + } } diff --git a/es-core/src/resources/TextureData.h b/es-core/src/resources/TextureData.h index dd5d85be5..57f435d29 100644 --- a/es-core/src/resources/TextureData.h +++ b/es-core/src/resources/TextureData.h @@ -99,8 +99,8 @@ private: std::atomic mScalableNonAspect; std::atomic mHasRGBAData; std::atomic mPendingRasterization; + std::atomic mMipmapping; bool mLinearMagnify; - bool mMipmapping; bool mReloadable; };