mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 23:52:20 +01:00
[d3d11] Simplify InitHostVisibleBuffer
This commit is contained in:
parent
223691b7aa
commit
8ee7031742
@ -118,18 +118,10 @@ namespace dxvk {
|
|||||||
// If the buffer is mapped, we can write data directly
|
// If the buffer is mapped, we can write data directly
|
||||||
// to the mapped memory region instead of doing it on
|
// to the mapped memory region instead of doing it on
|
||||||
// the GPU. Same goes for zero-initialization.
|
// the GPU. Same goes for zero-initialization.
|
||||||
DxvkBufferSlice bufferSlice = pBuffer->GetBufferSlice();
|
if (pInitialData && pInitialData->pSysMem)
|
||||||
|
std::memcpy(pBuffer->GetMapPtr(), pInitialData->pSysMem, pBuffer->Desc()->ByteWidth);
|
||||||
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
else
|
||||||
std::memcpy(
|
std::memset(pBuffer->GetMapPtr(), 0, pBuffer->Desc()->ByteWidth);
|
||||||
bufferSlice.mapPtr(0),
|
|
||||||
pInitialData->pSysMem,
|
|
||||||
bufferSlice.length());
|
|
||||||
} else {
|
|
||||||
std::memset(
|
|
||||||
bufferSlice.mapPtr(0), 0,
|
|
||||||
bufferSlice.length());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user