texture_decode: Prefer std::memcpy where possible

This commit is contained in:
GPUCode
2022-10-02 13:18:59 +03:00
parent 891b4bff18
commit d27c1c8606

View File

@ -244,7 +244,8 @@ void ConvertBGRToRGBA(std::span<const std::byte> source, std::span<std::byte> de
void ConvertABGRToRGBA(std::span<const std::byte> source, std::span<std::byte> dest) {
for (u32 i = 0; i < dest.size(); i += 4) {
const u32 abgr = *reinterpret_cast<const u32*>(source.data() + i);
u32 abgr;
std::memcpy(&abgr, source.data() + i, sizeof(u32));
const u32 rgba = Common::swap32(abgr);
std::memcpy(dest.data() + i, &rgba, 4);
}