diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 89965f8710..1d8a1f8e88 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -220,12 +220,13 @@ void VertexLoader::CompileVertexTranslator() { // if there's more tex coords later, have to write a dummy call bool has_more = false; - for (size_t j = 0; j < m_VtxDesc.high.TexCoord.Size(); ++j) + for (size_t j = i + 1; j < m_VtxDesc.high.TexCoord.Size(); ++j) { if (m_VtxDesc.high.TexCoord[j] != VertexComponentFormat::NotPresent) { has_more = true; - WriteCall(VertexLoader_TextCoord::GetDummyFunction()); // important to get indices right! + // Keep tcIndex in sync so that the correct array is used later + WriteCall(VertexLoader_TextCoord::GetDummyFunction()); break; } else if (m_VtxDesc.low.TexMatIdx[j]) diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.h b/Source/Core/VideoCommon/VertexLoader_TextCoord.h index 9041185490..c71688e1e2 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.h +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.h @@ -22,7 +22,7 @@ public: static TPipelineFunction GetFunction(VertexComponentFormat type, ComponentFormat format, TexComponentCount elements); - // It is important to synchronize tcIndex. + // It is important to synchronize tcIndex, or else the wrong texture coordinate array will be used static TPipelineFunction GetDummyFunction(); private: