gpulib: add some missed sync and flush
[pcsx_rearmed.git] / plugins / gpulib / gpu.c
index 9cf5841..1bf25af 100644 (file)
@@ -58,6 +58,7 @@ static noinline void do_reset(void)
   gpu.screen.hres = gpu.screen.w = 256;
   gpu.screen.vres = gpu.screen.h = 240;
   gpu.screen.x = gpu.screen.y = 0;
+  renderer_sync_ecmds(gpu.ex_regs);
   renderer_notify_res_change();
 }
 
@@ -179,8 +180,12 @@ static noinline int decide_frameskip_allow(uint32_t cmd_e3)
   return gpu.frameskip.allow;
 }
 
+static void flush_cmd_buffer(void);
+
 static noinline void get_gpu_info(uint32_t data)
 {
+  if (unlikely(gpu.cmd_len > 0))
+    flush_cmd_buffer();
   switch (data & 0x0f) {
     case 0x02:
     case 0x03:
@@ -756,6 +761,7 @@ void GPUupdateLace(void)
     flush_cmd_buffer();
   renderer_flush_queues();
 
+#ifndef RAW_FB_DISPLAY
   if (gpu.status & PSX_GPU_STATUS_BLANKING) {
     if (!gpu.state.blanked) {
       vout_blank();
@@ -767,6 +773,7 @@ void GPUupdateLace(void)
 
   if (!gpu.state.fb_dirty)
     return;
+#endif
 
   if (gpu.frameskip.set) {
     if (!gpu.frameskip.frame_ready) {