From bcf89eb860fb468462a135c15be4ddaef8028944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 1 Nov 2025 21:53:14 -0700 Subject: [PATCH] Cleanup. --- src/renderer_d3d11.cpp | 8 +------- src/renderer_d3d12.cpp | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index e49ab61c4..1e58a310f 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1867,13 +1867,7 @@ namespace bgfx { namespace d3d11 uint32_t pitch = bx::uint32_min(srcPitch, dstPitch); - for (uint32_t yy = 0, height = srcHeight; yy < height; ++yy) - { - bx::memCopy(dst, src, pitch); - - src += srcPitch; - dst += dstPitch; - } + bx::memCopy(dst, dstPitch, src, srcPitch, pitch, srcHeight); m_deviceCtx->Unmap(texture.m_ptr, _mip); } diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 25457d05f..ef1ba648b 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -2002,13 +2002,7 @@ namespace bgfx { namespace d3d12 uint8_t* src; readback->Map(0, NULL, (void**)&src); - for (uint32_t yy = 0, height = srcHeight; yy < height; ++yy) - { - bx::memCopy(dst, src, pitch); - - src += srcPitch; - dst += dstPitch; - } + bx::memCopy(dst, dstPitch, src, srcPitch, pitch, srcHeight); D3D12_RANGE writeRange = { 0, 0 }; readback->Unmap(0, &writeRange);