From: notaz Date: Mon, 4 Sep 2023 23:05:01 +0000 (+0300) Subject: gpulib: add some missed sync and flush X-Git-Tag: r24l~197 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ff31050057fe9f07c6e3336831cdfbb52fa780;p=pcsx_rearmed.git gpulib: add some missed sync and flush notaz/pcsx_rearmed#303 --- diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index af24e770..a0bff3e9 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c @@ -4975,6 +4975,8 @@ void initialize_psx_gpu(psx_gpu_struct *psx_gpu, u16 *vram) psx_gpu->texture_page_ptr = psx_gpu->vram_ptr; psx_gpu->clut_ptr = psx_gpu->vram_ptr; + psx_gpu->viewport_start_x = psx_gpu->viewport_start_y = 0; + psx_gpu->viewport_end_x = psx_gpu->viewport_end_y = 0; psx_gpu->mask_msb = 0; psx_gpu->texture_window_x = 0; diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index 73abe8f5..5f69c9d2 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -62,6 +62,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(); } @@ -187,8 +188,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: