Ant_222 wrote:Kisai wrote:The software scaler is likely unusable with a 4K monitor because it's not parallel (eg not using OpenCL or OpenMP or similar.) We can get away with it at HD and below resolutions because the multiplier is only 2 or 3 typically, but at 4K it would need a 9x multiplier, and a UHD monitor would need an 18x multiplier.
Have you tested the performance of SDL 2.0 with integer scaling via SDL_RenderSetScale()?
No I haven't, I'm not sure if that's what you'd want to do since you're operating on a line-by line basis. The purpose of that feature is to create a game with a resolution at a different display scale, and then draw everything with multiple SDL textures where you need the coordinates to be consistent, where as how DOSBOX works is just one texture, therefor it would add an additional complication into the SDL backend that is unnecessary.
I bought a 4K monitor, it arrived today.
So I re-tested all the same things I did in the "feature request thread", pretty much everything but the full screen switch and the dosbox debugger work. There are some unintended side-effects however.
This is a ASUS MG24UQ, it has a feature in the monitor to switch the aspect ratio, so it IS possible to tell it to force the aspect ratio to 4:3 without screwing around with the GPU controls. That said, the defaults are not great. The fullscreen performance at 640x480 (SDL1 stock dosbox overlay, 10% window/fullscreen idle) vs 3840x2160 (SDL2.0 texturenb) is negligible on my system (0.2% with SDL2, full screen or windowed idle)
The dosbox debugger doesn't like the display scaling. it just blanks out and you see things when the scroll. I'm not sure why that is yet, but I think it may be an unintended side effect of windows 10's display scaling itself. Point of interest, When dosbox is not compiled with HiDPI awareness in, your 4K monitor at 200% has the same screen real estate as a 1920x1080. So DOSBOX's game window get scaled too when it's windowed. Since there are no menus or GUI objects, DOSBOX can be compiled with HiDPI enabled and you can actually specific a 4K windowed resolution. a 2560x1920 window is still only 9% CPU. (so roughly 72% of one core)
Also when DOSBOX switches in/out of full screen, it messes up the display scaling of other windows, that I'm not sure if it's DOSBOX or SDL because I can't seem to replicate it consistently.
Things to consider:
- Compile non-debug DOSBOX's windows manifest to be DPI aware.
- SDL2 does not require a scaler with texture/texturenb and performance does not appear impacted regardless of resolution or full screen
- 4K monitor might have an aspect ratio over-ride allowing 'original' resolution at 640x480 to be used. This monitor's smallest resolution is 640x350. This is moot with SDL2 since it can be set to desktop (even when HiDPI aware) and use the hardware scaling.
That said, not everyone is going to have a high end system, and what I have is a Geforce GTX760 which is actually good enough for 2D 4K stuff.
Edit: I forgot to turn off heavy_debug, the CPU is actually 0.37% windowed (2560x2000)