From dc01e261d1c12e748d59344fbbdd7e89457a58ae Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Thu, 15 Jan 2015 05:32:14 +0100 Subject: [PATCH] VertexLoaderX64: fix duplicate register allocation Thanks to @shuffle2 for noticing this. --- Source/Core/VideoCommon/VertexLoaderX64.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp index b59de2c71d..c1f96eb99d 100644 --- a/Source/Core/VideoCommon/VertexLoaderX64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp @@ -12,11 +12,11 @@ using namespace Gen; static const X64Reg src_reg = ABI_PARAM1; static const X64Reg dst_reg = ABI_PARAM2; -static const X64Reg count_reg = ABI_PARAM3; static const X64Reg scratch1 = RAX; -static const X64Reg scratch2 = R8; -static const X64Reg scratch3 = R9; -static const X64Reg skipped_reg = R10; +static const X64Reg scratch2 = ABI_PARAM3; +static const X64Reg scratch3 = ABI_PARAM4; +static const X64Reg count_reg = R10; +static const X64Reg skipped_reg = R11; VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att): VertexLoaderBase(vtx_desc, vtx_att) { @@ -284,7 +284,10 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format, int eleme void VertexLoaderX64::GenerateVertexLoader() { // Backup count since we're going to count it down. - PUSH(32, R(count_reg)); + PUSH(32, R(ABI_PARAM3)); + + // We use ABI_PARAM3 for scratch2. + MOV(32, R(count_reg), R(ABI_PARAM3)); if (m_VtxDesc.Position & MASK_INDEXED) XOR(32, R(skipped_reg), R(skipped_reg));