1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 13:54:16 +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( const uint32_t id = D3D11CalcSubresource(
level, layer, image->info().mipLevels); level, layer, image->info().mipLevels);
VkOffset3D mipLevelOffset = { 0, 0, 0 }; VkOffset3D mipLevelOffset = { 0, 0, 0 };
VkExtent3D mipLevelExtent = image->mipLevelExtent(level); VkExtent3D mipLevelExtent = image->mipLevelExtent(level);
m_transferCommands += 1; m_transferCommands += 1;
m_transferMemory += util::computeImageDataSize( m_transferMemory += pTexture->GetSubresourceLayout(formatInfo->aspectMask, id).Size;
image->info().format, mipLevelExtent);
if (formatInfo->aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { if (formatInfo->aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
m_context->uploadImage( m_context->uploadImage(
@ -167,9 +166,9 @@ namespace dxvk {
} }
if (pTexture->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER) { if (pTexture->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER) {
util::packImageData(pTexture->GetMappedBuffer(id)->mapPtr(0), pInitialData[id].pSysMem, util::packImageData(pTexture->GetMappedBuffer(id)->mapPtr(0),
util::computeBlockCount(image->mipLevelExtent(level), formatInfo->blockSize), pInitialData[id].pSysMem, pInitialData[id].SysMemPitch, pInitialData[id].SysMemSlicePitch,
formatInfo->elementSize, pInitialData[id].SysMemPitch, pInitialData[id].SysMemSlicePitch); image->info().type, mipLevelExtent, 1, formatInfo, formatInfo->aspectMask);
} }
} }
} }