to ensure that we're not unlocking submits too early

This commit is contained in:
psucien 2024-05-30 22:56:14 +02:00
parent 8f9436080e
commit fcea53820b
3 changed files with 11 additions and 1 deletions

View File

@ -1455,6 +1455,7 @@ int PS4_SYSV_ABI sceGnmSubmitDone() {
if (!liverpool->IsGpuIdle()) {
submission_lock = true;
}
liverpool->NotifySubmitDone();
return ORBIS_OK;
}

View File

@ -61,7 +61,11 @@ void Liverpool::Process(std::stop_token stoken) {
--num_submits;
}
}
num_submits.notify_all();
if (submit_done) {
num_submits.notify_all();
submit_done = false;
}
}
}

View File

@ -777,6 +777,10 @@ public:
return num_submits == 0;
}
void NotifySubmitDone() {
submit_done = true;
}
void BindRasterizer(Vulkan::Rasterizer* rasterizer_) {
rasterizer = rasterizer_;
}
@ -841,6 +845,7 @@ private:
Vulkan::Rasterizer* rasterizer{};
std::jthread process_thread{};
std::atomic<u32> num_submits{};
std::atomic<bool> submit_done{};
};
static_assert(GFX6_3D_REG_INDEX(ps_program) == 0x2C08);