diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 4edb6a89ef..9538b1b11d 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -9,7 +9,6 @@ #include "VideoCommon/BoundingBox.h" #include "VideoCommon/DataReader.h" -#include "VideoCommon/LookUpTables.h" #include "VideoCommon/PixelEngine.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoader_Color.h" @@ -19,11 +18,6 @@ #include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" -#ifndef _WIN32 - #undef inline - #define inline -#endif - // This pointer is used as the source/dst for all fixed function loader calls u8* g_video_buffer_read_ptr; u8* g_vertex_manager_write_ptr; diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp index c0e8e533df..b17731509d 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.cpp +++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp @@ -77,22 +77,15 @@ void VertexLoaderBase::AppendToString(std::string *dest) const static const char *posMode[4] = { "Inv", - "Dir", - "I8", - "I16", + "Dir", "I8", "I16", }; - static const char *posFormats[5] = { + static const char *posFormats[8] = { "u8", "s8", "u16", "s16", "flt", + "Inv", "Inv", "Inv", }; static const char *colorFormat[8] = { - "565", - "888", - "888x", - "4444", - "6666", - "8888", - "Inv", - "Inv", + "565", "888", "888x", "4444", "6666", "8888", + "Inv", "Inv", }; dest->append(StringFromFormat("%ib skin: %i P: %i %s-%s ", diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp index de3b90b449..50c46da027 100644 --- a/Source/Core/VideoCommon/VertexLoaderX64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp @@ -11,6 +11,8 @@ using namespace Gen; +#define VERTEX_LOADER_REGS {XMM0+16} + static const X64Reg src_reg = ABI_PARAM1; static const X64Reg dst_reg = ABI_PARAM2; static const X64Reg scratch1 = RAX; @@ -293,10 +295,12 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format) void VertexLoaderX64::GenerateVertexLoader() { + ABI_PushRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8); + // Backup count since we're going to count it down. PUSH(32, R(ABI_PARAM3)); - // We use ABI_PARAM3 for scratch2. + // ABI_PARAM3 is one of the lower registers, so free it for scratch2. MOV(32, R(count_reg), R(ABI_PARAM3)); if (m_VtxDesc.Position & MASK_INDEXED) @@ -427,6 +431,8 @@ void VertexLoaderX64::GenerateVertexLoader() // Get the original count. POP(32, R(ABI_RETURN)); + ABI_PopRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8); + if (m_VtxDesc.Position & MASK_INDEXED) { SUB(32, R(ABI_RETURN), R(skipped_reg)); diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp index 00255de00a..b0fc63d20e 100644 --- a/Source/Core/VideoCommon/VertexLoader_Color.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp @@ -4,7 +4,6 @@ #include "Common/CommonTypes.h" -#include "VideoCommon/LookUpTables.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoader_Color.h" #include "VideoCommon/VertexManagerBase.h"