mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Mipmapping is now taken into consideration when calculating the VRAM usage.
This commit is contained in:
parent
11f2d2dfa1
commit
b9303e5494
|
@ -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<size_t>(static_cast<float>(mWidth * mHeight * 4) * 1.33f)};
|
||||
else
|
||||
return mWidth * mHeight * 4;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,8 +99,8 @@ private:
|
|||
std::atomic<bool> mScalableNonAspect;
|
||||
std::atomic<bool> mHasRGBAData;
|
||||
std::atomic<bool> mPendingRasterization;
|
||||
std::atomic<bool> mMipmapping;
|
||||
bool mLinearMagnify;
|
||||
bool mMipmapping;
|
||||
bool mReloadable;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue