Fix HLE buffer copy not executed when there's only 1 copy. (#1754)

This commit is contained in:
Diego Cea López 2024-12-12 21:45:56 +01:00 committed by GitHub
parent ec8e5d5ef1
commit 1e3d034f96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@ bool ExecuteCopyShaderHLE(const Shader::Info& info, const AmdGpu::Liverpool::Reg
static constexpr vk::DeviceSize MaxDistanceForMerge = 64_MB;
u32 batch_start = 0;
u32 batch_end = 1;
u32 batch_end = copies.size() > 1 ? 1 : 0;
while (batch_end < copies.size()) {
// Place first copy into the current batch
@ -72,7 +72,7 @@ bool ExecuteCopyShaderHLE(const Shader::Info& info, const AmdGpu::Liverpool::Reg
for (int i = batch_start + 1; i < copies.size(); i++) {
// Compute new src and dst bounds if we were to batch this copy
const auto [src_offset, dst_offset, size] = copies[i];
const auto& [src_offset, dst_offset, size] = copies[i];
auto new_src_offset_min = std::min(src_offset_min, src_offset);
auto new_src_offset_max = std::max(src_offset_max, src_offset + size);
if (new_src_offset_max - new_src_offset_min > MaxDistanceForMerge) {