VertexLoader: Remove unnecessary calls to VertexLoader_TextCoord::GetDummyFunction

This commit is contained in:
Pokechu22 2023-11-25 16:42:30 -08:00
parent 36796abc08
commit 4116344785
2 changed files with 4 additions and 3 deletions

View File

@ -220,12 +220,13 @@ void VertexLoader::CompileVertexTranslator()
{ {
// if there's more tex coords later, have to write a dummy call // if there's more tex coords later, have to write a dummy call
bool has_more = false; 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) if (m_VtxDesc.high.TexCoord[j] != VertexComponentFormat::NotPresent)
{ {
has_more = true; 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; break;
} }
else if (m_VtxDesc.low.TexMatIdx[j]) else if (m_VtxDesc.low.TexMatIdx[j])

View File

@ -22,7 +22,7 @@ public:
static TPipelineFunction GetFunction(VertexComponentFormat type, ComponentFormat format, static TPipelineFunction GetFunction(VertexComponentFormat type, ComponentFormat format,
TexComponentCount elements); 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(); static TPipelineFunction GetDummyFunction();
private: private: