mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[d3d11] Check return value of Map in UpdateSubresource1
And fall back to a GPU-side copy if necessary.
This commit is contained in:
parent
487ecd861c
commit
8c68236f70
@ -1173,10 +1173,13 @@ namespace dxvk {
|
||||
: D3D11_MAP_WRITE_DISCARD;
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedSr;
|
||||
Map(pDstResource, 0, mapType, 0, &mappedSr);
|
||||
std::memcpy(reinterpret_cast<char*>(mappedSr.pData) + offset, pSrcData, size);
|
||||
Unmap(pDstResource, 0);
|
||||
} else {
|
||||
if (likely(useMap = SUCCEEDED(Map(pDstResource, 0, mapType, 0, &mappedSr)))) {
|
||||
std::memcpy(reinterpret_cast<char*>(mappedSr.pData) + offset, pSrcData, size);
|
||||
Unmap(pDstResource, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!useMap) {
|
||||
DxvkDataSlice dataSlice = AllocUpdateBufferSlice(size);
|
||||
std::memcpy(dataSlice.ptr(), pSrcData, size);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user