diff options
| author | 2021-09-19 20:35:07 -0400 | |
|---|---|---|
| committer | 2021-09-19 20:35:07 -0400 | |
| commit | 1ea8073783b3e12c10812192e34a5d557727fd34 (patch) | |
| tree | 4201c0868d7feed955e0d68f372a43af15f17b7f /src/video_core/buffer_cache | |
| parent | Merge pull request #7019 from ameerj/videocore-jthread (diff) | |
| download | yuzu-1ea8073783b3e12c10812192e34a5d557727fd34.tar.gz yuzu-1ea8073783b3e12c10812192e34a5d557727fd34.tar.xz yuzu-1ea8073783b3e12c10812192e34a5d557727fd34.zip | |
buffer_cache: Minor fixes
Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
Diffstat (limited to 'src/video_core/buffer_cache')
| -rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 7bfd57369..d350c9b36 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -570,13 +570,12 @@ bool BufferCache<P>::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am | |||
| 570 | ForEachWrittenRange(*cpu_src_address, amount, mirror); | 570 | ForEachWrittenRange(*cpu_src_address, amount, mirror); |
| 571 | // This subtraction in this order is important for overlapping copies. | 571 | // This subtraction in this order is important for overlapping copies. |
| 572 | common_ranges.subtract(subtract_interval); | 572 | common_ranges.subtract(subtract_interval); |
| 573 | bool atleast_1_download = tmp_intervals.size() != 0; | 573 | const bool has_new_downloads = tmp_intervals.size() != 0; |
| 574 | for (const IntervalType add_interval : tmp_intervals) { | 574 | for (const IntervalType& add_interval : tmp_intervals) { |
| 575 | common_ranges.add(add_interval); | 575 | common_ranges.add(add_interval); |
| 576 | } | 576 | } |
| 577 | |||
| 578 | runtime.CopyBuffer(dest_buffer, src_buffer, copies); | 577 | runtime.CopyBuffer(dest_buffer, src_buffer, copies); |
| 579 | if (atleast_1_download) { | 578 | if (has_new_downloads) { |
| 580 | dest_buffer.MarkRegionAsGpuModified(*cpu_dest_address, amount); | 579 | dest_buffer.MarkRegionAsGpuModified(*cpu_dest_address, amount); |
| 581 | } | 580 | } |
| 582 | std::vector<u8> tmp_buffer(amount); | 581 | std::vector<u8> tmp_buffer(amount); |