1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 10:24:10 +01:00

[d3d11] Use new packImageData for initializing mapped image buffers

This commit is contained in:
Philip Rebohle 2021-05-19 18:04:16 +02:00
parent 7184b75f8f
commit ee30acf120
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -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);
}
}
}