mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Software Backend: Remove reinterpret_cast which violates the strict aliasing rule
This commit is contained in:
@ -497,8 +497,7 @@ u8* GetPixelPointer(u16 x, u16 y, bool depth)
|
||||
return &efb[GetColorOffset(x, y)];
|
||||
}
|
||||
|
||||
void EncodeXFB(yuv422_packed* xfb_in_ram, u32 memory_stride, const EFBRectangle& source_rect,
|
||||
float y_scale)
|
||||
void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const EFBRectangle& source_rect, float y_scale)
|
||||
{
|
||||
if (!xfb_in_ram)
|
||||
{
|
||||
@ -555,10 +554,16 @@ void EncodeXFB(yuv422_packed* xfb_in_ram, u32 memory_stride, const EFBRectangle&
|
||||
src_ptr += memory_stride;
|
||||
}
|
||||
|
||||
// Apply y scaling and copy to the xfb memory location
|
||||
SW::CopyRegion(source.data(), source_rect, xfb_in_ram,
|
||||
EFBRectangle{source_rect.left, source_rect.top, source_rect.right,
|
||||
static_cast<int>(static_cast<float>(source_rect.bottom) * y_scale)});
|
||||
auto dest_rect = EFBRectangle{source_rect.left, source_rect.top, source_rect.right,
|
||||
static_cast<int>(static_cast<float>(source_rect.bottom) * y_scale)};
|
||||
|
||||
const std::size_t destination_size = dest_rect.GetWidth() * dest_rect.GetHeight() * 2;
|
||||
static std::vector<yuv422_packed> destination;
|
||||
destination.resize(dest_rect.GetWidth() * dest_rect.GetHeight());
|
||||
|
||||
SW::CopyRegion(source.data(), source_rect, destination.data(), dest_rect);
|
||||
|
||||
memcpy(xfb_in_ram, destination.data(), destination_size);
|
||||
}
|
||||
|
||||
bool ZCompare(u16 x, u16 y, u32 z)
|
||||
|
Reference in New Issue
Block a user