From 0a42c534c397b6f99013c25c03799c1c673885b4 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sun, 24 Jul 2022 03:51:22 -0500 Subject: VideoCommon: Add configuration to prefer VS for line/point expansion --- .../DolphinQt/Config/Graphics/AdvancedWidget.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index 47fa7d3eae..dfd809f956 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -128,15 +128,18 @@ void AdvancedWidget::CreateWidgets() m_enable_prog_scan = new ToolTipCheckBox(tr("Enable Progressive Scan")); m_backend_multithreading = new GraphicsBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING); + m_prefer_vs_for_point_line_expansion = new GraphicsBool( + tr("Prefer VS for Point/Line Expansion"), Config::GFX_PREFER_VS_FOR_LINE_POINT_EXPANSION); misc_layout->addWidget(m_enable_cropping, 0, 0); misc_layout->addWidget(m_enable_prog_scan, 0, 1); misc_layout->addWidget(m_backend_multithreading, 1, 0); + misc_layout->addWidget(m_prefer_vs_for_point_line_expansion, 1, 1); #ifdef _WIN32 m_borderless_fullscreen = new GraphicsBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN); - misc_layout->addWidget(m_borderless_fullscreen, 1, 1); + misc_layout->addWidget(m_borderless_fullscreen, 2, 0); #endif // Experimental. @@ -198,11 +201,19 @@ void AdvancedWidget::SaveSettings() void AdvancedWidget::OnBackendChanged() { m_backend_multithreading->setEnabled(g_Config.backend_info.bSupportsMultithreading); + m_prefer_vs_for_point_line_expansion->setEnabled( + Core::GetState() == Core::State::Uninitialized && + g_Config.backend_info.bSupportsGeometryShaders && + g_Config.backend_info.bSupportsVSLinePointExpand); } void AdvancedWidget::OnEmulationStateChanged(bool running) { m_enable_prog_scan->setEnabled(!running); + m_prefer_vs_for_point_line_expansion->setEnabled( + !running && + g_Config.backend_info.bSupportsGeometryShaders && + g_Config.backend_info.bSupportsVSLinePointExpand); } void AdvancedWidget::AddDescriptions() @@ -289,6 +300,11 @@ void AdvancedWidget::AddDescriptions() "this option may result in a performance improvement on systems with more than " "two CPU cores. Currently, this is limited to the Vulkan backend.

" "If unsure, leave this checked."); + static const char TR_PREFER_VS_FOR_POINT_LINE_EXPANSION_DESCRIPTION[] = + QT_TR_NOOP("On backends that support both using the geometry shader and the vertex shader " + "for expanding points and lines, selects the vertex shader for the job. May " + "affect performance." + "

If unsure, leave this unchecked."); static const char TR_DEFER_EFB_ACCESS_INVALIDATION_DESCRIPTION[] = QT_TR_NOOP( "Defers invalidation of the EFB access cache until a GPU synchronization command " "is executed. If disabled, the cache will be invalidated with every draw call. " @@ -337,6 +353,8 @@ void AdvancedWidget::AddDescriptions() m_enable_cropping->SetDescription(tr(TR_CROPPING_DESCRIPTION)); m_enable_prog_scan->SetDescription(tr(TR_PROGRESSIVE_SCAN_DESCRIPTION)); m_backend_multithreading->SetDescription(tr(TR_BACKEND_MULTITHREADING_DESCRIPTION)); + m_prefer_vs_for_point_line_expansion->SetDescription( + tr(TR_PREFER_VS_FOR_POINT_LINE_EXPANSION_DESCRIPTION)); #ifdef _WIN32 m_borderless_fullscreen->SetDescription(tr(TR_BORDERLESS_FULLSCREEN_DESCRIPTION)); #endif -- cgit v1.2.3 From 3912fa7a2ed8ce80d01edb86b5a421bf53ff69ee Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 22 Oct 2022 19:48:50 -0500 Subject: VideoCommon: Add reasons for disabled VS expand --- .../Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index dfd809f956..9c392e02ce 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -205,6 +205,7 @@ void AdvancedWidget::OnBackendChanged() Core::GetState() == Core::State::Uninitialized && g_Config.backend_info.bSupportsGeometryShaders && g_Config.backend_info.bSupportsVSLinePointExpand); + AddDescriptions(); } void AdvancedWidget::OnEmulationStateChanged(bool running) @@ -304,7 +305,7 @@ void AdvancedWidget::AddDescriptions() QT_TR_NOOP("On backends that support both using the geometry shader and the vertex shader " "for expanding points and lines, selects the vertex shader for the job. May " "affect performance." - "

