summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-01-11 12:48:04 +0100
committerdegasus <wickmarkus@web.de>2015-01-11 22:23:35 +0100
commit1261f5f7f4f15fba126119eda0d0639568e2b101 (patch)
treed9bee28177e868c488c3079346b1ff61dda1ec8a /Source/Core/VideoCommon/TextureCacheBase.cpp
parent2b47df07b6e256e04f28e6b28faaa45b9fccf17c (diff)
TextureCache: inline arguments into texture cache
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 88737a1e95..561c3e24ea 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -290,10 +290,20 @@ static TextureCache::TCacheEntryBase* ReturnEntry(unsigned int stage, TextureCac
return entry;
}
-TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
- u32 const address, unsigned int width, unsigned int height, int const texformat,
- unsigned int const tlutaddr, int const tlutfmt, bool const use_mipmaps, unsigned int maxlevel, bool const from_tmem)
+TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
{
+ const FourTexUnits &tex = bpmem.tex[stage >> 2];
+ const u32 id = stage & 3;
+ const u32 address = (tex.texImage3[id].image_base/* & 0x1FFFFF*/) << 5;
+ u32 width = tex.texImage0[id].width + 1;
+ u32 height = tex.texImage0[id].height + 1;
+ const int texformat = tex.texImage0[id].format;
+ const u32 tlutaddr = tex.texTlut[id].tmem_offset << 9;
+ const u32 tlutfmt = tex.texTlut[id].tlut_format;
+ const bool use_mipmaps = (tex.texMode0[id].min_filter & 3) != 0;
+ u32 maxlevel = (tex.texMode1[id].max_lod + 0xf) / 0x10;
+ const bool from_tmem = tex.texImage1[id].image_type != 0;
+
if (0 == address)
return nullptr;