diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-02-09 20:35:30 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-02-09 20:35:30 +0000 |
| commit | d209d4a577ccaade93ecde00fe37c68741602948 (patch) | |
| tree | fda0b26c61afb729a17dd1e3a52bc3eb996bdad4 /Source/Core/VideoCommon/Src/VertexLoader_Position.cpp | |
| parent | 5edef947536c1dc7aef41603530ad9b5545cd4f0 (diff) | |
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
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader_Position.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoader_Position.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp index 922d1d4db5..44d15ccc23 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp @@ -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) \ |
