Merge pull request #132 from shadps4-emu/gpu_flip

graphics: separate IRQ for GPU driven flips
This commit is contained in:
georgemoralis 2024-05-14 23:56:12 +03:00 committed by GitHub
commit 055ffff463
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 63 additions and 33 deletions

View file

@ -25,8 +25,24 @@ void Liverpool::ProcessCmdList(u32* cmdbuf, u32 size_in_bytes) {
const PM4ItOpcode opcode = header->type3.opcode;
const u32 count = header->type3.NumWords();
switch (opcode) {
case PM4ItOpcode::Nop:
case PM4ItOpcode::Nop: {
const auto* nop = reinterpret_cast<PM4CmdNop*>(header);
if (nop->header.count.Value() == 0) {
break;
}
switch (nop->data_block[0]) {
case PM4CmdNop::PayloadType::PatchedFlip: {
// There is no evidence that GPU CP drives flip events by parsing
// special NOP packets. For convenience lets assume that it does.
Platform::IrqC::Instance()->Signal(Platform::InterruptId::GfxFlip);
break;
}
default:
break;
}
break;
}
case PM4ItOpcode::SetContextReg: {
const auto* set_data = reinterpret_cast<PM4CmdSetData*>(header);
std::memcpy(&regs.reg_array[ContextRegWordOffset + set_data->reg_offset],