mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
added the possibility to allocate aligned memory, an use it to allocate the buffer utilized in texture decoding, this will make a little easy to use aligned writes when possible in sse2/3 optimized algorithms.
some code additions for future use ;). please gcc user test this as i don't have opportunity to test it myself i only use reference code to. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7247 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -90,6 +90,7 @@ extern Statistics stats;
|
||||
|
||||
#ifdef STATISTICS
|
||||
#define INCSTAT(a) (a)++;
|
||||
#define DECSTAT(a) (a)--;
|
||||
#define ADDSTAT(a,b) (a)+=(b);
|
||||
#define SETSTAT(a,x) (a)=(int)(x);
|
||||
#define SETSTAT_UINT(a,x) (a)=(u32)(x);
|
||||
|
@ -23,7 +23,7 @@ enum
|
||||
|
||||
TextureCache *g_texture_cache;
|
||||
|
||||
u8 *TextureCache::temp = NULL;
|
||||
GC_ALIGNED16(u8 *TextureCache::temp) = NULL;
|
||||
|
||||
TextureCache::TexCache TextureCache::textures;
|
||||
bool TextureCache::DeferredInvalidate;
|
||||
@ -44,7 +44,7 @@ TextureCache::TCacheEntryBase::~TCacheEntryBase()
|
||||
TextureCache::TextureCache()
|
||||
{
|
||||
if (!temp)
|
||||
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
|
||||
temp =(u8*) AllocateAlignedMemory(TEMP_SIZE,16);
|
||||
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
|
||||
if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
|
||||
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
|
||||
@ -81,7 +81,7 @@ TextureCache::~TextureCache()
|
||||
Invalidate(true);
|
||||
if (temp)
|
||||
{
|
||||
FreeMemoryPages(temp, TEMP_SIZE);
|
||||
FreeAlignedMemory(temp);
|
||||
temp = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
protected:
|
||||
TextureCache();
|
||||
|
||||
static u8 *temp;
|
||||
static GC_ALIGNED16(u8 *temp);
|
||||
|
||||
private:
|
||||
typedef std::map<u32, TCacheEntryBase*> TexCache;
|
||||
|
@ -44,7 +44,7 @@ extern const unsigned char sfont_raw[][9*10];
|
||||
|
||||
// TRAM
|
||||
// STATE_TO_SAVE
|
||||
u8 texMem[TMEM_SIZE];
|
||||
GC_ALIGNED16(u8 texMem[TMEM_SIZE]);
|
||||
|
||||
|
||||
// Gamecube/Wii texture decoder
|
||||
|
@ -23,7 +23,7 @@ enum
|
||||
TMEM_SIZE = 1024*1024,
|
||||
HALFTMEM_SIZE = 512*1024
|
||||
};
|
||||
extern u8 texMem[TMEM_SIZE];
|
||||
extern GC_ALIGNED16(u8 texMem[TMEM_SIZE]);
|
||||
|
||||
enum TextureFormat
|
||||
{
|
||||
|
Reference in New Issue
Block a user