mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
vk: Offload garbage collection to offloader thread
This commit is contained in:
parent
bec91aab7b
commit
0a34fc4bcd
@ -8,7 +8,8 @@ namespace vk
|
|||||||
|
|
||||||
enum // callback commands
|
enum // callback commands
|
||||||
{
|
{
|
||||||
rctrl_queue_submit = 0x80000000
|
rctrl_queue_submit = 0x80000000,
|
||||||
|
rctrl_run_gc = 0x80000001
|
||||||
};
|
};
|
||||||
|
|
||||||
struct submit_packet
|
struct submit_packet
|
||||||
|
@ -2233,6 +2233,12 @@ void VKGSRender::renderctl(u32 request_code, void* args)
|
|||||||
free(packet);
|
free(packet);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case vk::rctrl_run_gc:
|
||||||
|
{
|
||||||
|
auto eid = reinterpret_cast<u64>(args);
|
||||||
|
vk::on_event_completed(eid, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
fmt::throw_exception("Unhandled request code 0x%x", request_code);
|
fmt::throw_exception("Unhandled request code 0x%x", request_code);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "VKResourceManager.h"
|
#include "VKResourceManager.h"
|
||||||
#include "VKGSRender.h"
|
#include "VKGSRender.h"
|
||||||
|
#include "VKCommandStream.h"
|
||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
@ -27,9 +28,17 @@ namespace vk
|
|||||||
return g_event_ctr.load();
|
return g_event_ctr.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_event_completed(u64 event_id)
|
void on_event_completed(u64 event_id, bool flush)
|
||||||
{
|
{
|
||||||
// TODO: Offload this to a secondary thread
|
if (!flush && g_cfg.video.multithreaded_rsx)
|
||||||
|
{
|
||||||
|
auto offloader_thread = g_fxo->get<rsx::dma_manager>();
|
||||||
|
ensure(!offloader_thread->is_current_thread());
|
||||||
|
|
||||||
|
offloader_thread->backend_ctrl(rctrl_run_gc, reinterpret_cast<void*>(event_id));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_resource_manager.eid_completed(event_id);
|
g_resource_manager.eid_completed(event_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ namespace vk
|
|||||||
{
|
{
|
||||||
u64 get_event_id();
|
u64 get_event_id();
|
||||||
u64 current_event_id();
|
u64 current_event_id();
|
||||||
void on_event_completed(u64 event_id);
|
void on_event_completed(u64 event_id, bool flush = false);
|
||||||
|
|
||||||
struct eid_scope_t
|
struct eid_scope_t
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user