diff options
| author | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-19 22:40:50 -0500 |
|---|---|---|
| committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-19 22:40:50 -0500 |
| commit | c6590ad07b384762fd90ee8852796ec681a69286 (patch) | |
| tree | c0d8d2d157f3bb4be01331f2da459c0f68ca4d7b /src/video_core/engines/maxwell_dma.cpp | |
| parent | 64869807e2e4604f3d6334feeaf890515e9edb81 (diff) | |
scratch_buffer: Explicitly defing resize and resize_destructive functions
resize keeps previous data intact when the buffer grows
resize_destructive destroys the previous data when the buffer grows
Diffstat (limited to 'src/video_core/engines/maxwell_dma.cpp')
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index dc873732e..f73d7bf0f 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -184,8 +184,8 @@ void MaxwellDMA::CopyBlockLinearToPitch() { const size_t src_size = CalculateSize(true, bytes_per_pixel, width, height, depth, block_height, block_depth); - read_buffer.resize(src_size); - write_buffer.resize(dst_size); + read_buffer.resize_destructive(src_size); + write_buffer.resize_destructive(dst_size); memory_manager.ReadBlock(regs.offset_in, read_buffer.data(), src_size); memory_manager.ReadBlock(regs.offset_out, write_buffer.data(), dst_size); @@ -231,8 +231,8 @@ void MaxwellDMA::CopyPitchToBlockLinear() { CalculateSize(true, bytes_per_pixel, width, height, depth, block_height, block_depth); const size_t src_size = static_cast<size_t>(regs.pitch_in) * regs.line_count; - read_buffer.resize(src_size); - write_buffer.resize(dst_size); + read_buffer.resize_destructive(src_size); + write_buffer.resize_destructive(dst_size); memory_manager.ReadBlock(regs.offset_in, read_buffer.data(), src_size); if (Settings::IsGPULevelExtreme()) { @@ -261,8 +261,8 @@ void MaxwellDMA::FastCopyBlockLinearToPitch() { pos_x = pos_x % x_in_gob; pos_y = pos_y % 8; - read_buffer.resize(src_size); - write_buffer.resize(dst_size); + read_buffer.resize_destructive(src_size); + write_buffer.resize_destructive(dst_size); if (Settings::IsGPULevelExtreme()) { memory_manager.ReadBlock(regs.offset_in + offset, read_buffer.data(), src_size); @@ -321,10 +321,10 @@ void MaxwellDMA::CopyBlockLinearToBlockLinear() { const u32 pitch = x_elements * bytes_per_pixel; const size_t mid_buffer_size = pitch * regs.line_count; - read_buffer.resize(src_size); - write_buffer.resize(dst_size); + read_buffer.resize_destructive(src_size); + write_buffer.resize_destructive(dst_size); - intermediate_buffer.resize(mid_buffer_size); + intermediate_buffer.resize_destructive(mid_buffer_size); memory_manager.ReadBlock(regs.offset_in, read_buffer.data(), src_size); memory_manager.ReadBlock(regs.offset_out, write_buffer.data(), dst_size); |
