Skip to content

Commit

Permalink
[d3d9] Zero-initialize buffer mapped things
Browse files Browse the repository at this point in the history
May not be needed? Look into later.
  • Loading branch information
Joshua-Ashton committed May 4, 2019
1 parent 1626606 commit a026a42
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/d3d9/d3d9_device.cpp
Expand Up @@ -3107,16 +3107,10 @@ namespace dxvk {
// We always keep a copy of them in system memory for this reason.
// No need to wait as its not in use.

if (alloced) {
physSlice = mappedBuffer->allocSlice();
EmitCs([
cImageBuffer = mappedBuffer,
cBufferSlice = physSlice
] (DxvkContext* ctx) {
ctx->invalidateBuffer(cImageBuffer, cBufferSlice);
});
} else
physSlice = mappedBuffer->getSliceHandle();
physSlice = mappedBuffer->getSliceHandle();

if (alloced)
std::memset(physSlice.mapPtr, 0, mappedBuffer->info().size);
}
else {
// When using any map mode which requires the image contents
Expand Down

0 comments on commit a026a42

Please sign in to comment.