VertexLoaderX64: Refactor so that zfreeze is only in one place
(Specifically, the copy for VertexLoaderManager::position_cache. The position matrix index happens elsewhere, and the float path still has special logic to copy to scratch3.)
This commit is contained in:
parent
6f1350ae51
commit
f722bdf7f1
|
@ -114,6 +114,17 @@ int VertexLoaderX64::ReadVertex(OpArg data, VertexComponentFormat attribute, Com
|
||||||
|
|
||||||
X64Reg coords = XMM0;
|
X64Reg coords = XMM0;
|
||||||
|
|
||||||
|
const auto write_zfreeze = [&]() { // zfreeze
|
||||||
|
if (native_format == &m_native_vtx_decl.position)
|
||||||
|
{
|
||||||
|
CMP(32, R(count_reg), Imm8(3));
|
||||||
|
FixupBranch dont_store = J_CC(CC_A);
|
||||||
|
LEA(32, scratch3, MScaled(count_reg, SCALE_4, -4));
|
||||||
|
MOVUPS(MPIC(VertexLoaderManager::position_cache, scratch3, SCALE_4), coords);
|
||||||
|
SetJumpTarget(dont_store);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int elem_size = GetElementSize(format);
|
int elem_size = GetElementSize(format);
|
||||||
int load_bytes = elem_size * count_in;
|
int load_bytes = elem_size * count_in;
|
||||||
OpArg dest = MDisp(dst_reg, m_dst_ofs);
|
OpArg dest = MDisp(dst_reg, m_dst_ofs);
|
||||||
|
@ -217,16 +228,7 @@ int VertexLoaderX64::ReadVertex(OpArg data, VertexComponentFormat attribute, Com
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// zfreeze
|
write_zfreeze();
|
||||||
if (native_format == &m_native_vtx_decl.position)
|
|
||||||
{
|
|
||||||
CMP(32, R(count_reg), Imm8(3));
|
|
||||||
FixupBranch dont_store = J_CC(CC_A);
|
|
||||||
LEA(32, scratch3, MScaled(count_reg, SCALE_4, -4));
|
|
||||||
MOVUPS(MPIC(VertexLoaderManager::position_cache, scratch3, SCALE_4), coords);
|
|
||||||
SetJumpTarget(dont_store);
|
|
||||||
}
|
|
||||||
return load_bytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,15 +253,7 @@ int VertexLoaderX64::ReadVertex(OpArg data, VertexComponentFormat attribute, Com
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// zfreeze
|
write_zfreeze();
|
||||||
if (native_format == &m_native_vtx_decl.position)
|
|
||||||
{
|
|
||||||
CMP(32, R(count_reg), Imm8(3));
|
|
||||||
FixupBranch dont_store = J_CC(CC_A);
|
|
||||||
LEA(32, scratch3, MScaled(count_reg, SCALE_4, -4));
|
|
||||||
MOVUPS(MPIC(VertexLoaderManager::position_cache, scratch3, SCALE_4), coords);
|
|
||||||
SetJumpTarget(dont_store);
|
|
||||||
}
|
|
||||||
|
|
||||||
return load_bytes;
|
return load_bytes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue