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:
parent
4d4db6c683
commit
5728d10587
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user