Fix windows and macos build

This commit is contained in:
IndecisiveTurtle 2025-06-23 20:35:59 +03:00
parent 886899aa66
commit ea207c85aa
3 changed files with 17 additions and 13 deletions

View File

@ -831,7 +831,8 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
if (queue.tmp_dwords > 0) [[unlikely]] { if (queue.tmp_dwords > 0) [[unlikely]] {
header = reinterpret_cast<const PM4Header*>(queue.tmp_packet.data()); header = reinterpret_cast<const PM4Header*>(queue.tmp_packet.data());
next_dw_off = header->type3.NumWords() + 1 - queue.tmp_dwords; next_dw_off = header->type3.NumWords() + 1 - queue.tmp_dwords;
std::memcpy(queue.tmp_packet.data() + queue.tmp_dwords, acb.data(), next_dw_off * sizeof(u32)); std::memcpy(queue.tmp_packet.data() + queue.tmp_dwords, acb.data(),
next_dw_off * sizeof(u32));
queue.tmp_dwords = 0; queue.tmp_dwords = 0;
} }
@ -872,8 +873,8 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
} }
case PM4ItOpcode::IndirectBuffer: { case PM4ItOpcode::IndirectBuffer: {
const auto* indirect_buffer = reinterpret_cast<const PM4CmdIndirectBuffer*>(header); const auto* indirect_buffer = reinterpret_cast<const PM4CmdIndirectBuffer*>(header);
auto task = ProcessCompute<true>({indirect_buffer->Address<const u32>(), auto task = ProcessCompute<true>(
indirect_buffer->ib_size}, vqid); {indirect_buffer->Address<const u32>(), indirect_buffer->ib_size}, vqid);
RESUME_ASC(task, vqid); RESUME_ASC(task, vqid);
while (!task.handle.done()) { while (!task.handle.done()) {

View File

@ -3,6 +3,7 @@
#include <algorithm> #include <algorithm>
#include <new> #include <new>
#include <semaphore>
#include "common/alignment.h" #include "common/alignment.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/div_ceil.h" #include "common/div_ceil.h"
@ -145,11 +146,12 @@ void BufferCache::ReadMemory(VAddr device_addr, u64 size) {
} }
std::binary_semaphore sem{0}; std::binary_semaphore sem{0};
liverpool->SendCommand([this, &sem, device_addr, size] { liverpool->SendCommand([this, &sem, device_addr, size] {
ForEachBufferInRange(device_addr, size, [this, device_addr, size](BufferId buffer_id, Buffer& buffer) { ForEachBufferInRange(
device_addr, size, [this, device_addr, size](BufferId buffer_id, Buffer& buffer) {
const VAddr buffer_start = buffer.CpuAddr(); const VAddr buffer_start = buffer.CpuAddr();
const VAddr buffer_end = buffer_start + buffer.SizeBytes(); const VAddr buffer_end = buffer_start + buffer.SizeBytes();
const VAddr download_start = std::max(buffer_start, device_addr); const VAddr download_start = std::max(buffer_start, device_addr);
const VAddr download_end = std::min(buffer_end, device_addr + size); const VAddr download_end = std::min<VAddr>(buffer_end, device_addr + size);
const u64 download_size = download_end - download_start; const u64 download_size = download_end - download_start;
DownloadBufferMemory(buffer, download_start, download_size); DownloadBufferMemory(buffer, download_start, download_size);
}); });
@ -266,7 +268,8 @@ bool BufferCache::CommitPendingDownloads(bool wait_done) {
const u64 dst_offset = copy.dstOffset - offset; const u64 dst_offset = copy.dstOffset - offset;
if (!memory->TryWriteBacking(std::bit_cast<u8*>(copy_device_addr), if (!memory->TryWriteBacking(std::bit_cast<u8*>(copy_device_addr),
download + dst_offset, copy.size)) { download + dst_offset, copy.size)) {
std::memcpy(std::bit_cast<u8*>(copy_device_addr), download + dst_offset, copy.size); std::memcpy(std::bit_cast<u8*>(copy_device_addr), download + dst_offset,
copy.size);
} }
} }
} }

View File

@ -3,8 +3,8 @@
#include "common/config.h" #include "common/config.h"
#include "common/debug.h" #include "common/debug.h"
#include "core/memory.h"
#include "common/scope_exit.h" #include "common/scope_exit.h"
#include "core/memory.h"
#include "shader_recompiler/runtime_info.h" #include "shader_recompiler/runtime_info.h"
#include "video_core/amdgpu/liverpool.h" #include "video_core/amdgpu/liverpool.h"
#include "video_core/renderer_vulkan/vk_instance.h" #include "video_core/renderer_vulkan/vk_instance.h"