libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
309 stars 131 forks source link

[Suggestion] 9x internal resolution option #817

Open adamski90 opened 3 years ago

adamski90 commented 3 years ago

This would be sufficient to scale the original resolution to 4k (i.e. 9 x 240 = 2160)

As it stands currently there are options up to 8x and then the next option is 16x which I would assume means the GPU is doing unnecessary extra work as no one is actually rendering at 16x unless they are playing on an 8K screen?

As for the code I imagine it would be easy to adapt whatever Duckstation have done, as they offer 9x option in their core which is also open source https://github.com/stenzek/duckstation

Calinou commented 2 years ago

If anyone wants to look into this, here's what I could find so far:

The Vulkan renderer is initialized here with a scaling variable: https://github.com/libretro/beetle-psx-libretro/blob/88929ae90b4807a41b1b240377ab440e39ecf2cc/parallel-psx/renderer/renderer.cpp#L19

The available options can be changed here: https://github.com/libretro/beetle-psx-libretro/blob/88929ae90b4807a41b1b240377ab440e39ecf2cc/libretro_core_options.h#L88-L105 I'd recommend adding options such as 3×, 5×, 6×, 7× and 9×.

The scaled dithering option assumes that the scaling factor is always a power of 2: https://github.com/libretro/beetle-psx-libretro/blob/88929ae90b4807a41b1b240377ab440e39ecf2cc/parallel-psx/renderer/renderer.cpp#L1209 The scaled dithering implementation likely needs to be modified to work with non-power-of-two scaling factors (or the setting ignored in this case).

I don't have a local development setup for Beetle/libretro, so I can't test this on my own.