mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VertexLoader: Fix wrong array being used if color 1 is present but color 0 isn't
This worked correctly on the JIT vertex loaders, and for the equivalent case with texture coordinates. I'm not aware of any games this affects (but libogc does mention a semi-related scenario at 6bc0317c7d/gc/ogc/gx.h (L1855-L1857)
.)
This commit is contained in:
@ -149,9 +149,16 @@ void VertexLoader::CompileVertexTranslator()
|
||||
VertexLoader_Color::GetFunction(m_VtxDesc.low.Color[i], m_VtxAttr.GetColorFormat(i));
|
||||
|
||||
if (pFunc != nullptr)
|
||||
{
|
||||
WriteCall(pFunc);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(m_VtxDesc.low.Color[i] == VertexComponentFormat::NotPresent);
|
||||
// Keep colIndex in sync if color 0 is absent but color 1 is present
|
||||
if (i == 0 && m_VtxDesc.low.Color[1] != VertexComponentFormat::NotPresent)
|
||||
WriteCall(VertexLoader_Color::GetDummyFunction());
|
||||
}
|
||||
|
||||
if (m_VtxDesc.low.Color[i] != VertexComponentFormat::NotPresent)
|
||||
{
|
||||
|
Reference in New Issue
Block a user