mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DataReader migration to faster one: first step.
TODO: doing it for DX9, move DataReader to VideoCommon, remove dirty debug #def if ok git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@729 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -123,30 +123,30 @@ TPipelineFunction VertexLoader_Normal::GetFunction(unsigned int _type, unsigned
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void LOADERDECL VertexLoader_Normal::Normal_DirectByte(void* _p)
|
||||
{
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
LOG_NORM8();
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(signed char)ReadBuffer8()+0.5f) / 127.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(signed char)DataReadU8()+0.5f) / 127.5f;
|
||||
}
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_DirectShort(void* _p)
|
||||
{
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[2] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = DataReadU16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = DataReadU16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[2] = DataReadU16();
|
||||
VertexManager::s_pCurBufferPointer += 6;
|
||||
LOG_NORM16()
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(signed short)ReadBuffer16()+0.5f) / 32767.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[1] = ((float)(signed short)ReadBuffer16()+0.5f) / 32767.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[2] = ((float)(signed short)ReadBuffer16()+0.5f) / 32767.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[0] = ((float)(signed short)DataReadU16()+0.5f) / 32767.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[1] = ((float)(signed short)DataReadU16()+0.5f) / 32767.5f;
|
||||
// ((float*)VertexManager::s_pCurBufferPointer)[2] = ((float)(signed short)DataReadU16()+0.5f) / 32767.5f;
|
||||
}
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_DirectFloat(void* _p)
|
||||
{
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[2] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = DataReadF32();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[2] = DataReadF32();
|
||||
VertexManager::s_pCurBufferPointer += 12;
|
||||
LOG_NORMF()
|
||||
}
|
||||
@ -155,9 +155,9 @@ void LOADERDECL VertexLoader_Normal::Normal_DirectByte3(void* _p)
|
||||
{
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = ReadBuffer8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
*VertexManager::s_pCurBufferPointer++ = DataReadU8();
|
||||
LOG_NORM8();
|
||||
}
|
||||
}
|
||||
@ -166,9 +166,9 @@ void LOADERDECL VertexLoader_Normal::Normal_DirectShort3(void* _p)
|
||||
{
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[2] = ReadBuffer16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = DataReadU16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = DataReadU16();
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[2] = DataReadU16();
|
||||
VertexManager::s_pCurBufferPointer += 6;
|
||||
LOG_NORM16();
|
||||
}
|
||||
@ -178,9 +178,9 @@ void LOADERDECL VertexLoader_Normal::Normal_DirectFloat3(void* _p)
|
||||
{
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[2] = ReadBuffer32F();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = DataReadF32();
|
||||
((float*)VertexManager::s_pCurBufferPointer)[2] = DataReadF32();
|
||||
VertexManager::s_pCurBufferPointer += 12;
|
||||
LOG_NORMF();
|
||||
}
|
||||
@ -191,7 +191,7 @@ void LOADERDECL VertexLoader_Normal::Normal_DirectFloat3(void* _p)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index8_Byte(void* _p)
|
||||
{
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress+1);
|
||||
@ -205,7 +205,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Byte(void* _p)
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index8_Short(void* _p)
|
||||
{
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U16(iAddress);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U16(iAddress+2);
|
||||
@ -216,7 +216,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Short(void* _p)
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index8_Float(void* _p)
|
||||
{
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_Float(iAddress);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_Float(iAddress+4);
|
||||
@ -229,7 +229,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Byte3(void* _p)
|
||||
{
|
||||
if (index3) {
|
||||
for (int i=0; i<3; i++) {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 1*3*i;
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress+1);
|
||||
@ -238,7 +238,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Byte3(void* _p)
|
||||
}
|
||||
}
|
||||
else {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
for (int i=0; i<3; i++) {
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 1*3*i;
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
@ -253,7 +253,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Short3(void* _p)
|
||||
{
|
||||
if (index3) {
|
||||
for (int i=0; i<3; i++) {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 2*3*i;
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U16(iAddress);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U16(iAddress+2);
|
||||
@ -263,7 +263,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Short3(void* _p)
|
||||
}
|
||||
}
|
||||
else {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
for (int i=0; i<3; i++) {
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 2*3*i;
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U16(iAddress);
|
||||
@ -279,7 +279,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Float3(void* _p)
|
||||
{
|
||||
if (index3) {
|
||||
for (int i=0; i<3; i++) {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 4*3*i;
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_Float(iAddress);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_Float(iAddress+4);
|
||||
@ -289,7 +289,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Float3(void* _p)
|
||||
}
|
||||
}
|
||||
else {
|
||||
u8 Index = ReadBuffer8();
|
||||
u8 Index = DataReadU8();
|
||||
for (int i=0; i<3; i++) {
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 4*3*i;
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_Float(iAddress);
|
||||
@ -307,7 +307,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index8_Float3(void* _p)
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index16_Byte(void* _p)
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress+1);
|
||||
@ -317,7 +317,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Byte(void* _p)
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index16_Short(void* _p)
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U16(iAddress);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U16(iAddress+2);
|
||||
@ -328,7 +328,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Short(void* _p)
|
||||
|
||||
void LOADERDECL VertexLoader_Normal::Normal_Index16_Float(void* _p)
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_Float(iAddress);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_Float(iAddress+4);
|
||||
@ -341,7 +341,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Byte3(void* _p)
|
||||
{
|
||||
if (index3) {
|
||||
for (int i=0; i<3; i++) {
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 1*3*i;
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress+1);
|
||||
@ -350,7 +350,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Byte3(void* _p)
|
||||
}
|
||||
}
|
||||
else {
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
for (int i=0; i<3; i++) {
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 1*3*i;
|
||||
*VertexManager::s_pCurBufferPointer++ = Memory_Read_U8(iAddress);
|
||||
@ -367,7 +367,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Short3(void* _p)
|
||||
{
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 2*3*i;
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_U16(iAddress);
|
||||
((u16*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_U16(iAddress+2);
|
||||
@ -378,7 +378,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Short3(void* _p)
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 2*3*i;
|
||||
@ -397,7 +397,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Float3(void* _p)
|
||||
{
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 4*3*i;
|
||||
((float*)VertexManager::s_pCurBufferPointer)[0] = Memory_Read_Float(iAddress);
|
||||
((float*)VertexManager::s_pCurBufferPointer)[1] = Memory_Read_Float(iAddress+4);
|
||||
@ -408,7 +408,7 @@ void LOADERDECL VertexLoader_Normal::Normal_Index16_Float3(void* _p)
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 Index = ReadBuffer16();
|
||||
u16 Index = DataReadU16();
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
u32 iAddress = arraybases[ARRAY_NORMAL] + (Index * arraystrides[ARRAY_NORMAL]) + 4*3*i;
|
||||
|
Reference in New Issue
Block a user