mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-04-01 09:25:24 +02:00
[dxvk] Clear entire allocated memory region when initializing buffers
This commit is contained in:
parent
f17188395b
commit
f7ae4549d4
@ -1034,6 +1034,16 @@ namespace dxvk {
|
|||||||
const Rc<DxvkBuffer>& buffer) {
|
const Rc<DxvkBuffer>& buffer) {
|
||||||
auto dstSlice = buffer->getSliceHandle();
|
auto dstSlice = buffer->getSliceHandle();
|
||||||
|
|
||||||
|
// If the buffer is suballocated, clear the entire allocated
|
||||||
|
// region, which is guaranteed to have a nicely aligned size
|
||||||
|
if (!buffer->storage()->flags().test(DxvkAllocationFlag::OwnsBuffer)) {
|
||||||
|
auto bufferInfo = buffer->storage()->getBufferInfo();
|
||||||
|
|
||||||
|
dstSlice.handle = bufferInfo.buffer;
|
||||||
|
dstSlice.offset = bufferInfo.offset;
|
||||||
|
dstSlice.length = bufferInfo.size;
|
||||||
|
}
|
||||||
|
|
||||||
// Buffer size may be misaligned, in which case we have
|
// Buffer size may be misaligned, in which case we have
|
||||||
// to use a plain buffer copy to fill the last few bytes.
|
// to use a plain buffer copy to fill the last few bytes.
|
||||||
constexpr VkDeviceSize MinCopyAndFillSize = 1u << 20;
|
constexpr VkDeviceSize MinCopyAndFillSize = 1u << 20;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user