From 451edb7fbcaac50ee26f20e63daefee64ce20423 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 10 Nov 2024 18:25:15 +0200 Subject: [PATCH] gpu_unai: drop pixel_skip it's not possible to enable it so no need to check it on each primitive --- frontend/libretro.c | 4 ---- frontend/main.c | 1 - frontend/menu.c | 2 -- frontend/plugin_lib.h | 1 - plugins/gpu_unai/gpulib_if.cpp | 32 ++++++++------------------------ 5 files changed, 8 insertions(+), 32 deletions(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index aa69ce65..d326ba89 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -2639,10 +2639,6 @@ static void update_variables(bool in_flight) * (480i, 512i) and has been obsoleted by * pcsx_rearmed_gpu_unai_scale_hires */ pl_rearmed_cbs.gpu_unai.ilace_force = 0; - /* Note: This used to be an option, but it has no - * discernable effect and has been obsoleted by - * pcsx_rearmed_gpu_unai_scale_hires */ - pl_rearmed_cbs.gpu_unai.pixel_skip = 0; var.key = "pcsx_rearmed_gpu_unai_old_renderer"; var.value = NULL; diff --git a/frontend/main.c b/frontend/main.c index c1067203..eb4f1490 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -138,7 +138,6 @@ void emu_set_default_config(void) pl_rearmed_cbs.gpu_peops.dwActFixes = 1<<7; pl_rearmed_cbs.gpu_unai.old_renderer = 0; pl_rearmed_cbs.gpu_unai.ilace_force = 0; - pl_rearmed_cbs.gpu_unai.pixel_skip = 0; pl_rearmed_cbs.gpu_unai.lighting = 1; pl_rearmed_cbs.gpu_unai.fast_lighting = 0; pl_rearmed_cbs.gpu_unai.blending = 1; diff --git a/frontend/menu.c b/frontend/menu.c index 532ab714..438d2cff 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -445,7 +445,6 @@ static const struct { CE_INTVAL_P(gpu_peops.dwActFixes), CE_INTVAL_P(gpu_unai.old_renderer), CE_INTVAL_P(gpu_unai.ilace_force), - CE_INTVAL_P(gpu_unai.pixel_skip), CE_INTVAL_P(gpu_unai.lighting), CE_INTVAL_P(gpu_unai.fast_lighting), CE_INTVAL_P(gpu_unai.blending), @@ -1449,7 +1448,6 @@ static menu_entry e_menu_plugin_gpu_unai[] = mee_onoff ("Lighting", 0, pl_rearmed_cbs.gpu_unai.lighting, 1), mee_onoff ("Fast lighting", 0, pl_rearmed_cbs.gpu_unai.fast_lighting, 1), mee_onoff ("Blending", 0, pl_rearmed_cbs.gpu_unai.blending, 1), - mee_onoff ("Pixel skip", 0, pl_rearmed_cbs.gpu_unai.pixel_skip, 1), mee_end, }; diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h index b2ba69af..6fee70b1 100644 --- a/frontend/plugin_lib.h +++ b/frontend/plugin_lib.h @@ -96,7 +96,6 @@ struct rearmed_cbs { struct { int old_renderer; int ilace_force; - int pixel_skip; int lighting; int fast_lighting; int blending; diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp index eb47c2a6..ca794ddd 100644 --- a/plugins/gpu_unai/gpulib_if.cpp +++ b/plugins/gpu_unai/gpulib_if.cpp @@ -285,21 +285,6 @@ void renderer_finish(void) void renderer_notify_res_change(void) { - if (PixelSkipEnabled()) { - // Set blit_mask for high horizontal resolutions. This allows skipping - // rendering pixels that would never get displayed on low-resolution - // platforms that use simple pixel-dropping scaler. - - switch (gpu.screen.hres) - { - case 512: gpu_unai.blit_mask = 0xa4; break; // GPU_BlitWWSWWSWS - case 640: gpu_unai.blit_mask = 0xaa; break; // GPU_BlitWS - default: gpu_unai.blit_mask = 0; break; - } - } else { - gpu_unai.blit_mask = 0; - } - if (LineSkipEnabled()) { // Set rendering line-skip (only render every other line in high-res // 480 vertical mode, or, optionally, force it for all video modes) @@ -453,7 +438,7 @@ int do_cmd_list(u32 *list_, int list_len, case 0x22: case 0x23: { // Monochrome 3-pt poly PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Blending_Mode | gpu_unai.Masking | Blending | gpu_unai.PixelMSB ]; @@ -469,7 +454,7 @@ int do_cmd_list(u32 *list_, int list_len, gpuSetTexture(le32_to_u32(gpu_unai.PacketBuffer.U4[4]) >> 16); u32 driver_idx = - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | gpu_unai.PixelMSB; @@ -491,7 +476,7 @@ int do_cmd_list(u32 *list_, int list_len, case 0x2A: case 0x2B: { // Monochrome 4-pt poly PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Blending_Mode | gpu_unai.Masking | Blending | gpu_unai.PixelMSB ]; @@ -507,7 +492,7 @@ int do_cmd_list(u32 *list_, int list_len, gpuSetTexture(le32_to_u32(gpu_unai.PacketBuffer.U4[4]) >> 16); u32 driver_idx = - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | gpu_unai.PixelMSB; @@ -533,7 +518,7 @@ int do_cmd_list(u32 *list_, int list_len, // shouldn't apply. Until the original array of template // instantiation ptrs is fixed, we're stuck with this. (TODO) PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.Masking | Blending | 129 | gpu_unai.PixelMSB @@ -549,7 +534,7 @@ int do_cmd_list(u32 *list_, int list_len, gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16); gpuSetTexture (le32_to_u32(gpu_unai.PacketBuffer.U4[5]) >> 16); PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | ((Lighting)?129:0) | gpu_unai.PixelMSB @@ -564,7 +549,7 @@ int do_cmd_list(u32 *list_, int list_len, case 0x3B: { // Gouraud-shaded 4-pt poly // See notes regarding '129' for 0x30..0x33 further above -senquack PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.Masking | Blending | 129 | gpu_unai.PixelMSB @@ -580,7 +565,7 @@ int do_cmd_list(u32 *list_, int list_len, gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16); gpuSetTexture (le32_to_u32(gpu_unai.PacketBuffer.U4[5]) >> 16); PP driver = gpuPolySpanDrivers[ - (gpu_unai.blit_mask?1024:0) | + //(gpu_unai.blit_mask?1024:0) | Dithering | Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | ((Lighting)?129:0) | gpu_unai.PixelMSB @@ -851,7 +836,6 @@ void renderer_set_config(const struct rearmed_cbs *cbs) gpu_unai.vram = (le16_t *)gpu.vram; gpu_unai.config.old_renderer = cbs->gpu_unai.old_renderer; gpu_unai.config.ilace_force = cbs->gpu_unai.ilace_force; - gpu_unai.config.pixel_skip = cbs->gpu_unai.pixel_skip; gpu_unai.config.lighting = cbs->gpu_unai.lighting; gpu_unai.config.fast_lighting = cbs->gpu_unai.fast_lighting; gpu_unai.config.blending = cbs->gpu_unai.blending; -- 2.39.5