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. --- plugins/gpu_unai/gpulib_if.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'plugins/gpu_unai') diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp index e84eff5..588134d 100644 --- a/plugins/gpu_unai/gpulib_if.cpp +++ b/plugins/gpu_unai/gpulib_if.cpp @@ -25,6 +25,23 @@ #include #include #include "../gpulib/gpu.h" + +#ifdef THREAD_RENDERING +#include "../gpulib/gpulib_thread_if.h" +#define do_cmd_list real_do_cmd_list +#define renderer_init real_renderer_init +#define renderer_finish real_renderer_finish +#define renderer_sync_ecmds real_renderer_sync_ecmds +#define renderer_update_caches real_renderer_update_caches +#define renderer_flush_queues real_renderer_flush_queues +#define renderer_set_interlace real_renderer_set_interlace +#define renderer_set_config real_renderer_set_config +#define renderer_notify_res_change real_renderer_notify_res_change +#define renderer_notify_update_lace real_renderer_notify_update_lace +#define renderer_sync real_renderer_sync +#define ex_regs scratch_ex_regs +#endif + //#include "port.h" #include "gpu_unai.h" @@ -802,4 +819,12 @@ void renderer_set_config(const struct rearmed_cbs *cbs) } } +void renderer_sync(void) +{ +} + +void renderer_notify_update_lace(int updated) +{ +} + // vim:shiftwidth=2:expandtab -- cgit v1.2.3