summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/core/hle/kernel/k_scheduler.h5
-rw-r--r--src/core/hle/kernel/svc.cpp17
-rw-r--r--src/core/hle/result.h24
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp15
-rw-r--r--src/yuzu/configuration/configure_dialog.cpp7
-rw-r--r--src/yuzu/configuration/configure_per_game.cpp2
-rw-r--r--src/yuzu/configuration/configure_per_game.ui8
8 files changed, 71 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6e66dc1df..63dd9febf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,6 +32,7 @@ if (MSVC)
32 # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates 32 # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates
33 # /Zc:inline - Let codegen omit inline functions in object files 33 # /Zc:inline - Let codegen omit inline functions in object files
34 # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null 34 # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null
35 # /GT - Supports fiber safety for data allocated using static thread-local storage
35 add_compile_options( 36 add_compile_options(
36 /MP 37 /MP
37 /Zi 38 /Zi
@@ -44,6 +45,7 @@ if (MSVC)
44 /Zc:externConstexpr 45 /Zc:externConstexpr
45 /Zc:inline 46 /Zc:inline
46 /Zc:throwingNew 47 /Zc:throwingNew
48 /GT
47 49
48 # External headers diagnostics 50 # External headers diagnostics
49 /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later 51 /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later
@@ -69,6 +71,10 @@ if (MSVC)
69 /we5038 # data member 'member1' will be initialized after data member 'member2' 71 /we5038 # data member 'member1' will be initialized after data member 'member2'
70 ) 72 )
71 73
74 if (ARCHITECTURE_x86_64)
75 add_compile_options(/QIntel-jcc-erratum)
76 endif()
77
72 # /GS- - No stack buffer overflow checks 78 # /GS- - No stack buffer overflow checks
73 add_compile_options("$<$<CONFIG:Release>:/GS->") 79 add_compile_options("$<$<CONFIG:Release>:/GS->")
74 80
diff --git a/src/core/hle/kernel/k_scheduler.h b/src/core/hle/kernel/k_scheduler.h
index c8ccc1ae4..7df288438 100644
--- a/src/core/hle/kernel/k_scheduler.h
+++ b/src/core/hle/kernel/k_scheduler.h
@@ -49,6 +49,11 @@ public:
49 /// Gets the current running thread 49 /// Gets the current running thread
50 [[nodiscard]] KThread* GetCurrentThread() const; 50 [[nodiscard]] KThread* GetCurrentThread() const;
51 51
52 /// Gets the idle thread
53 [[nodiscard]] KThread* GetIdleThread() const {
54 return idle_thread;
55 }
56
52 /// Returns true if the scheduler is idle 57 /// Returns true if the scheduler is idle
53 [[nodiscard]] bool IsIdle() const { 58 [[nodiscard]] bool IsIdle() const {
54 return GetCurrentThread() == idle_thread; 59 return GetCurrentThread() == idle_thread;
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index f98f24a60..7f38ade1c 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -886,7 +886,24 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
886 *result = out_ticks; 886 *result = out_ticks;
887 return ResultSuccess; 887 return ResultSuccess;
888 } 888 }
889 case GetInfoType::IdleTickCount: {
890 if (handle == 0) {
891 LOG_ERROR(Kernel_SVC, "Thread handle does not exist, handle=0x{:08X}",
892 static_cast<Handle>(handle));
893 return ResultInvalidHandle;
894 }
889 895
896 if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id != system.CurrentCoreIndex()) {
897 LOG_ERROR(Kernel_SVC, "Core is not the current core, got {}", info_sub_id);
898 return ResultInvalidCombination;
899 }
900
901 const auto& scheduler = *system.Kernel().CurrentScheduler();
902 const auto* const idle_thread = scheduler.GetIdleThread();
903
904 *result = idle_thread->GetCpuTime();
905 return ResultSuccess;
906 }
890 default: 907 default:
891 LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); 908 LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id);
892 return ResultInvalidEnumValue; 909 return ResultInvalidEnumValue;
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 30025c790..2c6b24848 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -206,7 +206,7 @@ public:
206 return result; 206 return result;
207 } 207 }
208 208
209 ResultVal(const ResultVal& o) : result_code(o.result_code) { 209 ResultVal(const ResultVal& o) noexcept : result_code(o.result_code) {
210 if (!o.empty()) { 210 if (!o.empty()) {
211 new (&object) T(o.object); 211 new (&object) T(o.object);
212 } 212 }
@@ -224,7 +224,7 @@ public:
224 } 224 }
225 } 225 }
226 226
227 ResultVal& operator=(const ResultVal& o) { 227 ResultVal& operator=(const ResultVal& o) noexcept {
228 if (this == &o) { 228 if (this == &o) {
229 return *this; 229 return *this;
230 } 230 }
@@ -244,6 +244,26 @@ public:
244 return *this; 244 return *this;
245 } 245 }
246 246
247 ResultVal& operator=(ResultVal&& o) noexcept {
248 if (this == &o) {
249 return *this;
250 }
251 if (!empty()) {
252 if (!o.empty()) {
253 object = std::move(o.object);
254 } else {
255 object.~T();
256 }
257 } else {
258 if (!o.empty()) {
259 new (&object) T(std::move(o.object));
260 }
261 }
262 result_code = o.result_code;
263
264 return *this;
265 }
266
247 /** 267 /**
248 * Replaces the current result with a new constructed result value in-place. The code must not 268 * Replaces the current result with a new constructed result value in-place. The code must not
249 * be an error code. 269 * be an error code.
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 1e1d1d020..0764ea6e0 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -181,6 +181,21 @@ Device::Device() {
181 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); 181 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported");
182 shader_backend = Settings::ShaderBackend::GLSL; 182 shader_backend = Settings::ShaderBackend::GLSL;
183 } 183 }
184
185 if (shader_backend == Settings::ShaderBackend::GLSL && is_nvidia &&
186 !Settings::values.renderer_debug) {
187 const std::string_view driver_version = version.substr(13);
188 const int version_major =
189 std::atoi(driver_version.substr(0, driver_version.find(".")).data());
190
191 if (version_major >= 495) {
192 LOG_WARNING(Render_OpenGL, "NVIDIA drivers 495 and later causes significant problems "
193 "with yuzu. Forcing GLASM as a mitigation.");
194 shader_backend = Settings::ShaderBackend::GLASM;
195 use_assembly_shaders = true;
196 }
197 }
198
184 // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation. 199 // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation.
185 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && 200 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() &&
186 !(is_amd || (is_intel && !is_linux)); 201 !(is_amd || (is_intel && !is_linux));
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp
index 4fa0c4a43..642a5f966 100644
--- a/src/yuzu/configuration/configure_dialog.cpp
+++ b/src/yuzu/configuration/configure_dialog.cpp
@@ -81,8 +81,11 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
81 SetConfiguration(); 81 SetConfiguration();
82 PopulateSelectionList(); 82 PopulateSelectionList();
83 83
84 connect(ui->tabWidget, &QTabWidget::currentChanged, this, 84 connect(ui->tabWidget, &QTabWidget::currentChanged, this, [this](int index) {
85 [this]() { debug_tab_tab->SetCurrentIndex(0); }); 85 if (index != -1) {
86 debug_tab_tab->SetCurrentIndex(0);
87 }
88 });
86 connect(ui_tab.get(), &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged); 89 connect(ui_tab.get(), &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
87 connect(ui->selectorList, &QListWidget::itemSelectionChanged, this, 90 connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
88 &ConfigureDialog::UpdateVisibleTabs); 91 &ConfigureDialog::UpdateVisibleTabs);
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp
index 1031399e1..12699c126 100644
--- a/src/yuzu/configuration/configure_per_game.cpp
+++ b/src/yuzu/configuration/configure_per_game.cpp
@@ -66,7 +66,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::str
66 ui->tabWidget->addTab(system_tab.get(), tr("System")); 66 ui->tabWidget->addTab(system_tab.get(), tr("System"));
67 ui->tabWidget->addTab(cpu_tab.get(), tr("CPU")); 67 ui->tabWidget->addTab(cpu_tab.get(), tr("CPU"));
68 ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics")); 68 ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics"));
69 ui->tabWidget->addTab(graphics_advanced_tab.get(), tr("GraphicsAdvanced")); 69 ui->tabWidget->addTab(graphics_advanced_tab.get(), tr("Adv. Graphics"));
70 ui->tabWidget->addTab(audio_tab.get(), tr("Audio")); 70 ui->tabWidget->addTab(audio_tab.get(), tr("Audio"));
71 71
72 setFocusPolicy(Qt::ClickFocus); 72 setFocusPolicy(Qt::ClickFocus);
diff --git a/src/yuzu/configuration/configure_per_game.ui b/src/yuzu/configuration/configure_per_game.ui
index 60efdbf21..85c86e107 100644
--- a/src/yuzu/configuration/configure_per_game.ui
+++ b/src/yuzu/configuration/configure_per_game.ui
@@ -2,14 +2,6 @@
2<ui version="4.0"> 2<ui version="4.0">
3 <class>ConfigurePerGame</class> 3 <class>ConfigurePerGame</class>
4 <widget class="QDialog" name="ConfigurePerGame"> 4 <widget class="QDialog" name="ConfigurePerGame">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>900</width>
10 <height>630</height>
11 </rect>
12 </property>
13 <property name="minimumSize"> 5 <property name="minimumSize">
14 <size> 6 <size>
15 <width>900</width> 7 <width>900</width>