chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
2022-05-14 19:06:02 -05:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-08-24 21:15:38 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-02 18:48:45 -05:00
|
|
|
#include <functional>
|
2016-09-17 19:38:01 -05:00
|
|
|
#include <memory>
|
2023-05-18 22:05:21 -05:00
|
|
|
#include <type_traits>
|
2023-06-21 00:42:42 -05:00
|
|
|
#include <typeindex>
|
2020-01-21 13:40:53 -06:00
|
|
|
#include <vector>
|
2023-05-02 15:54:32 -05:00
|
|
|
#include <QColor>
|
2020-01-21 13:40:53 -06:00
|
|
|
#include <QString>
|
2016-09-20 10:21:23 -05:00
|
|
|
#include <QWidget>
|
2023-05-02 15:54:32 -05:00
|
|
|
#include <qobjectdefs.h>
|
2023-05-01 19:36:23 -05:00
|
|
|
#include <vulkan/vulkan_core.h>
|
2023-05-02 15:54:32 -05:00
|
|
|
#include "common/common_types.h"
|
2023-08-16 15:12:42 -05:00
|
|
|
#include "common/settings_enums.h"
|
2023-06-21 00:42:42 -05:00
|
|
|
#include "configuration/shared_translation.h"
|
2023-05-28 16:46:02 -05:00
|
|
|
#include "vk_device_info.h"
|
2023-05-05 22:30:59 -05:00
|
|
|
#include "yuzu/configuration/configuration_shared.h"
|
2023-05-02 15:54:32 -05:00
|
|
|
|
2023-05-08 21:37:03 -05:00
|
|
|
class QPushButton;
|
2023-05-02 15:54:32 -05:00
|
|
|
class QEvent;
|
|
|
|
class QObject;
|
2023-05-07 11:03:40 -05:00
|
|
|
class QComboBox;
|
2023-05-02 15:54:32 -05:00
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
enum class NvdecEmulation : u32;
|
|
|
|
enum class RendererBackend : u32;
|
|
|
|
enum class ShaderBackend : u32;
|
|
|
|
} // namespace Settings
|
2020-07-14 14:42:12 -05:00
|
|
|
|
2021-09-02 20:40:55 -05:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2016-08-24 21:15:38 -05:00
|
|
|
namespace Ui {
|
|
|
|
class ConfigureGraphics;
|
|
|
|
}
|
|
|
|
|
2023-06-21 00:42:42 -05:00
|
|
|
namespace ConfigurationShared {
|
|
|
|
class Builder;
|
|
|
|
}
|
|
|
|
|
2023-05-05 22:30:59 -05:00
|
|
|
class ConfigureGraphics : public ConfigurationShared::Tab {
|
2016-08-24 21:15:38 -05:00
|
|
|
public:
|
2023-08-16 15:12:42 -05:00
|
|
|
explicit ConfigureGraphics(
|
|
|
|
const Core::System& system_, std::vector<VkDeviceInfo::Record>& records,
|
|
|
|
const std::function<void()>& expose_compute_option,
|
|
|
|
const std::function<void(Settings::AspectRatio, Settings::ResolutionSetup)>&
|
|
|
|
update_aspect_ratio,
|
|
|
|
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
|
|
|
|
const ConfigurationShared::Builder& builder, QWidget* parent = nullptr);
|
2018-12-02 13:10:28 -06:00
|
|
|
~ConfigureGraphics() override;
|
2016-08-24 21:15:38 -05:00
|
|
|
|
2023-05-05 22:30:59 -05:00
|
|
|
void ApplyConfiguration() override;
|
|
|
|
void SetConfiguration() override;
|
2016-08-24 21:15:38 -05:00
|
|
|
|
|
|
|
private:
|
2019-06-05 17:39:46 -05:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
void RetranslateUI();
|
|
|
|
|
2023-06-21 00:42:42 -05:00
|
|
|
void Setup(const ConfigurationShared::Builder& builder);
|
2023-05-09 14:10:22 -05:00
|
|
|
|
2023-05-01 19:36:23 -05:00
|
|
|
void PopulateVSyncModeSelection();
|
2019-01-20 21:09:23 -06:00
|
|
|
void UpdateBackgroundColorButton(QColor color);
|
2021-07-08 16:28:48 -05:00
|
|
|
void UpdateAPILayout();
|
2020-01-21 13:40:53 -06:00
|
|
|
void UpdateDeviceSelection(int device);
|
2021-07-08 16:28:48 -05:00
|
|
|
void UpdateShaderBackendSelection(int backend);
|
2020-01-21 13:40:53 -06:00
|
|
|
|
2022-07-10 15:10:35 -05:00
|
|
|
void RetrieveVulkanDevices();
|
2020-01-21 13:40:53 -06:00
|
|
|
|
2023-05-01 19:36:23 -05:00
|
|
|
/* Turns a Vulkan present mode into a textual string for a UI
|
|
|
|
* (and eventually for a human to read) */
|
|
|
|
const QString TranslateVSyncMode(VkPresentModeKHR mode,
|
|
|
|
Settings::RendererBackend backend) const;
|
2022-11-19 18:04:04 -06:00
|
|
|
|
2020-01-21 13:40:53 -06:00
|
|
|
Settings::RendererBackend GetCurrentGraphicsBackend() const;
|
2019-01-20 21:09:23 -06:00
|
|
|
|
2023-06-21 20:41:15 -05:00
|
|
|
int FindIndex(u32 enumeration, int value) const;
|
2023-05-18 21:17:36 -05:00
|
|
|
|
2016-08-24 21:15:38 -05:00
|
|
|
std::unique_ptr<Ui::ConfigureGraphics> ui;
|
2018-09-08 18:57:19 -05:00
|
|
|
QColor bg_color;
|
2020-01-21 13:40:53 -06:00
|
|
|
|
2023-07-21 22:09:09 -05:00
|
|
|
std::vector<std::function<void(bool)>> apply_funcs{};
|
2020-07-14 12:55:47 -05:00
|
|
|
|
2023-05-28 16:46:02 -05:00
|
|
|
std::vector<VkDeviceInfo::Record>& records;
|
2020-01-21 13:40:53 -06:00
|
|
|
std::vector<QString> vulkan_devices;
|
2023-05-01 19:36:23 -05:00
|
|
|
std::vector<std::vector<VkPresentModeKHR>> device_present_modes;
|
|
|
|
std::vector<VkPresentModeKHR>
|
2023-06-09 15:53:26 -05:00
|
|
|
vsync_mode_combobox_enum_map{}; //< Keeps track of which present mode corresponds to which
|
|
|
|
// selection in the combobox
|
2020-01-21 13:40:53 -06:00
|
|
|
u32 vulkan_device{};
|
2021-07-08 16:28:48 -05:00
|
|
|
Settings::ShaderBackend shader_backend{};
|
2023-05-02 18:48:45 -05:00
|
|
|
const std::function<void()>& expose_compute_option;
|
2023-08-16 15:12:42 -05:00
|
|
|
const std::function<void(Settings::AspectRatio, Settings::ResolutionSetup)> update_aspect_ratio;
|
2021-09-02 20:40:55 -05:00
|
|
|
|
2021-07-30 09:07:32 -05:00
|
|
|
const Core::System& system;
|
2023-05-18 21:17:36 -05:00
|
|
|
const ConfigurationShared::ComboboxTranslationMap& combobox_translations;
|
|
|
|
const std::vector<std::pair<u32, QString>>& shader_mapping;
|
2023-05-07 11:03:40 -05:00
|
|
|
|
2023-05-08 13:11:45 -05:00
|
|
|
QPushButton* api_restore_global_button;
|
2023-05-07 11:03:40 -05:00
|
|
|
QComboBox* vulkan_device_combobox;
|
|
|
|
QComboBox* api_combobox;
|
|
|
|
QComboBox* shader_backend_combobox;
|
|
|
|
QComboBox* vsync_mode_combobox;
|
|
|
|
QWidget* vulkan_device_widget;
|
2023-05-08 09:04:44 -05:00
|
|
|
QWidget* api_widget;
|
2023-05-07 11:03:40 -05:00
|
|
|
QWidget* shader_backend_widget;
|
2023-08-16 15:12:42 -05:00
|
|
|
QComboBox* aspect_ratio_combobox;
|
|
|
|
QComboBox* resolution_combobox;
|
2016-08-24 21:15:38 -05:00
|
|
|
};
|