libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.26k stars 1.83k forks source link

Xbox One: 720p output and rendering #8026

Open fandangos opened 5 years ago

fandangos commented 5 years ago

First and foremost consider this:

The retroarch.cfg file gets overwritten by the default one. So nothing the end user could do changing retroarch.cfg in LocalState will stick. So changing fullscreen resolution won't take any effect.

Description

No matter the resolution the Xbox One is outputting RetroArch is rendering all the time at 1080p. You can see it enabling integer scaling and filling the entire screen with a game.

Code I would like to be able to change: video_fullscreen = "True" video_fullscreen_x = "1280" video_fullscreen_y = "720"

dpi_override_enable = "true" dpi_override_value = "100"

video_windowed_fullscreen = "false"

Expected behavior

I expect the retroarch.cfg file uploaded to LocalState to be used or Xbox One to use the output resolution if you change in the system settings of the console from 1080p to 720p.

Reasons for 720p: integer scaling without black borders. Shimering free games. Multiple of 240p. Multiple of 2160. Possibility to use scanline shaders without uneven scanlines.

Environment information

Xbox One

krzys-h commented 5 years ago

For UWP on Xbox One apps, the system always indicates a window size of 1920 x 1080 (i.e. 1080p). If the TV is running as 4K on an Xbox One S or Xbox One X, the swapchain content is automatically scaled up by the display hardware.

https://blogs.msdn.microsoft.com/chuckw/2017/12/15/directx-and-uwp-on-xbox-one/

So this may not be doable - the system always forces 1080p for the app and scales it accordingly in the GPU driver

krzys-h commented 5 years ago

Actually, it may be doable, we just have to ignore what Windows says about the window size and force the swapchain to the resolution we want

fandangos commented 5 years ago

@krzys-h If I get it right, it would result in 2 difference versions for RetroArch? There will be a need to compile a 1080p one and a 720p? Or would be possible to actually change the resolution in retroarch.cfg?

fandangos commented 5 years ago

@krzys-h

Looking at the code by MS

include "Gamingdeviceinformation.h"

… GAMING_DEVICE_MODEL_INFORMATION info = {}; GetGamingDeviceModelInformation(&info); if (info.vendorId == GAMING_DEVICE_VENDOR_ID_MICROSOFT) { switch (info.deviceId) { case GAMING_DEVICE_DEVICE_ID_XBOX_ONE: case GAMING_DEVICE_DEVICE_ID_XBOX_ONE_S: // Keep swapchain at 1920 x 1080 break;

case GAMING_DEVICE_DEVICE_ID_XBOX_ONE_X:
case GAMING_DEVICE_DEVICE_ID_XBOX_ONE_X_DEVKIT:
default: // Forward compatibility
    m_outputWidth = 3840;
    m_outputHeight = 2160;
    break;
}

}

Can't this be added to the Xbox One port? Like this:

include "Gamingdeviceinformation.h"

… GAMING_DEVICE_MODEL_INFORMATION info = {}; GetGamingDeviceModelInformation(&info); if (info.vendorId == GAMING_DEVICE_VENDOR_ID_MICROSOFT) { switch (info.deviceId) { case GAMING_DEVICE_DEVICE_ID_XBOX_ONE: case GAMING_DEVICE_DEVICE_ID_XBOX_ONE_S: m_outputWidth = 1280; m_outputHeight = 720; break; } }

Do you think this could work?

tunip3 commented 2 years ago

Resolution is now automatically set from the display on app start up so this issue can be closed