diff --git a/src/d3d11/d3d11_initializer.cpp b/src/d3d11/d3d11_initializer.cpp index 237bf56e..cf701844 100644 --- a/src/d3d11/d3d11_initializer.cpp +++ b/src/d3d11/d3d11_initializer.cpp @@ -141,13 +141,12 @@ namespace dxvk { const uint32_t id = D3D11CalcSubresource( level, layer, image->info().mipLevels); - + VkOffset3D mipLevelOffset = { 0, 0, 0 }; VkExtent3D mipLevelExtent = image->mipLevelExtent(level); m_transferCommands += 1; - m_transferMemory += util::computeImageDataSize( - image->info().format, mipLevelExtent); + m_transferMemory += pTexture->GetSubresourceLayout(formatInfo->aspectMask, id).Size; if (formatInfo->aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { m_context->uploadImage( @@ -167,9 +166,9 @@ namespace dxvk { } if (pTexture->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER) { - util::packImageData(pTexture->GetMappedBuffer(id)->mapPtr(0), pInitialData[id].pSysMem, - util::computeBlockCount(image->mipLevelExtent(level), formatInfo->blockSize), - formatInfo->elementSize, pInitialData[id].SysMemPitch, pInitialData[id].SysMemSlicePitch); + util::packImageData(pTexture->GetMappedBuffer(id)->mapPtr(0), + pInitialData[id].pSysMem, pInitialData[id].SysMemPitch, pInitialData[id].SysMemSlicePitch, + image->info().type, mipLevelExtent, 1, formatInfo, formatInfo->aspectMask); } } }