From c765eb86debdc06fe304511bc2edbb6f3e3d7813 Mon Sep 17 00:00:00 2001 From: Justin Weiss Date: Sun, 13 Sep 2020 20:06:57 -0700 Subject: Add a threaded renderer This change adds a gpulib implementation that accepts GPU commands and runs them through a real gpulib implementation on a thread. Depending on a setting, it can either force a sync every frame, or continue to work until the next frame arrives. --- frontend/libretro.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'frontend/libretro.c') diff --git a/frontend/libretro.c b/frontend/libretro.c index 93bfc28..323932a 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1818,6 +1818,21 @@ static void update_variables(bool in_flight) Config.SpuIrq = 1; } +#ifdef THREAD_RENDERING + var.key = "pcsx_rearmed_gpu_thread_rendering"; + var.value = NULL; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "disabled") == 0) + pl_rearmed_cbs.thread_rendering = THREAD_RENDERING_OFF; + else if (strcmp(var.value, "sync") == 0) + pl_rearmed_cbs.thread_rendering = THREAD_RENDERING_SYNC; + else if (strcmp(var.value, "async") == 0) + pl_rearmed_cbs.thread_rendering = THREAD_RENDERING_ASYNC; + } +#endif + #ifdef GPU_PEOPS var.value = NULL; var.key = "pcsx_rearmed_gpu_peops_odd_even_bit"; @@ -2031,7 +2046,7 @@ static void update_variables(bool in_flight) "pcsx_rearmed_gpu_unai_fast_lighting", "pcsx_rearmed_gpu_unai_ilace_force", "pcsx_rearmed_gpu_unai_pixel_skip", - "pcsx_rearmed_gpu_unai_scale_hires" + "pcsx_rearmed_gpu_unai_scale_hires", }; option_display.visible = show_advanced_gpu_unai_settings; -- cgit v1.2.3