1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Copy initial texture data to mapped buffer, if available

Otherwise, if an application maps the image right after creating it,
we might end up reading garbage data or overriding the image data.
This commit is contained in:
Philip Rebohle 2019-06-25 14:22:47 +02:00
parent 4d4db6c683
commit 5728d10587
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -155,6 +155,12 @@ namespace dxvk {
pInitialData[id].SysMemSlicePitch,
packedFormat);
}
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);
}
}
}
} else {