From f5241d187cf5a1affb389f1250a83830c5105941 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 29 Oct 2024 22:15:58 +0100 Subject: [PATCH] [d3d11] Use GetMapPtr when initializing mapped image buffer --- src/d3d11/d3d11_initializer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_initializer.cpp b/src/d3d11/d3d11_initializer.cpp index 4ec1c1e03..7cff6ecb5 100644 --- a/src/d3d11/d3d11_initializer.cpp +++ b/src/d3d11/d3d11_initializer.cpp @@ -177,7 +177,7 @@ namespace dxvk { } if (mapMode != D3D11_COMMON_TEXTURE_MAP_MODE_NONE) { - util::packImageData(pTexture->GetMappedBuffer(index)->mapPtr(0), + util::packImageData(pTexture->GetMapPtr(index, 0), pInitialData[index].pSysMem, pInitialData[index].SysMemPitch, pInitialData[index].SysMemSlicePitch, 0, 0, pTexture->GetVkImageType(), mipLevelExtent, 1, formatInfo, formatInfo->aspectMask); } @@ -215,8 +215,8 @@ namespace dxvk { if (mapMode != D3D11_COMMON_TEXTURE_MAP_MODE_NONE) { for (uint32_t i = 0; i < pTexture->CountSubresources(); i++) { - auto buffer = pTexture->GetMappedBuffer(i); - std::memset(buffer->mapPtr(0), 0, buffer->info().size); + auto layout = pTexture->GetSubresourceLayout(formatInfo->aspectMask, i); + std::memset(pTexture->GetMapPtr(i, layout.Offset), 0, layout.Size); } } }