mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
add pipe information to queue notifications
this is probably one part of what's needed the other half is the memory writes
This commit is contained in:
parent
b8b09bc86f
commit
f9d6f5c1c1
3 changed files with 10 additions and 9 deletions
|
@ -304,6 +304,7 @@ struct AscQueueInfo {
|
|||
VAddr map_addr;
|
||||
u32* read_addr;
|
||||
u32 ring_size_dw;
|
||||
u32 pipe_id;
|
||||
};
|
||||
static Common::SlotVector<AscQueueInfo> asc_queues{};
|
||||
static constexpr VAddr tessellation_factors_ring_addr = Core::SYSTEM_RESERVED_MAX - 0xFFFFFFF;
|
||||
|
@ -563,7 +564,7 @@ void PS4_SYSV_ABI sceGnmDingDong(u32 gnm_vqid, u32 next_offs_dw) {
|
|||
DumpCommandList(acb, fmt::format("acb_{}_{}", gnm_vqid, seq_num));
|
||||
}
|
||||
|
||||
liverpool->SubmitAsc(vqid, acb_span);
|
||||
liverpool->SubmitAsc(vqid, acb_span, asc_queue.pipe_id);
|
||||
|
||||
*asc_queue.read_addr += acb_size;
|
||||
*asc_queue.read_addr %= asc_queue.ring_size_dw * 4;
|
||||
|
@ -1214,7 +1215,7 @@ int PS4_SYSV_ABI sceGnmMapComputeQueue(u32 pipe_id, u32 queue_id, VAddr ring_bas
|
|||
return ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_READ_PTR_ADDR;
|
||||
}
|
||||
|
||||
auto vqid = asc_queues.insert(VAddr(ring_base_addr), read_ptr_addr, ring_size_dw);
|
||||
auto vqid = asc_queues.insert(VAddr(ring_base_addr), read_ptr_addr, ring_size_dw, pipe_id);
|
||||
// We need to offset index as `dingDong` assumes it to be from the range [1..64]
|
||||
const auto gnm_vqid = vqid.index + 1;
|
||||
LOG_INFO(Lib_GnmDriver, "ASC pipe {} queue {} mapped to vqueue {}", pipe_id, queue_id,
|
||||
|
|
|
@ -545,7 +545,7 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
|||
TracyFiberLeave;
|
||||
}
|
||||
|
||||
Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, int vqid) {
|
||||
Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, int vqid, u32 pipeId) {
|
||||
TracyFiberEnter(acb_task_name);
|
||||
|
||||
while (!acb.empty()) {
|
||||
|
@ -567,7 +567,7 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, int vqid) {
|
|||
case PM4ItOpcode::IndirectBuffer: {
|
||||
const auto* indirect_buffer = reinterpret_cast<const PM4CmdIndirectBuffer*>(header);
|
||||
auto task = ProcessCompute(
|
||||
{indirect_buffer->Address<const u32>(), indirect_buffer->ib_size}, vqid);
|
||||
{indirect_buffer->Address<const u32>(), indirect_buffer->ib_size}, vqid, pipeId);
|
||||
while (!task.handle.done()) {
|
||||
task.handle.resume();
|
||||
|
||||
|
@ -625,7 +625,7 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, int vqid) {
|
|||
}
|
||||
case PM4ItOpcode::ReleaseMem: {
|
||||
const auto* release_mem = reinterpret_cast<const PM4CmdReleaseMem*>(header);
|
||||
release_mem->SignalFence(Platform::InterruptId::Compute0RelMem); // <---
|
||||
release_mem->SignalFence((Platform::InterruptId)pipeId); // <---
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -687,11 +687,11 @@ void Liverpool::SubmitGfx(std::span<const u32> dcb, std::span<const u32> ccb) {
|
|||
submit_cv.notify_one();
|
||||
}
|
||||
|
||||
void Liverpool::SubmitAsc(u32 vqid, std::span<const u32> acb) {
|
||||
void Liverpool::SubmitAsc(u32 vqid, std::span<const u32> acb, u32 pipeId) {
|
||||
ASSERT_MSG(vqid >= 0 && vqid < NumTotalQueues, "Invalid virtual ASC queue index");
|
||||
auto& queue = mapped_queues[vqid];
|
||||
|
||||
const auto& task = ProcessCompute(acb, vqid);
|
||||
const auto& task = ProcessCompute(acb, vqid, pipeId);
|
||||
{
|
||||
std::scoped_lock lock{queue.m_access};
|
||||
queue.submits.emplace(task.handle);
|
||||
|
|
|
@ -1054,7 +1054,7 @@ public:
|
|||
~Liverpool();
|
||||
|
||||
void SubmitGfx(std::span<const u32> dcb, std::span<const u32> ccb);
|
||||
void SubmitAsc(u32 vqid, std::span<const u32> acb);
|
||||
void SubmitAsc(u32 vqid, std::span<const u32> acb, u32 pipeId);
|
||||
|
||||
void SubmitDone() noexcept {
|
||||
std::scoped_lock lk{submit_mutex};
|
||||
|
@ -1125,7 +1125,7 @@ private:
|
|||
std::span<const u32> ccb);
|
||||
Task ProcessGraphics(std::span<const u32> dcb, std::span<const u32> ccb);
|
||||
Task ProcessCeUpdate(std::span<const u32> ccb);
|
||||
Task ProcessCompute(std::span<const u32> acb, int vqid);
|
||||
Task ProcessCompute(std::span<const u32> acb, int vqid, u32 pipeId);
|
||||
|
||||
void Process(std::stop_token stoken);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue