mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 17:53:42 +01:00
Pack texture cache entries just a bit tighter.
This commit is contained in:
1 parent
7d63a10fdd
commit
71afaffc20
4 files changed
+10
-10
No files matched your search
@@ -29,7 +29,7 @@ bool TextureCacheCommon::SetOffsetTexture(u32 offset) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, int maxLevel) {
|
||||
void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, u8 maxLevel) {
|
||||
minFilt = gstate.texfilter & 0x7;
|
||||
magFilt = (gstate.texfilter>>8) & 1;
|
||||
sClamp = gstate.isTexCoordClampedS();
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
int numInvalidated;
|
||||
u32 framesUntilNextFullHash;
|
||||
u8 format;
|
||||
u8 maxLevel;
|
||||
u16 dim;
|
||||
u16 bufw;
|
||||
union {
|
||||
@@ -77,7 +78,6 @@ public:
|
||||
int invalidHint;
|
||||
u32 fullhash;
|
||||
u32 cluthash;
|
||||
int maxLevel;
|
||||
float lodBias;
|
||||
|
||||
// Cache the current filter settings so we can avoid setting it again.
|
||||
@@ -107,13 +107,13 @@ public:
|
||||
SetAlphaStatus(STATUS_ALPHA_SIMPLE);
|
||||
}
|
||||
}
|
||||
bool Matches(u16 dim2, u8 format2, int maxLevel2);
|
||||
bool Matches(u16 dim2, u8 format2, u8 maxLevel2);
|
||||
};
|
||||
|
||||
protected:
|
||||
void GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, int maxLevel);
|
||||
void GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, u8 maxLevel);
|
||||
};
|
||||
|
||||
inline bool TextureCacheCommon::TexCacheEntry::Matches(u16 dim2, u8 format2, int maxLevel2) {
|
||||
inline bool TextureCacheCommon::TexCacheEntry::Matches(u16 dim2, u8 format2, u8 maxLevel2) {
|
||||
return dim == dim2 && format == format2 && maxLevel == maxLevel2;
|
||||
}
|
||||
@@ -1047,7 +1047,7 @@ void TextureCacheDX9::SetTexture(bool force) {
|
||||
}
|
||||
|
||||
int bufw = GetTextureBufw(0, texaddr, format);
|
||||
int maxLevel = gstate.getTextureMaxLevel();
|
||||
u8 maxLevel = gstate.getTextureMaxLevel();
|
||||
|
||||
u32 texhash = MiniHash((const u32 *)Memory::GetPointer(texaddr));
|
||||
u32 fullhash = 0;
|
||||
@@ -1294,7 +1294,7 @@ void TextureCacheDX9::SetTexture(bool force) {
|
||||
|
||||
// Adjust maxLevel to actually present levels..
|
||||
bool badMipSizes = false;
|
||||
for (int i = 0; i <= maxLevel; i++) {
|
||||
for (u32 i = 0; i <= maxLevel; i++) {
|
||||
// If encountering levels pointing to nothing, adjust max level.
|
||||
u32 levelTexaddr = gstate.getTextureAddress(i);
|
||||
if (!Memory::IsValidAddress(levelTexaddr)) {
|
||||
@@ -1368,7 +1368,7 @@ void TextureCacheDX9::SetTexture(bool force) {
|
||||
|
||||
// Mipmapping is only enabled when texture scaling is disabled.
|
||||
if (maxLevel > 0 && g_Config.iTexScalingLevel == 1) {
|
||||
for (int i = 1; i <= maxLevel; i++) {
|
||||
for (u32 i = 1; i <= maxLevel; i++) {
|
||||
LoadTextureLevel(*entry, i, maxLevel, replaceImages, scaleFactor, dstFmt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1114,7 +1114,7 @@ void TextureCache::SetTexture(bool force) {
|
||||
}
|
||||
|
||||
int bufw = GetTextureBufw(0, texaddr, format);
|
||||
int maxLevel = gstate.getTextureMaxLevel();
|
||||
u8 maxLevel = gstate.getTextureMaxLevel();
|
||||
|
||||
u32 texhash = MiniHash((const u32 *)Memory::GetPointerUnchecked(texaddr));
|
||||
u32 fullhash = 0;
|
||||
@@ -1362,7 +1362,7 @@ void TextureCache::SetTexture(bool force) {
|
||||
|
||||
// Adjust maxLevel to actually present levels..
|
||||
bool badMipSizes = false;
|
||||
for (int i = 0; i <= maxLevel; i++) {
|
||||
for (u32 i = 0; i <= maxLevel; i++) {
|
||||
// If encountering levels pointing to nothing, adjust max level.
|
||||
u32 levelTexaddr = gstate.getTextureAddress(i);
|
||||
if (!Memory::IsValidAddress(levelTexaddr)) {
|
||||
|
||||
Reference in new issue
Block a user