mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Cache vertex array pointers, a la magumagu's idea. Misc other stuff. Should give very minor speed boost.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2185 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -138,8 +138,7 @@ void LOADERDECL Pos_ReadDirect_Float()
|
||||
}
|
||||
|
||||
#define Pos_ReadIndex_Byte(T) { \
|
||||
u32 iAddress = arraybases[ARRAY_POSITION] + ((u32)Index * arraystrides[ARRAY_POSITION]); \
|
||||
u8* pData = Memory_Read_U8_Ptr(iAddress); \
|
||||
const u8* pData = cached_arraybases[ARRAY_POSITION] + ((u32)Index * arraystrides[ARRAY_POSITION]);\
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(T)(*(pData))) * posScale; \
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = ((float)(T)(*(pData+1))) * posScale; \
|
||||
if (pVtxAttr->PosElements) \
|
||||
@ -151,8 +150,7 @@ void LOADERDECL Pos_ReadDirect_Float()
|
||||
}
|
||||
|
||||
#define Pos_ReadIndex_Short(T) { \
|
||||
u32 iAddress = arraybases[ARRAY_POSITION] + ((u32)Index * arraystrides[ARRAY_POSITION]); \
|
||||
u16* pData = Memory_Read_U16_Unswapped_Ptr(iAddress); \
|
||||
const u16* pData = (const u16 *)(cached_arraybases[ARRAY_POSITION] + ((u32)Index * arraystrides[ARRAY_POSITION])); \
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(T)Common::swap16(*(pData))) * posScale; \
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = ((float)(T)Common::swap16(*(pData+1))) * posScale;\
|
||||
if (pVtxAttr->PosElements) \
|
||||
@ -164,8 +162,7 @@ void LOADERDECL Pos_ReadDirect_Float()
|
||||
}
|
||||
|
||||
#define Pos_ReadIndex_Float() { \
|
||||
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]); \
|
||||
u32* pData = Memory_Read_U32_Unswapped_Ptr(iAddress); \
|
||||
const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION])); \
|
||||
((u32*)VertexManager::s_pCurBufferPointer)[0] = Common::swap32(*(pData)); \
|
||||
((u32*)VertexManager::s_pCurBufferPointer)[1] = Common::swap32(*(pData+1)); \
|
||||
if (pVtxAttr->PosElements) \
|
||||
|
Reference in New Issue
Block a user