14 changed files with 251 additions and 17 deletions
-
1src/common/settings.cpp
-
11src/common/settings.h
-
1src/common/settings_common.h
-
2src/frontend_common/config.cpp
-
11src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
-
1src/yuzu/CMakeLists.txt
-
29src/yuzu/configuration/configure_dialog.cpp
-
2src/yuzu/configuration/configure_dialog.h
-
71src/yuzu/configuration/configure_graphics_extensions.cpp
-
45src/yuzu/configuration/configure_graphics_extensions.h
-
68src/yuzu/configuration/configure_graphics_extensions.ui
-
4src/yuzu/configuration/configure_per_game.cpp
-
2src/yuzu/configuration/configure_per_game.h
-
20src/yuzu/configuration/shared_translation.cpp
@ -0,0 +1,71 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
|
||||
|
#include <vector>
|
||||
|
#include <QLabel>
|
||||
|
#include <qnamespace.h>
|
||||
|
#include "common/settings.h"
|
||||
|
#include "core/core.h"
|
||||
|
#include "ui_configure_graphics_extensions.h"
|
||||
|
#include "yuzu/configuration/configuration_shared.h"
|
||||
|
#include "yuzu/configuration/configure_graphics_extensions.h"
|
||||
|
#include "yuzu/configuration/shared_translation.h"
|
||||
|
#include "yuzu/configuration/shared_widget.h"
|
||||
|
|
||||
|
ConfigureGraphicsExtensions::ConfigureGraphicsExtensions( |
||||
|
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_, |
||||
|
const ConfigurationShared::Builder& builder, QWidget* parent) |
||||
|
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsExtensions>()}, system{system_} { |
||||
|
|
||||
|
ui->setupUi(this); |
||||
|
|
||||
|
Setup(builder); |
||||
|
|
||||
|
SetConfiguration(); |
||||
|
} |
||||
|
|
||||
|
ConfigureGraphicsExtensions::~ConfigureGraphicsExtensions() = default; |
||||
|
|
||||
|
void ConfigureGraphicsExtensions::SetConfiguration() {} |
||||
|
|
||||
|
void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& builder) { |
||||
|
auto& layout = *ui->populate_target->layout(); |
||||
|
std::map<u32, QWidget*> hold{}; // A map will sort the data for us
|
||||
|
|
||||
|
for (auto setting : |
||||
|
Settings::values.linkage.by_category[Settings::Category::RendererExtensions]) { |
||||
|
ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs); |
||||
|
|
||||
|
if (widget == nullptr) { |
||||
|
continue; |
||||
|
} |
||||
|
if (!widget->Valid()) { |
||||
|
widget->deleteLater(); |
||||
|
continue; |
||||
|
} |
||||
|
|
||||
|
hold.emplace(setting->Id(), widget); |
||||
|
} |
||||
|
for (const auto& [id, widget] : hold) { |
||||
|
layout.addWidget(widget); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void ConfigureGraphicsExtensions::ApplyConfiguration() { |
||||
|
const bool is_powered_on = system.IsPoweredOn(); |
||||
|
for (const auto& func : apply_funcs) { |
||||
|
func(is_powered_on); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void ConfigureGraphicsExtensions::changeEvent(QEvent* event) { |
||||
|
if (event->type() == QEvent::LanguageChange) { |
||||
|
RetranslateUI(); |
||||
|
} |
||||
|
|
||||
|
QWidget::changeEvent(event); |
||||
|
} |
||||
|
|
||||
|
void ConfigureGraphicsExtensions::RetranslateUI() { |
||||
|
ui->retranslateUi(this); |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-2.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <memory> |
||||
|
#include <vector> |
||||
|
#include <QWidget> |
||||
|
#include "yuzu/configuration/configuration_shared.h" |
||||
|
|
||||
|
namespace Core { |
||||
|
class System; |
||||
|
} |
||||
|
|
||||
|
namespace Ui { |
||||
|
class ConfigureGraphicsExtensions; |
||||
|
} |
||||
|
|
||||
|
namespace ConfigurationShared { |
||||
|
class Builder; |
||||
|
} |
||||
|
|
||||
|
class ConfigureGraphicsExtensions : public ConfigurationShared::Tab { |
||||
|
Q_OBJECT |
||||
|
|
||||
|
public: |
||||
|
explicit ConfigureGraphicsExtensions( |
||||
|
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group, |
||||
|
const ConfigurationShared::Builder& builder, QWidget* parent = nullptr); |
||||
|
~ConfigureGraphicsExtensions() override; |
||||
|
|
||||
|
void ApplyConfiguration() override; |
||||
|
void SetConfiguration() override; |
||||
|
|
||||
|
private: |
||||
|
void Setup(const ConfigurationShared::Builder& builder); |
||||
|
void changeEvent(QEvent* event) override; |
||||
|
void RetranslateUI(); |
||||
|
|
||||
|
std::unique_ptr<Ui::ConfigureGraphicsExtensions> ui; |
||||
|
|
||||
|
const Core::System& system; |
||||
|
|
||||
|
std::vector<std::function<void(bool)>> apply_funcs; |
||||
|
}; |
||||
@ -0,0 +1,68 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<ui version="4.0"> |
||||
|
<class>ConfigureGraphicsExtensions</class> |
||||
|
<widget class="QWidget" name="ConfigureGraphicsExtensions"> |
||||
|
<property name="geometry"> |
||||
|
<rect> |
||||
|
<x>0</x> |
||||
|
<y>0</y> |
||||
|
<width>404</width> |
||||
|
<height>376</height> |
||||
|
</rect> |
||||
|
</property> |
||||
|
<property name="windowTitle"> |
||||
|
<string>Form</string> |
||||
|
</property> |
||||
|
<property name="accessibleName"> |
||||
|
<string>Extensions</string> |
||||
|
</property> |
||||
|
<layout class="QVBoxLayout" name="verticalLayout_1"> |
||||
|
<item> |
||||
|
<layout class="QVBoxLayout" name="verticalLayout_2"> |
||||
|
<item> |
||||
|
<widget class="QGroupBox" name="groupBox_1"> |
||||
|
<property name="title"> |
||||
|
<string>Vulkan Extension Settings</string> |
||||
|
</property> |
||||
|
<layout class="QVBoxLayout" name="verticalLayout_3"> |
||||
|
<item> |
||||
|
<widget class="QWidget" name="populate_target" native="true"> |
||||
|
<layout class="QVBoxLayout" name="verticalLayout"> |
||||
|
<property name="leftMargin"> |
||||
|
<number>0</number> |
||||
|
</property> |
||||
|
<property name="topMargin"> |
||||
|
<number>0</number> |
||||
|
</property> |
||||
|
<property name="rightMargin"> |
||||
|
<number>0</number> |
||||
|
</property> |
||||
|
<property name="bottomMargin"> |
||||
|
<number>0</number> |
||||
|
</property> |
||||
|
</layout> |
||||
|
</widget> |
||||
|
</item> |
||||
|
</layout> |
||||
|
</widget> |
||||
|
</item> |
||||
|
</layout> |
||||
|
</item> |
||||
|
<item> |
||||
|
<spacer name="verticalSpacer"> |
||||
|
<property name="orientation"> |
||||
|
<enum>Qt::Orientation::Vertical</enum> |
||||
|
</property> |
||||
|
<property name="sizeHint" stdset="0"> |
||||
|
<size> |
||||
|
<width>20</width> |
||||
|
<height>40</height> |
||||
|
</size> |
||||
|
</property> |
||||
|
</spacer> |
||||
|
</item> |
||||
|
</layout> |
||||
|
</widget> |
||||
|
<resources/> |
||||
|
<connections/> |
||||
|
</ui> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue