From 804341d4fe871f5c92d3c32a73e7df2a6c6c14fb Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 19 Jan 2015 17:38:40 +0100 Subject: [PATCH] VertexLoader: fix position offset bug --- Source/Core/VideoCommon/VertexLoader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 734ea9a4a6..1122a04f72 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -145,7 +145,6 @@ void VertexLoader::CompileVertexTranslator() m_VertexSize += 1; } - if (m_VtxDesc.Tex0MatIdx) {m_VertexSize += 1; components |= VB_HAS_TEXMTXIDX0; WriteCall(TexMtx_ReadDirect_UByte); } if (m_VtxDesc.Tex1MatIdx) {m_VertexSize += 1; components |= VB_HAS_TEXMTXIDX1; WriteCall(TexMtx_ReadDirect_UByte); } if (m_VtxDesc.Tex2MatIdx) {m_VertexSize += 1; components |= VB_HAS_TEXMTXIDX2; WriteCall(TexMtx_ReadDirect_UByte); } @@ -159,12 +158,12 @@ void VertexLoader::CompileVertexTranslator() WriteCall(VertexLoader_Position::GetFunction(m_VtxDesc.Position, m_VtxAttr.PosFormat, m_VtxAttr.PosElements)); m_VertexSize += VertexLoader_Position::GetSize(m_VtxDesc.Position, m_VtxAttr.PosFormat, m_VtxAttr.PosElements); - nat_offset += 12; m_native_vtx_decl.position.components = 3; m_native_vtx_decl.position.enable = true; - m_native_vtx_decl.position.offset = 0; + m_native_vtx_decl.position.offset = nat_offset; m_native_vtx_decl.position.type = VAR_FLOAT; m_native_vtx_decl.position.integer = false; + nat_offset += 12; // Normals if (m_VtxDesc.Normal != NOT_PRESENT)