If unsure, leave this unchecked."); + "

%1"); static const char TR_DEFER_EFB_ACCESS_INVALIDATION_DESCRIPTION[] = QT_TR_NOOP( "Defers invalidation of the EFB access cache until a GPU synchronization command " "is executed. If disabled, the cache will be invalidated with every draw call. " @@ -332,6 +333,9 @@ void AdvancedWidget::AddDescriptions() "unchecked."); #endif + static const char IF_UNSURE_UNCHECKED[] = + QT_TR_NOOP("If unsure, leave this unchecked."); + m_enable_wireframe->SetDescription(tr(TR_WIREFRAME_DESCRIPTION)); m_show_statistics->SetDescription(tr(TR_SHOW_STATS_DESCRIPTION)); m_enable_format_overlay->SetDescription(tr(TR_TEXTURE_FORMAT_DESCRIPTION)); @@ -353,8 +357,17 @@ void AdvancedWidget::AddDescriptions() m_enable_cropping->SetDescription(tr(TR_CROPPING_DESCRIPTION)); m_enable_prog_scan->SetDescription(tr(TR_PROGRESSIVE_SCAN_DESCRIPTION)); m_backend_multithreading->SetDescription(tr(TR_BACKEND_MULTITHREADING_DESCRIPTION)); + QString vsexpand_extra; + if (!g_Config.backend_info.bSupportsGeometryShaders) + vsexpand_extra = tr("Forced on because %1 doesn't support geometry shaders.") + .arg(tr(g_Config.backend_info.DisplayName.c_str())); + else if (!g_Config.backend_info.bSupportsVSLinePointExpand) + vsexpand_extra = tr("Forced off because %1 doesn't support VS expansion.") + .arg(tr(g_Config.backend_info.DisplayName.c_str())); + else + vsexpand_extra = tr(IF_UNSURE_UNCHECKED); m_prefer_vs_for_point_line_expansion->SetDescription( - tr(TR_PREFER_VS_FOR_POINT_LINE_EXPANSION_DESCRIPTION)); + tr(TR_PREFER_VS_FOR_POINT_LINE_EXPANSION_DESCRIPTION).arg(vsexpand_extra)); #ifdef _WIN32 m_borderless_fullscreen->SetDescription(tr(TR_BORDERLESS_FULLSCREEN_DESCRIPTION)); #endif -- cgit v1.2.3 From 1e9b6f88e4c13722a2a47aeb0d54df95c3a07c69 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 22 Oct 2022 20:11:52 -0500 Subject: VideoCommon: Support hot reloading of VS expand --- Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index 9c392e02ce..4a25976a1c 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -202,7 +202,6 @@ void AdvancedWidget::OnBackendChanged() { m_backend_multithreading->setEnabled(g_Config.backend_info.bSupportsMultithreading); m_prefer_vs_for_point_line_expansion->setEnabled( - Core::GetState() == Core::State::Uninitialized && g_Config.backend_info.bSupportsGeometryShaders && g_Config.backend_info.bSupportsVSLinePointExpand); AddDescriptions(); @@ -211,10 +210,6 @@ void AdvancedWidget::OnBackendChanged() void AdvancedWidget::OnEmulationStateChanged(bool running) { m_enable_prog_scan->setEnabled(!running); - m_prefer_vs_for_point_line_expansion->setEnabled( - !running && - g_Config.backend_info.bSupportsGeometryShaders && - g_Config.backend_info.bSupportsVSLinePointExpand); } void AdvancedWidget::AddDescriptions() -- cgit v1.2.3