add EventWrite and DispatchIndirect to ProcessCompute (#1948)

* add EventWrite and DispatchIndirect to ProcessCompute

helps Alienation go Ingame

* apply review changes

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

---------

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
This commit is contained in:
Mahmoud Adel 2024-12-29 12:47:15 +02:00 committed by GitHub
parent f8177902a5
commit e952013fe0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -821,6 +821,24 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
} }
break; break;
} }
case PM4ItOpcode::DispatchIndirect: {
const auto* dispatch_indirect = reinterpret_cast<const PM4CmdDispatchIndirect*>(header);
auto& cs_program = GetCsRegs();
const auto offset = dispatch_indirect->data_offset;
const auto ib_address = mapped_queues[GfxQueueId].indirect_args_addr;
const auto size = sizeof(PM4CmdDispatchIndirect::GroupDimensions);
if (DebugState.DumpingCurrentReg()) {
DebugState.PushRegsDumpCompute(base_addr, reinterpret_cast<uintptr_t>(header),
cs_program);
}
if (rasterizer && (cs_program.dispatch_initiator & 1)) {
const auto cmd_address = reinterpret_cast<const void*>(header);
rasterizer->ScopeMarkerBegin(fmt::format("acb:{}:DispatchIndirect", cmd_address));
rasterizer->DispatchIndirect(ib_address, offset, size);
rasterizer->ScopeMarkerEnd();
}
break;
}
case PM4ItOpcode::WriteData: { case PM4ItOpcode::WriteData: {
const auto* write_data = reinterpret_cast<const PM4CmdWriteData*>(header); const auto* write_data = reinterpret_cast<const PM4CmdWriteData*>(header);
ASSERT(write_data->dst_sel.Value() == 2 || write_data->dst_sel.Value() == 5); ASSERT(write_data->dst_sel.Value() == 2 || write_data->dst_sel.Value() == 5);
@ -845,6 +863,10 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
release_mem->SignalFence(static_cast<Platform::InterruptId>(queue.pipe_id)); release_mem->SignalFence(static_cast<Platform::InterruptId>(queue.pipe_id));
break; break;
} }
case PM4ItOpcode::EventWrite: {
// const auto* event = reinterpret_cast<const PM4CmdEventWrite*>(header);
break;
}
default: default:
UNREACHABLE_MSG("Unknown PM4 type 3 opcode {:#x} with count {}", UNREACHABLE_MSG("Unknown PM4 type 3 opcode {:#x} with count {}",
static_cast<u32>(opcode), count); static_cast<u32>(opcode), count);