From 78c3a220600b6cbbd063693d89d423a985125408 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 24 Jul 2014 01:51:37 +0200 Subject: [PATCH] VertexLoader: take the VAT object directly for RunVertices --- Source/Core/VideoCommon/VertexLoader.cpp | 24 +++++++++---------- Source/Core/VideoCommon/VertexLoader.h | 4 ++-- .../Core/VideoCommon/VertexLoaderManager.cpp | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index f83565ae26..bb73193c04 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -813,7 +813,7 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value) } #endif -void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const count) +void VertexLoader::SetupRunVertices(const VAT& vat, int primitive, int const count) { m_numLoadedVertices += count; @@ -826,15 +826,15 @@ void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const g_nativeVertexFmt = m_NativeFmt; // Load position and texcoord scale factors. - m_VtxAttr.PosFrac = g_VtxAttr[vtx_attr_group].g0.PosFrac; - m_VtxAttr.texCoord[0].Frac = g_VtxAttr[vtx_attr_group].g0.Tex0Frac; - m_VtxAttr.texCoord[1].Frac = g_VtxAttr[vtx_attr_group].g1.Tex1Frac; - m_VtxAttr.texCoord[2].Frac = g_VtxAttr[vtx_attr_group].g1.Tex2Frac; - m_VtxAttr.texCoord[3].Frac = g_VtxAttr[vtx_attr_group].g1.Tex3Frac; - m_VtxAttr.texCoord[4].Frac = g_VtxAttr[vtx_attr_group].g2.Tex4Frac; - m_VtxAttr.texCoord[5].Frac = g_VtxAttr[vtx_attr_group].g2.Tex5Frac; - m_VtxAttr.texCoord[6].Frac = g_VtxAttr[vtx_attr_group].g2.Tex6Frac; - m_VtxAttr.texCoord[7].Frac = g_VtxAttr[vtx_attr_group].g2.Tex7Frac; + m_VtxAttr.PosFrac = vat.g0.PosFrac; + m_VtxAttr.texCoord[0].Frac = vat.g0.Tex0Frac; + m_VtxAttr.texCoord[1].Frac = vat.g1.Tex1Frac; + m_VtxAttr.texCoord[2].Frac = vat.g1.Tex2Frac; + m_VtxAttr.texCoord[3].Frac = vat.g1.Tex3Frac; + m_VtxAttr.texCoord[4].Frac = vat.g2.Tex4Frac; + m_VtxAttr.texCoord[5].Frac = vat.g2.Tex5Frac; + m_VtxAttr.texCoord[6].Frac = vat.g2.Tex6Frac; + m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac; posScale = fractionTable[m_VtxAttr.PosFrac]; if (m_NativeFmt->m_components & VB_HAS_UVALL) @@ -870,7 +870,7 @@ void VertexLoader::ConvertVertices ( int count ) #endif } -void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int const count) +void VertexLoader::RunVertices(const VAT& vat, int primitive, int const count) { if (bpmem.genMode.cullmode == 3 && primitive < 5) { @@ -878,7 +878,7 @@ void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int const coun DataSkip(count * m_VertexSize); return; } - SetupRunVertices(vtx_attr_group, primitive, count); + SetupRunVertices(vat, primitive, count); VertexManager::PrepareForAdditionalData(primitive, count, native_stride); ConvertVertices(count); IndexGenerator::AddIndices(primitive, count); diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h index d912159e7d..a438ba8933 100644 --- a/Source/Core/VideoCommon/VertexLoader.h +++ b/Source/Core/VideoCommon/VertexLoader.h @@ -107,8 +107,8 @@ public: int GetVertexSize() const {return m_VertexSize;} - void SetupRunVertices(int vtx_attr_group, int primitive, int const count); - void RunVertices(int vtx_attr_group, int primitive, int count); + void SetupRunVertices(const VAT& vat, int primitive, int const count); + void RunVertices(const VAT& vat, int primitive, int count); // For debugging / profiling void AppendToString(std::string *dest) const; diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index d8417042b7..16bb4689ac 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -126,7 +126,7 @@ void RunVertices(int vtx_attr_group, int primitive, int count) { if (!count) return; - RefreshLoader(vtx_attr_group)->RunVertices(vtx_attr_group, primitive, count); + RefreshLoader(vtx_attr_group)->RunVertices(g_VtxAttr[vtx_attr_group], primitive, count); } int GetVertexSize(int vtx_attr_group)