From 1855d56f1ab3a6284ac361e5ed82f422ac5de9a2 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 18 Jan 2015 05:13:00 +0100 Subject: [PATCH] VertexLoaderX64: fix a bunch of stuff Suggestions by @degasus and @FioraAeterna. --- Source/Core/VideoCommon/CPMemory.h | 1 - Source/Core/VideoCommon/VertexLoaderX64.cpp | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoCommon/CPMemory.h b/Source/Core/VideoCommon/CPMemory.h index 4fb4b67f20..51e1ccc74f 100644 --- a/Source/Core/VideoCommon/CPMemory.h +++ b/Source/Core/VideoCommon/CPMemory.h @@ -26,7 +26,6 @@ enum INDEX16 = 3, MASK_INDEXED = 2, - MASK_ALL = 3, }; enum diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp index c1f96eb99d..bf841ec9a8 100644 --- a/Source/Core/VideoCommon/VertexLoaderX64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp @@ -153,6 +153,7 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format, int eleme case FORMAT_32B_888x: case FORMAT_32B_8888: MOV(32, R(scratch1), data); + // See VertexLoader_Color.cpp for a comment on this condition. if (format != FORMAT_32B_8888 || !elements) OR(32, R(scratch1), Imm32(0xFF000000)); MOV(32, MDisp(dst_reg, m_dst_ofs), R(scratch1)); @@ -327,7 +328,7 @@ void VertexLoaderX64::GenerateVertexLoader() if (m_VtxDesc.Normal) { - static const u8 map[] = {7, 6, 15, 14, 30}; + static const u8 map[] = {7, 6, 15, 14, 0}; u8 scaling_exponent = map[m_VtxAttr.NormalFormat]; for (int i = 0; i < (m_VtxAttr.NormalElements ? 3 : 1); i++) @@ -385,8 +386,6 @@ void VertexLoaderX64::GenerateVertexLoader() m_native_vtx_decl.texcoords[i].type = VAR_FLOAT; m_native_vtx_decl.texcoords[i].integer = false; MOVZX(64, 8, scratch1, MDisp(src_reg, texmatidx_ofs[i])); - PXOR(XMM0, R(XMM0)); - CVTSI2SS(XMM0, R(scratch1)); if (tc[i]) { CVTSI2SS(XMM0, R(scratch1)); @@ -422,7 +421,7 @@ void VertexLoaderX64::GenerateVertexLoader() RET(); SetJumpTarget(m_skip_vertex); - ADD(32, R(skipped_reg), Imm8(m_VtxDesc.Position == INDEX8 ? 1 : 2)); + ADD(32, R(skipped_reg), Imm8(1)); JMP(cont); } else