Vertexloader cleanup/fixing: Don't use floating point copies unless necessary, don't allow scale factors for floating point texture coordinates.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1282 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-11-23 23:54:52 +00:00
parent 5672367b4c
commit b19859450e
4 changed files with 91 additions and 52 deletions

View File

@ -94,15 +94,15 @@ void LOADERDECL TexCoord_ReadDirect_Short2()
void LOADERDECL TexCoord_ReadDirect_Float1()
{
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32() * tcScaleU[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = DataReadU32();
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Float2()
{
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = DataReadF32() * tcScaleV[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = DataReadU32();
((u32*)VertexManager::s_pCurBufferPointer)[1] = DataReadU32();
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -201,9 +201,7 @@ void LOADERDECL TexCoord_ReadIndex8_Float1()
{
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress);
((float*)VertexManager::s_pCurBufferPointer)[0] = *(float*)&uTemp * tcScaleU[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U32(iAddress);
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
@ -212,11 +210,8 @@ void LOADERDECL TexCoord_ReadIndex8_Float2()
{
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress);
((float*)VertexManager::s_pCurBufferPointer)[0] = *(float*)&uTemp * tcScaleU[tcIndex];
uTemp = Memory_Read_U32(iAddress+4);
((float*)VertexManager::s_pCurBufferPointer)[1] = *(float*)&uTemp * tcScaleV[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U32(iAddress);
((u32*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U32(iAddress+4);
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -315,9 +310,8 @@ void LOADERDECL TexCoord_ReadIndex16_Float1()
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
((float*)VertexManager::s_pCurBufferPointer)[0] = *(float*)&uTemp * tcScaleU[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U32(iAddress);
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
@ -326,11 +320,9 @@ void LOADERDECL TexCoord_ReadIndex16_Float2()
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
((float*)VertexManager::s_pCurBufferPointer)[0] = *(float*)&uTemp * tcScaleU[tcIndex];
uTemp = Memory_Read_U32(iAddress+4);
((float*)VertexManager::s_pCurBufferPointer)[1] = *(float*)&uTemp * tcScaleV[tcIndex];
((u32*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U32(iAddress);
((u32*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U32(iAddress + 4);
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;