suyu/src/yuzu/configuration/configure_graphics.h

105 lines
3.2 KiB
C++
Raw Normal View History

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
#pragma once
#include <functional>
#include <memory>
2023-05-19 05:05:21 +02:00
#include <type_traits>
#include <vector>
#include <QColor>
#include <QString>
#include <QWidget>
#include <qobjectdefs.h>
#include <vulkan/vulkan_core.h>
#include "common/common_types.h"
#include "vk_device_info.h"
#include "yuzu/configuration/configuration_shared.h"
2023-05-19 05:05:21 +02:00
#include "yuzu/configuration/shared_translation.h"
class QPushButton;
class QEvent;
class QObject;
class QComboBox;
namespace Settings {
enum class NvdecEmulation : u32;
enum class RendererBackend : u32;
enum class ShaderBackend : u32;
} // namespace Settings
namespace Core {
class System;
}
namespace Ui {
class ConfigureGraphics;
}
class ConfigureGraphics : public ConfigurationShared::Tab {
public:
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);
~ConfigureGraphics() override;
void ApplyConfiguration() override;
void SetConfiguration() override;
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void Setup();
void PopulateVSyncModeSelection();
void UpdateBackgroundColorButton(QColor color);
void UpdateAPILayout();
void UpdateDeviceSelection(int device);
void UpdateShaderBackendSelection(int backend);
2022-07-10 22:10:35 +02:00
void RetrieveVulkanDevices();
/* 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;
Settings::RendererBackend GetCurrentGraphicsBackend() const;
int FindIndex(std::type_index enumeration, int value) const;
std::unique_ptr<Ui::ConfigureGraphics> ui;
QColor bg_color;
std::forward_list<std::function<void(bool)>> apply_funcs{};
std::vector<VkDeviceInfo::Record>& records;
std::vector<QString> vulkan_devices;
std::vector<std::vector<VkPresentModeKHR>> device_present_modes;
std::vector<VkPresentModeKHR>
vsync_mode_combobox_enum_map{}; //< Keeps track of which present mode corresponds to which
// selection in the combobox
u32 vulkan_device{};
Settings::ShaderBackend shader_backend{};
const std::function<void()>& expose_compute_option;
const Core::System& system;
const ConfigurationShared::TranslationMap& translations;
const ConfigurationShared::ComboboxTranslationMap& combobox_translations;
const std::vector<std::pair<u32, QString>>& shader_mapping;
QPushButton* api_restore_global_button;
QComboBox* vulkan_device_combobox;
QComboBox* api_combobox;
QComboBox* shader_backend_combobox;
QComboBox* vsync_mode_combobox;
QWidget* vulkan_device_widget;
QWidget* api_widget;
QWidget* shader_backend_widget;
};