mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 12:05:39 +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}
|
, mScalableNonAspect {false}
|
||||||
, mHasRGBAData {false}
|
, mHasRGBAData {false}
|
||||||
, mPendingRasterization {false}
|
, mPendingRasterization {false}
|
||||||
, mLinearMagnify {false}
|
|
||||||
, mMipmapping {false}
|
, mMipmapping {false}
|
||||||
|
, mLinearMagnify {false}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,8 +314,14 @@ void TextureData::setSourceSize(float width, float height)
|
||||||
|
|
||||||
size_t TextureData::getVRAMUsage()
|
size_t TextureData::getVRAMUsage()
|
||||||
{
|
{
|
||||||
if (mHasRGBAData || mTextureID != 0)
|
if (mHasRGBAData || mTextureID != 0) {
|
||||||
return mWidth * mHeight * 4;
|
// The estimated increase in VRAM usage with mipmapping enabled is 33%
|
||||||
else
|
if (mMipmapping)
|
||||||
|
return {static_cast<size_t>(static_cast<float>(mWidth * mHeight * 4) * 1.33f)};
|
||||||
|
else
|
||||||
|
return mWidth * mHeight * 4;
|
||||||
|
}
|
||||||
|
else {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,8 @@ private:
|
||||||
std::atomic<bool> mScalableNonAspect;
|
std::atomic<bool> mScalableNonAspect;
|
||||||
std::atomic<bool> mHasRGBAData;
|
std::atomic<bool> mHasRGBAData;
|
||||||
std::atomic<bool> mPendingRasterization;
|
std::atomic<bool> mPendingRasterization;
|
||||||
|
std::atomic<bool> mMipmapping;
|
||||||
bool mLinearMagnify;
|
bool mLinearMagnify;
|
||||||
bool mMipmapping;
|
|
||||||
bool mReloadable;
|
bool mReloadable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue