mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-28 13:28:59 +02:00
[vk, rasterizer] Reduce FlushWork constant drawcalls
This commit is contained in:
parent
2aa0bc9f0f
commit
d161d5e7a2
1 changed files with 5 additions and 7 deletions
|
|
@ -839,23 +839,21 @@ void RasterizerVulkan::LoadDiskResources(u64 title_id, std::stop_token stop_load
|
||||||
|
|
||||||
void RasterizerVulkan::FlushWork() {
|
void RasterizerVulkan::FlushWork() {
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
static constexpr u32 DRAWS_TO_DISPATCH = 1024;
|
static constexpr u32 DRAWS_TO_DISPATCH = 512;
|
||||||
|
static constexpr u32 CHECK_MASK = 3;
|
||||||
#else
|
#else
|
||||||
static constexpr u32 DRAWS_TO_DISPATCH = 4096;
|
static constexpr u32 DRAWS_TO_DISPATCH = 4096;
|
||||||
|
static constexpr u32 CHECK_MASK = 7;
|
||||||
#endif // ANDROID
|
#endif // ANDROID
|
||||||
|
|
||||||
// Only check multiples of 8 draws
|
static_assert(DRAWS_TO_DISPATCH % (CHECK_MASK + 1) == 0);
|
||||||
static_assert(DRAWS_TO_DISPATCH % 8 == 0);
|
if ((++draw_counter & CHECK_MASK) != CHECK_MASK) {
|
||||||
if ((++draw_counter & 7) != 7) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (draw_counter < DRAWS_TO_DISPATCH) {
|
if (draw_counter < DRAWS_TO_DISPATCH) {
|
||||||
// Send recorded tasks to the worker thread
|
|
||||||
scheduler.DispatchWork();
|
scheduler.DispatchWork();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Otherwise (every certain number of draws) flush execution.
|
|
||||||
// This submits commands to the Vulkan driver.
|
|
||||||
scheduler.Flush();
|
scheduler.Flush();
|
||||||
draw_counter = 0;
|
draw_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue