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-15 02:06:02 +02:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-08-25 04:15:38 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-03 01:48:45 +02:00
|
|
|
#include <functional>
|
2016-09-18 02:38:01 +02:00
|
|
|
#include <memory>
|
2020-01-21 20:40:53 +01:00
|
|
|
#include <vector>
|
2023-05-02 22:54:32 +02:00
|
|
|
#include <QColor>
|
2020-01-21 20:40:53 +01:00
|
|
|
#include <QString>
|
2016-09-20 17:21:23 +02:00
|
|
|
#include <QWidget>
|
2023-05-02 22:54:32 +02:00
|
|
|
#include <qobjectdefs.h>
|
2023-05-02 02:36:23 +02:00
|
|
|
#include <vulkan/vulkan_core.h>
|
2023-05-02 22:54:32 +02:00
|
|
|
#include "common/common_types.h"
|
2023-05-28 23:46:02 +02:00
|
|
|
#include "vk_device_info.h"
|
2023-05-06 05:30:59 +02:00
|
|
|
#include "yuzu/configuration/configuration_shared.h"
|
2023-05-02 22:54:32 +02:00
|
|
|
|
2023-05-09 04:37:03 +02:00
|
|
|
class QPushButton;
|
2023-05-02 22:54:32 +02:00
|
|
|
class QEvent;
|
|
|
|
class QObject;
|
2023-05-07 18:03:40 +02:00
|
|
|
class QComboBox;
|
2023-05-02 22:54:32 +02:00
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
enum class NvdecEmulation : u32;
|
|
|
|
enum class RendererBackend : u32;
|
|
|
|
enum class ShaderBackend : u32;
|
|
|
|
} // namespace Settings
|
2020-07-14 21:42:12 +02:00
|
|
|
|
2021-09-03 03:40:55 +02:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2016-08-25 04:15:38 +02:00
|
|
|
namespace Ui {
|
|
|
|
class ConfigureGraphics;
|
|
|
|
}
|
|
|
|
|
2023-05-06 05:30:59 +02:00
|
|
|
class ConfigureGraphics : public ConfigurationShared::Tab {
|
2016-08-25 04:15:38 +02:00
|
|
|
public:
|
2023-05-19 04:17:36 +02:00
|
|
|
explicit ConfigureGraphics(
|
|
|
|
const Core::System& system_, std::vector<VkDeviceInfo::Record>& records,
|
|
|
|
const std::function<void()>& expose_compute_option_,
|
|
|
|
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
|
|
|
|
const ConfigurationShared::TranslationMap& translations_,
|
|
|
|
const ConfigurationShared::ComboboxTranslationMap& combobox_translations_,
|
|
|
|
QWidget* parent = nullptr);
|
2018-12-02 20:10:28 +01:00
|
|
|
~ConfigureGraphics() override;
|
2016-08-25 04:15:38 +02:00
|
|
|
|
2023-05-06 05:30:59 +02:00
|
|
|
void ApplyConfiguration() override;
|
|
|
|
void SetConfiguration() override;
|
2016-08-25 04:15:38 +02:00
|
|
|
|
|
|
|
private:
|
2019-06-06 00:39:46 +02:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
void RetranslateUI();
|
|
|
|
|
2023-05-09 21:10:22 +02:00
|
|
|
void Setup();
|
|
|
|
|
2023-05-02 02:36:23 +02:00
|
|
|
void PopulateVSyncModeSelection();
|
2019-01-21 04:09:23 +01:00
|
|
|
void UpdateBackgroundColorButton(QColor color);
|
2021-07-08 23:28:48 +02:00
|
|
|
void UpdateAPILayout();
|
2020-01-21 20:40:53 +01:00
|
|
|
void UpdateDeviceSelection(int device);
|
2021-07-08 23:28:48 +02:00
|
|
|
void UpdateShaderBackendSelection(int backend);
|
2020-01-21 20:40:53 +01:00
|
|
|
|
2022-07-10 22:10:35 +02:00
|
|
|
void RetrieveVulkanDevices();
|
2020-01-21 20:40:53 +01:00
|
|
|
|
2023-05-02 02:36:23 +02: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-20 01:04:04 +01:00
|
|
|
|
2020-01-21 20:40:53 +01:00
|
|
|
Settings::RendererBackend GetCurrentGraphicsBackend() const;
|
2019-01-21 04:09:23 +01:00
|
|
|
|
2023-05-19 04:17:36 +02:00
|
|
|
int FindIndex(std::type_index enumeration, int value) const;
|
|
|
|
|
2016-08-25 04:15:38 +02:00
|
|
|
std::unique_ptr<Ui::ConfigureGraphics> ui;
|
2018-09-09 01:57:19 +02:00
|
|
|
QColor bg_color;
|
2020-01-21 20:40:53 +01:00
|
|
|
|
2023-05-07 18:03:40 +02:00
|
|
|
std::forward_list<std::function<void(bool)>> apply_funcs{};
|
2020-07-14 19:55:47 +02:00
|
|
|
|
2023-05-28 23:46:02 +02:00
|
|
|
std::vector<VkDeviceInfo::Record>& records;
|
2020-01-21 20:40:53 +01:00
|
|
|
std::vector<QString> vulkan_devices;
|
2023-05-02 02:36:23 +02:00
|
|
|
std::vector<std::vector<VkPresentModeKHR>> device_present_modes;
|
|
|
|
std::vector<VkPresentModeKHR>
|
2023-06-09 22:53:26 +02:00
|
|
|
vsync_mode_combobox_enum_map{}; //< Keeps track of which present mode corresponds to which
|
|
|
|
// selection in the combobox
|
2020-01-21 20:40:53 +01:00
|
|
|
u32 vulkan_device{};
|
2021-07-08 23:28:48 +02:00
|
|
|
Settings::ShaderBackend shader_backend{};
|
2023-05-03 01:48:45 +02:00
|
|
|
const std::function<void()>& expose_compute_option;
|
2021-09-03 03:40:55 +02:00
|
|
|
|
2021-07-30 16:07:32 +02:00
|
|
|
const Core::System& system;
|
2023-05-07 18:03:40 +02:00
|
|
|
const ConfigurationShared::TranslationMap& translations;
|
2023-05-19 04:17:36 +02:00
|
|
|
const ConfigurationShared::ComboboxTranslationMap& combobox_translations;
|
|
|
|
const std::vector<std::pair<u32, QString>>& shader_mapping;
|
2023-05-07 18:03:40 +02:00
|
|
|
|
2023-05-08 20:11:45 +02:00
|
|
|
QPushButton* api_restore_global_button;
|
2023-05-07 18:03:40 +02:00
|
|
|
QComboBox* vulkan_device_combobox;
|
|
|
|
QComboBox* api_combobox;
|
|
|
|
QComboBox* shader_backend_combobox;
|
|
|
|
QComboBox* vsync_mode_combobox;
|
|
|
|
QWidget* vulkan_device_widget;
|
2023-05-08 16:04:44 +02:00
|
|
|
QWidget* api_widget;
|
2023-05-07 18:03:40 +02:00
|
|
|
QWidget* shader_backend_widget;
|
2016-08-25 04:15:38 +02:00
|
|
|
};
|