2020-09-10 14:18:12 +00:00
# include "displaysettingswidget.h"
2020-01-03 07:51:58 +00:00
# include "core/gpu.h"
# include "core/settings.h"
2020-09-12 15:20:02 +00:00
# include "postprocessingchainconfigwidget.h"
2020-09-01 14:00:48 +00:00
# include "qtutils.h"
2020-04-30 15:00:05 +00:00
# include "settingsdialog.h"
2020-01-03 07:51:58 +00:00
# include "settingwidgetbinder.h"
2020-09-12 15:20:02 +00:00
# include <QtWidgets/QMessageBox>
2020-01-03 07:51:58 +00:00
2020-06-19 17:34:00 +00:00
// For enumerating adapters.
2021-06-28 10:16:48 +00:00
# ifdef _WIN32
2020-06-19 17:34:00 +00:00
# include "frontend-common/d3d11_host_display.h"
2021-07-13 04:15:34 +00:00
# include "frontend-common/d3d12_host_display.h"
2020-06-19 17:34:00 +00:00
# endif
2022-07-30 15:06:40 +00:00
# ifdef WITH_VULKAN
# include "frontend-common/vulkan_host_display.h"
# endif
2020-06-19 17:34:00 +00:00
2022-07-11 13:03:29 +00:00
DisplaySettingsWidget : : DisplaySettingsWidget ( SettingsDialog * dialog , QWidget * parent )
: QWidget ( parent ) , m_dialog ( dialog )
2020-01-03 07:51:58 +00:00
{
2022-07-11 13:03:29 +00:00
SettingsInterface * sif = dialog - > getSettingsInterface ( ) ;
2020-01-03 07:51:58 +00:00
m_ui . setupUi ( this ) ;
setupAdditionalUi ( ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToEnumSetting ( sif , m_ui . renderer , " GPU " , " Renderer " , & Settings : : ParseRendererName ,
& Settings : : GetRendererName , Settings : : DEFAULT_GPU_RENDERER ) ;
SettingWidgetBinder : : BindWidgetToEnumSetting ( sif , m_ui . displayAspectRatio , " Display " , " AspectRatio " ,
2020-07-21 09:49:04 +00:00
& Settings : : ParseDisplayAspectRatio , & Settings : : GetDisplayAspectRatioName ,
Settings : : DEFAULT_DISPLAY_ASPECT_RATIO ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToIntSetting ( sif , m_ui . customAspectRatioNumerator , " Display " ,
2021-04-28 16:42:08 +00:00
" CustomAspectRatioNumerator " , 1 ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToIntSetting ( sif , m_ui . customAspectRatioDenominator , " Display " ,
2021-04-28 16:42:08 +00:00
" CustomAspectRatioDenominator " , 1 ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToEnumSetting ( sif , m_ui . displayCropMode , " Display " , " CropMode " ,
2020-07-21 09:49:04 +00:00
& Settings : : ParseDisplayCropMode , & Settings : : GetDisplayCropModeName ,
Settings : : DEFAULT_DISPLAY_CROP_MODE ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToEnumSetting ( sif , m_ui . gpuDownsampleMode , " GPU " , " DownsampleMode " ,
2020-12-30 06:26:20 +00:00
& Settings : : ParseDownsampleModeName , & Settings : : GetDownsampleModeName ,
Settings : : DEFAULT_GPU_DOWNSAMPLE_MODE ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . displayLinearFiltering , " Display " , " LinearFiltering " , true ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . displayIntegerScaling , " Display " , " IntegerScaling " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . displayStretch , " Display " , " Stretch " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . internalResolutionScreenshots , " Display " ,
2021-03-05 16:19:35 +00:00
" InternalResolutionScreenshots " , false ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . vsync , " Display " , " VSync " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . displayAllFrames , " Display " , " DisplayAllFrames " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . gpuThread , " GPU " , " UseThread " , true ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . threadedPresentation , " GPU " , " ThreadedPresentation " , true ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . syncToHostRefreshRate , " Main " , " SyncToHostRefreshRate " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showOSDMessages , " Display " , " ShowOSDMessages " , true ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showFPS , " Display " , " ShowFPS " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showSpeed , " Display " , " ShowSpeed " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showResolution , " Display " , " ShowResolution " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showCPU , " Display " , " ShowCPU " , false ) ;
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , m_ui . showInput , " Display " , " ShowInputs " , false ) ;
2020-08-01 14:25:07 +00:00
2020-06-19 17:34:00 +00:00
connect ( m_ui . renderer , QOverload < int > : : of ( & QComboBox : : currentIndexChanged ) , this ,
2020-11-01 14:38:54 +00:00
& DisplaySettingsWidget : : populateGPUAdaptersAndResolutions ) ;
2020-06-22 05:57:43 +00:00
connect ( m_ui . adapter , QOverload < int > : : of ( & QComboBox : : currentIndexChanged ) , this ,
2020-09-10 14:18:12 +00:00
& DisplaySettingsWidget : : onGPUAdapterIndexChanged ) ;
2020-11-01 14:38:54 +00:00
connect ( m_ui . fullscreenMode , QOverload < int > : : of ( & QComboBox : : currentIndexChanged ) , this ,
& DisplaySettingsWidget : : onGPUFullscreenModeIndexChanged ) ;
2021-04-28 16:42:08 +00:00
connect ( m_ui . displayAspectRatio , QOverload < int > : : of ( & QComboBox : : currentIndexChanged ) , this ,
& DisplaySettingsWidget : : onAspectRatioChanged ) ;
2021-02-01 08:39:15 +00:00
connect ( m_ui . displayIntegerScaling , & QCheckBox : : stateChanged , this ,
& DisplaySettingsWidget : : onIntegerFilteringChanged ) ;
2020-11-01 14:38:54 +00:00
populateGPUAdaptersAndResolutions ( ) ;
2021-02-01 08:39:15 +00:00
onIntegerFilteringChanged ( ) ;
2021-04-28 16:42:08 +00:00
onAspectRatioChanged ( ) ;
2020-06-19 17:34:00 +00:00
2020-04-30 15:00:05 +00:00
dialog - > registerWidgetHelp (
2020-10-28 07:32:49 +00:00
m_ui . renderer , tr ( " Renderer " ) ,
qApp - > translate ( " GPURenderer " , Settings : : GetRendererDisplayName ( Settings : : DEFAULT_GPU_RENDERER ) ) ,
2020-09-01 14:00:48 +00:00
tr ( " Chooses the backend to use for rendering the console/game visuals. <br>Depending on your system and hardware, "
" Direct3D 11 and OpenGL hardware backends may be available. <br>The software renderer offers the best "
2020-10-28 07:32:49 +00:00
" compatibility, but is the slowest and does not offer any enhancements. " ) ) ;
2020-06-20 15:55:28 +00:00
dialog - > registerWidgetHelp (
m_ui . adapter , tr ( " Adapter " ) , tr ( " (Default) " ) ,
tr ( " If your system contains multiple GPUs or adapters, you can select which GPU you wish to use for the hardware "
2020-09-01 14:00:48 +00:00
" renderers. <br>This option is only supported in Direct3D and Vulkan. OpenGL will always use the default "
" device. " ) ) ;
2021-02-01 08:39:15 +00:00
dialog - > registerWidgetHelp ( m_ui . fullscreenMode , tr ( " Fullscreen Mode " ) , tr ( " Borderless Fullscreen " ) ,
tr ( " Chooses the fullscreen resolution and frequency. " ) ) ;
2020-04-30 15:00:05 +00:00
dialog - > registerWidgetHelp (
2020-12-31 09:07:24 +00:00
m_ui . displayAspectRatio , tr ( " Aspect Ratio " ) ,
qApp - > translate ( " DisplayAspectRatio " , Settings : : GetDisplayAspectRatioName ( Settings : : DEFAULT_DISPLAY_ASPECT_RATIO ) ) ,
2020-12-12 05:37:53 +00:00
tr ( " Changes the aspect ratio used to display the console's output to the screen. The default is Auto (Game Native) "
" which automatically adjusts the aspect ratio to match how a game would be shown on a typical TV of the era. " ) ) ;
2020-04-30 15:00:29 +00:00
dialog - > registerWidgetHelp (
2020-12-31 09:07:24 +00:00
m_ui . displayCropMode , tr ( " Crop Mode " ) ,
qApp - > translate ( " DisplayCropMode " , Settings : : GetDisplayCropModeDisplayName ( Settings : : DEFAULT_DISPLAY_CROP_MODE ) ) ,
2020-08-22 03:11:03 +00:00
tr ( " Determines how much of the area typically not visible on a consumer TV set to crop/hide. <br> "
" Some games display content in the overscan area, or use it for screen effects. <br>May "
" not display correctly with the \" All Borders \" setting. \" Only Overscan \" offers a good "
2020-07-28 09:42:14 +00:00
" compromise between stability and hiding black borders. " ) ) ;
2020-12-30 06:26:20 +00:00
dialog - > registerWidgetHelp (
m_ui . gpuDownsampleMode , tr ( " Downsampling " ) , tr ( " Disabled " ) ,
tr ( " Downsamples the rendered image prior to displaying it. Can improve overall image quality in mixed 2D/3D games, "
" but should be disabled for pure 3D games. Only applies to the hardware renderers. " ) ) ;
2020-09-01 14:00:48 +00:00
dialog - > registerWidgetHelp ( m_ui . displayLinearFiltering , tr ( " Linear Upscaling " ) , tr ( " Checked " ) ,
tr ( " Uses bilinear texture filtering when displaying the console's framebuffer to the "
" screen. <br>Disabling filtering "
" will producer a sharper, blockier/pixelated image. Enabling will smooth out the "
" image. <br>The option will be less "
" noticable the higher the resolution scale. " ) ) ;
2020-04-30 15:00:05 +00:00
dialog - > registerWidgetHelp (
2020-07-28 09:42:14 +00:00
m_ui . displayIntegerScaling , tr ( " Integer Upscaling " ) , tr ( " Unchecked " ) ,
tr ( " Adds padding to the display area to ensure that the ratio between pixels on the host to "
2020-08-22 03:11:03 +00:00
" pixels in the console is an integer number. <br>May result in a sharper image in some 2D games. " ) ) ;
2021-03-05 16:19:35 +00:00
dialog - > registerWidgetHelp ( m_ui . displayStretch , tr ( " Stretch To Fill " ) , tr ( " Unchecked " ) ,
tr ( " Fills the window with the active display area, regardless of the aspect ratio. " ) ) ;
dialog - > registerWidgetHelp ( m_ui . internalResolutionScreenshots , tr ( " Internal Resolution Screenshots " ) , tr ( " Unchecked " ) ,
tr ( " Saves screenshots at internal render resolution and without postprocessing. If this "
" option is disabled, the screenshots will be taken at the window's resolution. "
" Internal resolution screenshots can be very large at high rendering scales. " ) ) ;
2020-04-30 15:00:05 +00:00
dialog - > registerWidgetHelp (
2020-07-28 09:42:14 +00:00
m_ui . vsync , tr ( " VSync " ) , tr ( " Checked " ) ,
2020-08-22 03:11:03 +00:00
tr ( " Enable this option to match DuckStation's refresh rate with your current monitor or screen. "
" VSync is automatically disabled when it is not possible (e.g. running at non-100% speed). " ) ) ;
2021-01-28 13:50:39 +00:00
dialog - > registerWidgetHelp ( m_ui . displayAllFrames , tr ( " Optimal Frame Pacing " ) , tr ( " Unchecked " ) ,
2021-01-28 10:20:15 +00:00
tr ( " Enable this option will ensure every frame the console renders is displayed to the "
" screen, for optimal frame pacing. If you are having difficulties maintaining full "
" speed, or are getting audio glitches, try disabling this option. " ) ) ;
2020-12-26 13:22:24 +00:00
dialog - > registerWidgetHelp ( m_ui . threadedPresentation , tr ( " Threaded Presentation " ) , tr ( " Checked " ) ,
tr ( " Presents frames on a background thread when fast forwarding or vsync is disabled. "
" This can measurably improve performance in the Vulkan renderer. " ) ) ;
2020-11-21 03:32:58 +00:00
dialog - > registerWidgetHelp ( m_ui . gpuThread , tr ( " Threaded Rendering " ) , tr ( " Checked " ) ,
tr ( " Uses a second thread for drawing graphics. Currently only available for the software "
" renderer, but can provide a significant speed improvement, and is safe to use. " ) ) ;
2021-05-19 03:43:49 +00:00
dialog - > registerWidgetHelp (
2021-06-30 05:40:31 +00:00
m_ui . syncToHostRefreshRate , tr ( " Sync To Host Refresh Rate " ) , tr ( " Unchecked " ) ,
tr ( " Adjusts the emulation speed so the console's refresh rate matches the host's refresh rate when both VSync and "
" Audio Resampling settings are enabled. This results in the smoothest animations possible, at the cost of "
" potentially increasing the emulation speed by less than 1%. Sync To Host Refresh Rate will not take effect if "
" the console's refresh rate is too far from the host's refresh rate. Users with variable refresh rate displays "
" should disable this option. " ) ) ;
2020-09-10 14:18:12 +00:00
dialog - > registerWidgetHelp ( m_ui . showOSDMessages , tr ( " Show OSD Messages " ) , tr ( " Checked " ) ,
tr ( " Shows on-screen-display messages when events occur such as save states being "
" created/loaded, screenshots being taken, etc. " ) ) ;
2022-07-11 13:03:29 +00:00
dialog - > registerWidgetHelp ( m_ui . showFPS , tr ( " Show FPS " ) , tr ( " Unchecked " ) ,
2020-09-10 14:18:12 +00:00
tr ( " Shows the internal frame rate of the game in the top-right corner of the display. " ) ) ;
2020-07-28 09:42:14 +00:00
dialog - > registerWidgetHelp (
2021-02-16 20:53:50 +00:00
m_ui . showSpeed , tr ( " Show Emulation Speed " ) , tr ( " Unchecked " ) ,
2020-09-10 14:18:12 +00:00
tr ( " Shows the current emulation speed of the system in the top-right corner of the display as a percentage. " ) ) ;
2021-01-28 11:03:51 +00:00
dialog - > registerWidgetHelp ( m_ui . showResolution , tr ( " Show Resolution " ) , tr ( " Unchecked " ) ,
tr ( " Shows the resolution of the game in the top-right corner of the display. " ) ) ;
2022-09-22 13:05:16 +00:00
dialog - > registerWidgetHelp (
m_ui . showCPU , tr ( " Show CPU Usage " ) , tr ( " Unchecked " ) ,
tr ( " Shows the host's CPU usage based on threads in the top-right corner of the display. This does not display the emulated system CPU's usage. If a value close to 100% is being displayed, this means your host's CPU is likely the bottleneck. In this case, you should reduce enhancement-related settings such as overclocking. " ) ) ;
2021-04-03 17:51:08 +00:00
dialog - > registerWidgetHelp (
m_ui . showInput , tr ( " Show Controller Input " ) , tr ( " Unchecked " ) ,
tr ( " Shows the current controller state of the system in the bottom-left corner of the display. " ) ) ;
2020-12-25 07:42:07 +00:00
# ifdef _WIN32
{
QCheckBox * cb = new QCheckBox ( tr ( " Use Blit Swap Chain " ) , m_ui . basicGroupBox ) ;
2022-07-11 13:03:29 +00:00
SettingWidgetBinder : : BindWidgetToBoolSetting ( sif , cb , " Display " , " UseBlitSwapChain " , false ) ;
2021-05-19 03:43:49 +00:00
m_ui . basicCheckboxGridLayout - > addWidget ( cb , 2 , 1 , 1 , 1 ) ;
2020-12-25 07:42:07 +00:00
dialog - > registerWidgetHelp ( cb , tr ( " Use Blit Swap Chain " ) , tr ( " Unchecked " ) ,
tr ( " Uses a blit presentation model instead of flipping when using the Direct3D 11 "
" renderer. This usually results in slower performance, but may be required for some "
" streaming applications, or to uncap framerates on some systems. " ) ) ;
}
# endif
2020-01-03 07:51:58 +00:00
}
2020-09-10 14:18:12 +00:00
DisplaySettingsWidget : : ~ DisplaySettingsWidget ( ) = default ;
2020-01-03 07:51:58 +00:00
2020-09-10 14:18:12 +00:00
void DisplaySettingsWidget : : setupAdditionalUi ( )
2020-01-03 07:51:58 +00:00
{
for ( u32 i = 0 ; i < static_cast < u32 > ( GPURenderer : : Count ) ; i + + )
2020-08-22 03:01:52 +00:00
{
m_ui . renderer - > addItem (
qApp - > translate ( " GPURenderer " , Settings : : GetRendererDisplayName ( static_cast < GPURenderer > ( i ) ) ) ) ;
}
2020-01-03 07:51:58 +00:00
2020-04-10 05:12:16 +00:00
for ( u32 i = 0 ; i < static_cast < u32 > ( DisplayAspectRatio : : Count ) ; i + + )
{
m_ui . displayAspectRatio - > addItem (
2020-12-27 07:35:48 +00:00
qApp - > translate ( " DisplayAspectRatio " , Settings : : GetDisplayAspectRatioName ( static_cast < DisplayAspectRatio > ( i ) ) ) ) ;
2020-04-10 05:12:16 +00:00
}
2020-02-28 07:01:01 +00:00
for ( u32 i = 0 ; i < static_cast < u32 > ( DisplayCropMode : : Count ) ; i + + )
{
2020-04-10 05:12:16 +00:00
m_ui . displayCropMode - > addItem (
2020-08-22 03:01:52 +00:00
qApp - > translate ( " DisplayCropMode " , Settings : : GetDisplayCropModeDisplayName ( static_cast < DisplayCropMode > ( i ) ) ) ) ;
2020-02-28 07:01:01 +00:00
}
2020-12-30 06:26:20 +00:00
for ( u32 i = 0 ; i < static_cast < u32 > ( GPUDownsampleMode : : Count ) ; i + + )
{
m_ui . gpuDownsampleMode - > addItem (
qApp - > translate ( " GPUDownsampleMode " , Settings : : GetDownsampleModeDisplayName ( static_cast < GPUDownsampleMode > ( i ) ) ) ) ;
}
2020-01-03 07:51:58 +00:00
}
2020-06-19 17:34:00 +00:00
2020-11-01 14:38:54 +00:00
void DisplaySettingsWidget : : populateGPUAdaptersAndResolutions ( )
2020-06-19 17:34:00 +00:00
{
2021-02-13 14:33:35 +00:00
HostDisplay : : AdapterAndModeList aml ;
2020-11-21 03:32:58 +00:00
bool thread_supported = false ;
2020-12-26 13:22:24 +00:00
bool threaded_presentation_supported = false ;
2020-06-19 17:34:00 +00:00
switch ( static_cast < GPURenderer > ( m_ui . renderer - > currentIndex ( ) ) )
{
2021-06-28 10:16:48 +00:00
# ifdef _WIN32
2020-06-19 17:34:00 +00:00
case GPURenderer : : HardwareD3D11 :
2021-02-13 14:33:35 +00:00
aml = FrontendCommon : : D3D11HostDisplay : : StaticGetAdapterAndModeList ( ) ;
break ;
2021-07-13 04:15:34 +00:00
case GPURenderer : : HardwareD3D12 :
aml = FrontendCommon : : D3D12HostDisplay : : StaticGetAdapterAndModeList ( ) ;
break ;
2020-06-19 17:34:00 +00:00
# endif
2022-07-30 15:06:40 +00:00
# ifdef WITH_VULKAN
2020-06-19 17:34:00 +00:00
case GPURenderer : : HardwareVulkan :
2021-02-15 16:57:35 +00:00
aml = FrontendCommon : : VulkanHostDisplay : : StaticGetAdapterAndModeList ( nullptr ) ;
2020-12-26 13:22:24 +00:00
threaded_presentation_supported = true ;
2020-06-19 17:34:00 +00:00
break ;
2022-07-30 15:06:40 +00:00
# endif
2020-06-19 17:34:00 +00:00
2020-11-21 03:32:58 +00:00
case GPURenderer : : Software :
thread_supported = true ;
break ;
2020-06-19 17:34:00 +00:00
default :
break ;
}
2020-11-01 14:38:54 +00:00
{
2022-07-11 13:03:29 +00:00
const std : : string current_adapter ( m_dialog - > getEffectiveStringValue ( " GPU " , " Adapter " , " " ) ) ;
2020-11-01 14:38:54 +00:00
QSignalBlocker blocker ( m_ui . adapter ) ;
2020-07-13 16:24:11 +00:00
2020-11-01 14:38:54 +00:00
// add the default entry - we'll fall back to this if the GPU no longer exists, or there's no options
m_ui . adapter - > clear ( ) ;
m_ui . adapter - > addItem ( tr ( " (Default) " ) ) ;
2020-06-22 05:57:43 +00:00
2020-11-01 14:38:54 +00:00
// add the other adapters
2021-02-13 14:33:35 +00:00
for ( const std : : string & adapter_name : aml . adapter_names )
2020-11-01 14:38:54 +00:00
{
m_ui . adapter - > addItem ( QString : : fromStdString ( adapter_name ) ) ;
2020-06-19 17:34:00 +00:00
2020-11-01 14:38:54 +00:00
if ( adapter_name = = current_adapter )
m_ui . adapter - > setCurrentIndex ( m_ui . adapter - > count ( ) - 1 ) ;
}
2020-06-22 05:57:43 +00:00
2020-11-01 14:38:54 +00:00
// disable it if we don't have a choice
2021-02-13 14:33:35 +00:00
m_ui . adapter - > setEnabled ( ! aml . adapter_names . empty ( ) ) ;
2020-06-22 05:57:43 +00:00
}
2020-06-19 17:34:00 +00:00
2020-11-01 14:38:54 +00:00
{
2022-07-11 13:03:29 +00:00
const std : : string current_mode ( m_dialog - > getEffectiveStringValue ( " GPU " , " FullscreenMode " , " " ) ) ;
2020-11-01 14:38:54 +00:00
QSignalBlocker blocker ( m_ui . fullscreenMode ) ;
m_ui . fullscreenMode - > clear ( ) ;
m_ui . fullscreenMode - > addItem ( tr ( " Borderless Fullscreen " ) ) ;
m_ui . fullscreenMode - > setCurrentIndex ( 0 ) ;
2021-02-13 14:33:35 +00:00
for ( const std : : string & mode_name : aml . fullscreen_modes )
2020-11-01 14:38:54 +00:00
{
m_ui . fullscreenMode - > addItem ( QString : : fromStdString ( mode_name ) ) ;
if ( mode_name = = current_mode )
m_ui . fullscreenMode - > setCurrentIndex ( m_ui . fullscreenMode - > count ( ) - 1 ) ;
}
// disable it if we don't have a choice
2021-02-13 14:33:35 +00:00
m_ui . fullscreenMode - > setEnabled ( ! aml . fullscreen_modes . empty ( ) ) ;
2020-11-01 14:38:54 +00:00
}
2020-11-21 03:32:58 +00:00
m_ui . gpuThread - > setEnabled ( thread_supported ) ;
2020-12-26 13:22:24 +00:00
m_ui . threadedPresentation - > setEnabled ( threaded_presentation_supported ) ;
2020-06-22 05:57:43 +00:00
}
2020-09-10 14:18:12 +00:00
void DisplaySettingsWidget : : onGPUAdapterIndexChanged ( )
2020-06-22 05:57:43 +00:00
{
if ( m_ui . adapter - > currentIndex ( ) = = 0 )
{
// default
2022-07-11 13:03:29 +00:00
m_dialog - > removeSettingValue ( " GPU " , " Adapter " ) ;
2020-06-22 05:57:43 +00:00
return ;
2020-06-19 17:34:00 +00:00
}
2020-06-22 05:57:43 +00:00
2022-07-11 13:03:29 +00:00
m_dialog - > setStringSettingValue ( " GPU " , " Adapter " , m_ui . adapter - > currentText ( ) . toUtf8 ( ) . constData ( ) ) ;
2020-06-19 17:34:00 +00:00
}
2020-11-01 14:38:54 +00:00
void DisplaySettingsWidget : : onGPUFullscreenModeIndexChanged ( )
{
if ( m_ui . fullscreenMode - > currentIndex ( ) = = 0 )
{
// default
2022-07-11 13:03:29 +00:00
m_dialog - > removeSettingValue ( " GPU " , " FullscreenMode " ) ;
2020-11-01 14:38:54 +00:00
return ;
}
2022-07-11 13:03:29 +00:00
m_dialog - > setStringSettingValue ( " GPU " , " FullscreenMode " , m_ui . fullscreenMode - > currentText ( ) . toUtf8 ( ) . constData ( ) ) ;
2021-01-28 11:03:51 +00:00
}
2021-02-01 08:39:15 +00:00
void DisplaySettingsWidget : : onIntegerFilteringChanged ( )
{
m_ui . displayLinearFiltering - > setEnabled ( ! m_ui . displayIntegerScaling - > isChecked ( ) ) ;
2021-02-27 03:53:03 +00:00
m_ui . displayStretch - > setEnabled ( ! m_ui . displayIntegerScaling - > isChecked ( ) ) ;
}
2021-04-28 16:42:08 +00:00
void DisplaySettingsWidget : : onAspectRatioChanged ( )
{
const bool is_custom =
static_cast < DisplayAspectRatio > ( m_ui . displayAspectRatio - > currentIndex ( ) ) = = DisplayAspectRatio : : Custom ;
m_ui . customAspectRatioNumerator - > setVisible ( is_custom ) ;
m_ui . customAspectRatioDenominator - > setVisible ( is_custom ) ;
m_ui . customAspectRatioSeparator - > setVisible ( is_custom ) ;
}