summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-03-16 23:10:22 +1000
committerStenzek <stenzek@gmail.com>2018-03-26 01:57:41 +1000
commit2f1a7cbee1ffecdd25ebc206ceab55ef934b7256 (patch)
tree1cbf78b64fbf293ede3a9bd47e586a0d4bb03a6b /Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
parent5c83e18fbd3606587e71a7f1cc54e4cf6473609f (diff)
Implement "Skip" ubershader mode
Skip ubershader mode works the same as hybrid ubershaders in that the shaders are compiled asynchronously. However, instead of using the ubershader to draw the object, it skips it entirely until the specialized shader is made available. This mode will likely result in broken effects where a game creates an EFB copy, and does not redraw it every frame. Therefore, it is not a recommended option, however, it may result in better performance on low-end systems.
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
new file mode 100644
index 0000000000..c8f87a548b
--- /dev/null
+++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
@@ -0,0 +1,24 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "DolphinQt2/Config/Graphics/GraphicsRadio.h"
+
+#include "Common/Config/Config.h"
+#include "DolphinQt2/Settings.h"
+
+GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::ConfigInfo<int>& setting,
+ int value)
+ : QRadioButton(label), m_setting(setting), m_value(value)
+{
+ setChecked(Config::Get(m_setting) == m_value);
+ connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
+}
+
+void GraphicsRadioInt::Update()
+{
+ if (!isChecked())
+ return;
+
+ Config::SetBaseOrCurrent(m_setting, m_value);
+}