From f4b6bc79e2b280ec69d71709a330f43e1a6feed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 21 Jan 2026 12:31:19 -0800 Subject: [PATCH] D3D12: Fixed texture update crash. (#3560) --- src/renderer_d3d12.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index b35290def..d281eda21 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -5876,10 +5876,7 @@ namespace bgfx { namespace d3d12 D3D12_RANGE readRange = { 0, 0 }; DX_CHECK(staging->Map(0, &readRange, (void**)&dstData) ); - for (uint32_t ii = 0, height = numRows; ii < height; ++ii) - { - bx::memCopy(&dstData[ii*rowPitch], &srcData[ii*srcpitch], srcpitch); - } + bx::memCopy(dstData, rowPitch, srcData, srcpitch, rectpitch, numRows); if (NULL != temp) {