mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VertexLoaderX64: Avoid unchecked pointer cast.
This commit is contained in:
@ -32,12 +32,12 @@ static const u8* memory_base_ptr = (u8*)&g_main_cp_state.array_strides;
|
|||||||
|
|
||||||
static OpArg MPIC(const void* ptr, X64Reg scale_reg, int scale = SCALE_1)
|
static OpArg MPIC(const void* ptr, X64Reg scale_reg, int scale = SCALE_1)
|
||||||
{
|
{
|
||||||
return MComplex(base_reg, scale_reg, scale, (s32)((u8*)ptr - memory_base_ptr));
|
return MComplex(base_reg, scale_reg, scale, PtrOffset(ptr, memory_base_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
static OpArg MPIC(const void* ptr)
|
static OpArg MPIC(const void* ptr)
|
||||||
{
|
{
|
||||||
return MDisp(base_reg, (s32)((u8*)ptr - memory_base_ptr));
|
return MDisp(base_reg, PtrOffset(ptr, memory_base_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
|
VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
|
||||||
|
Reference in New Issue
Block a user