Author SHA1 Message Date
PabloMK7 10df158dc6 Fix clang format. 2024-01-30 14:24:04 +01:00
PabloMK7 a110843115 Add log regex filter 2024-01-30 14:07:01 +01:00
Steveice10andGitHub 469f76b075 qt: Display OpenGL renderer name and add Mesa override to support Windows OpenGLOn12. (#7395) 2024-01-29 12:24:41 -08:00
SachinVinandGitHub 7a4854c519 shader_setup.h: Initialise program_code (#7396) 2024-01-28 06:02:40 -08:00
Steveice10andGitHub d1e3dddf6a core: Fix invalid log formatting in ARM interpreter. (#7391) 2024-01-27 00:39:27 -08:00
Charles LombardoandGitHub 265e8193b9 Merge pull request #7392 from amwatson/patch-1
[SettingsFragmentPresenter.kt] correct RESOLUTION_FACTOR key/default
2024-01-26 22:43:04 -05:00
Amanda WatsonandGitHub e8c20fa782 [SettingsFragmentPresenter.kt] set RESOLUTION_FACTOR preference with RESOLUTION_FACTOR setting instead of GRAPHICS_API
Currently, the RESOLUTION_FACTOR preference is being set with the GRAPHICS_API key and default. Therefore, it will set/retrieve the wrong values

This revision updates the RESOLUTION_FACTOR preference to use the RESOLUTION_FACTOR key and default value. As a result, RESOLUTION_FACTOR and GRAPHICS_API should store and return the correct (separate) values
2024-01-26 19:14:27 -06:00
PabloMK7andGitHub 95ae46f6a8 SOC_U: Account for variable CTRSockAddr size (#7387)
* SOC_U: Account for variable CTRSockAddr size.

* Apply suggestions
2024-01-26 08:00:19 -08:00
Steveice10andGitHub 41fe75acb7 renderer_vulkan: Pass physical device API version to VMA instead of instance version. (#7390) 2024-01-26 16:34:12 +02:00
27 changed files with 198 additions and 94 deletions
@@ -687,8 +687,8 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
1, 1,
10, 10,
"x", "x",
IntSetting.GRAPHICS_API.key, IntSetting.RESOLUTION_FACTOR.key,
IntSetting.GRAPHICS_API.defaultValue.toFloat() IntSetting.RESOLUTION_FACTOR.defaultValue.toFloat()
) )
) )
add( add(
+2
View File
@@ -244,12 +244,14 @@ void Config::ReadValues() {
// Miscellaneous // Miscellaneous
ReadSetting("Miscellaneous", Settings::values.log_filter); ReadSetting("Miscellaneous", Settings::values.log_filter);
ReadSetting("Miscellaneous", Settings::values.log_regex_filter);
// Apply the log_filter setting as the logger has already been initialized // Apply the log_filter setting as the logger has already been initialized
// and doesn't pick up the filter on its own. // and doesn't pick up the filter on its own.
Common::Log::Filter filter; Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue()); filter.ParseFilterString(Settings::values.log_filter.GetValue());
Common::Log::SetGlobalFilter(filter); Common::Log::SetGlobalFilter(filter);
Common::Log::SetRegexFilter(Settings::values.log_regex_filter.GetValue());
// Debugging // Debugging
Settings::values.record_frame_times = Settings::values.record_frame_times =
+2
View File
@@ -306,12 +306,14 @@ void Config::ReadValues() {
// Miscellaneous // Miscellaneous
ReadSetting("Miscellaneous", Settings::values.log_filter); ReadSetting("Miscellaneous", Settings::values.log_filter);
ReadSetting("Miscellaneous", Settings::values.log_regex_filter);
// Apply the log_filter setting as the logger has already been initialized // Apply the log_filter setting as the logger has already been initialized
// and doesn't pick up the filter on its own. // and doesn't pick up the filter on its own.
Common::Log::Filter filter; Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue()); filter.ParseFilterString(Settings::values.log_filter.GetValue());
Common::Log::SetGlobalFilter(filter); Common::Log::SetGlobalFilter(filter);
Common::Log::SetRegexFilter(Settings::values.log_regex_filter.GetValue());
// Debugging // Debugging
Settings::values.record_frame_times = Settings::values.record_frame_times =
+2 -7
View File
@@ -179,6 +179,8 @@ add_executable(citra-qt
qt_image_interface.h qt_image_interface.h
util/clickable_label.cpp util/clickable_label.cpp
util/clickable_label.h util/clickable_label.h
util/graphics_device_info.cpp
util/graphics_device_info.h
util/sequence_dialog/sequence_dialog.cpp util/sequence_dialog/sequence_dialog.cpp
util/sequence_dialog/sequence_dialog.h util/sequence_dialog/sequence_dialog.h
util/spinbox.cpp util/spinbox.cpp
@@ -187,13 +189,6 @@ add_executable(citra-qt
util/util.h util/util.h
) )
if (ENABLE_VULKAN)
target_sources(citra-qt PRIVATE
util/vk_device_info.cpp
util/vk_device_info.h
)
endif()
file(GLOB COMPAT_LIST file(GLOB COMPAT_LIST
${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json) ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
+2
View File
@@ -531,6 +531,7 @@ void Config::ReadMiscellaneousValues() {
qt_config->beginGroup(QStringLiteral("Miscellaneous")); qt_config->beginGroup(QStringLiteral("Miscellaneous"));
ReadBasicSetting(Settings::values.log_filter); ReadBasicSetting(Settings::values.log_filter);
ReadBasicSetting(Settings::values.log_regex_filter);
ReadBasicSetting(Settings::values.enable_gamemode); ReadBasicSetting(Settings::values.enable_gamemode);
qt_config->endGroup(); qt_config->endGroup();
@@ -1054,6 +1055,7 @@ void Config::SaveMiscellaneousValues() {
qt_config->beginGroup(QStringLiteral("Miscellaneous")); qt_config->beginGroup(QStringLiteral("Miscellaneous"));
WriteBasicSetting(Settings::values.log_filter); WriteBasicSetting(Settings::values.log_filter);
WriteBasicSetting(Settings::values.log_regex_filter);
WriteBasicSetting(Settings::values.enable_gamemode); WriteBasicSetting(Settings::values.enable_gamemode);
qt_config->endGroup(); qt_config->endGroup();
@@ -97,6 +97,8 @@ void ConfigureDebug::SetConfiguration() {
ui->toggle_console->setEnabled(!is_powered_on); ui->toggle_console->setEnabled(!is_powered_on);
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue()); ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());
ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter.GetValue())); ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter.GetValue()));
ui->log_regex_filter_edit->setText(
QString::fromStdString(Settings::values.log_regex_filter.GetValue()));
ui->toggle_cpu_jit->setChecked(Settings::values.use_cpu_jit.GetValue()); ui->toggle_cpu_jit->setChecked(Settings::values.use_cpu_jit.GetValue());
ui->delay_start_for_lle_modules->setChecked( ui->delay_start_for_lle_modules->setChecked(
Settings::values.delay_start_for_lle_modules.GetValue()); Settings::values.delay_start_for_lle_modules.GetValue());
@@ -126,10 +128,12 @@ void ConfigureDebug::ApplyConfiguration() {
Settings::values.gdbstub_port = ui->gdbport_spinbox->value(); Settings::values.gdbstub_port = ui->gdbport_spinbox->value();
UISettings::values.show_console = ui->toggle_console->isChecked(); UISettings::values.show_console = ui->toggle_console->isChecked();
Settings::values.log_filter = ui->log_filter_edit->text().toStdString(); Settings::values.log_filter = ui->log_filter_edit->text().toStdString();
Settings::values.log_regex_filter = ui->log_regex_filter_edit->text().toStdString();
Debugger::ToggleConsole(); Debugger::ToggleConsole();
Common::Log::Filter filter; Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue()); filter.ParseFilterString(Settings::values.log_filter.GetValue());
Common::Log::SetGlobalFilter(filter); Common::Log::SetGlobalFilter(filter);
Common::Log::SetRegexFilter(Settings::values.log_regex_filter.GetValue());
Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked(); Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked();
Settings::values.delay_start_for_lle_modules = ui->delay_start_for_lle_modules->isChecked(); Settings::values.delay_start_for_lle_modules = ui->delay_start_for_lle_modules->isChecked();
Settings::values.renderer_debug = ui->toggle_renderer_debug->isChecked(); Settings::values.renderer_debug = ui->toggle_renderer_debug->isChecked();
@@ -85,6 +85,20 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Regex Log Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="log_regex_filter_edit"/>
</item>
</layout>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@@ -23,14 +23,16 @@
#include "ui_configure.h" #include "ui_configure.h"
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Core::System& system_, ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Core::System& system_,
std::span<const QString> physical_devices, bool enable_web_config) QString gl_renderer, std::span<const QString> physical_devices,
bool enable_web_config)
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_}, : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_},
system{system_}, is_powered_on{system.IsPoweredOn()}, system{system_}, is_powered_on{system.IsPoweredOn()},
general_tab{std::make_unique<ConfigureGeneral>(this)}, general_tab{std::make_unique<ConfigureGeneral>(this)},
system_tab{std::make_unique<ConfigureSystem>(system, this)}, system_tab{std::make_unique<ConfigureSystem>(system, this)},
input_tab{std::make_unique<ConfigureInput>(this)}, input_tab{std::make_unique<ConfigureInput>(this)},
hotkeys_tab{std::make_unique<ConfigureHotkeys>(this)}, hotkeys_tab{std::make_unique<ConfigureHotkeys>(this)},
graphics_tab{std::make_unique<ConfigureGraphics>(physical_devices, is_powered_on, this)}, graphics_tab{
std::make_unique<ConfigureGraphics>(gl_renderer, physical_devices, is_powered_on, this)},
enhancements_tab{std::make_unique<ConfigureEnhancements>(this)}, enhancements_tab{std::make_unique<ConfigureEnhancements>(this)},
audio_tab{std::make_unique<ConfigureAudio>(is_powered_on, this)}, audio_tab{std::make_unique<ConfigureAudio>(is_powered_on, this)},
camera_tab{std::make_unique<ConfigureCamera>(this)}, camera_tab{std::make_unique<ConfigureCamera>(this)},
@@ -37,7 +37,7 @@ class ConfigureDialog : public QDialog {
public: public:
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, Core::System& system, explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, Core::System& system,
std::span<const QString> physical_devices, QString gl_renderer, std::span<const QString> physical_devices,
bool enable_web_config = true); bool enable_web_config = true);
~ConfigureDialog() override; ~ConfigureDialog() override;
@@ -12,17 +12,13 @@
#include "video_core/renderer_vulkan/vk_instance.h" #include "video_core/renderer_vulkan/vk_instance.h"
#endif #endif
ConfigureGraphics::ConfigureGraphics(std::span<const QString> physical_devices, bool is_powered_on, ConfigureGraphics::ConfigureGraphics(QString gl_renderer, std::span<const QString> physical_devices,
QWidget* parent) bool is_powered_on, QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureGraphics>()) { : QWidget(parent), ui(std::make_unique<Ui::ConfigureGraphics>()) {
ui->setupUi(this); ui->setupUi(this);
SetupPerGameUI(); SetupPerGameUI();
for (const QString& name : physical_devices) {
ui->physical_device_combo->addItem(name);
}
ui->graphics_api_combo->setEnabled(!is_powered_on); ui->graphics_api_combo->setEnabled(!is_powered_on);
ui->physical_device_combo->setEnabled(!is_powered_on); ui->physical_device_combo->setEnabled(!is_powered_on);
ui->toggle_async_shaders->setEnabled(!is_powered_on); ui->toggle_async_shaders->setEnabled(!is_powered_on);
@@ -37,11 +33,15 @@ ConfigureGraphics::ConfigureGraphics(std::span<const QString> physical_devices,
graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::Software)); graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::Software));
software_item->setFlags(software_item->flags() & ~Qt::ItemIsEnabled); software_item->setFlags(software_item->flags() & ~Qt::ItemIsEnabled);
#endif #endif
#ifndef ENABLE_OPENGL #ifndef ENABLE_OPENGL
const auto opengl_item = const auto opengl_item =
graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::OpenGL)); graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::OpenGL));
opengl_item->setFlags(opengl_item->flags() & ~Qt::ItemIsEnabled); opengl_item->setFlags(opengl_item->flags() & ~Qt::ItemIsEnabled);
#else
ui->opengl_renderer_name_label->setText(gl_renderer);
#endif #endif
#ifndef ENABLE_VULKAN #ifndef ENABLE_VULKAN
const auto vulkan_item = const auto vulkan_item =
graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::Vulkan)); graphics_api_combo_model->item(static_cast<u32>(Settings::GraphicsAPI::Vulkan));
@@ -54,6 +54,10 @@ ConfigureGraphics::ConfigureGraphics(std::span<const QString> physical_devices,
ui->physical_device_combo->setVisible(false); ui->physical_device_combo->setVisible(false);
ui->spirv_shader_gen->setVisible(false); ui->spirv_shader_gen->setVisible(false);
} else {
for (const QString& name : physical_devices) {
ui->physical_device_combo->addItem(name);
}
} }
#endif #endif
@@ -202,24 +206,24 @@ void ConfigureGraphics::SetupPerGameUI() {
} }
void ConfigureGraphics::SetPhysicalDeviceComboVisibility(int index) { void ConfigureGraphics::SetPhysicalDeviceComboVisibility(int index) {
bool is_visible{}; Settings::GraphicsAPI effective_api{};
// When configuring per-game the physical device combo should be // When configuring per-game the physical device combo should be
// shown either when the global api is used and that is Vulkan or // shown either when the global api is used and that is Vulkan or
// Vulkan is set as the per-game api. // Vulkan is set as the per-game api.
if (!Settings::IsConfiguringGlobal()) { if (!Settings::IsConfiguringGlobal()) {
const auto global_graphics_api = Settings::values.graphics_api.GetValue(true);
const bool using_global = index == 0; const bool using_global = index == 0;
if (!using_global) { if (using_global) {
index -= ConfigurationShared::USE_GLOBAL_OFFSET; effective_api = Settings::values.graphics_api.GetValue(true);
} else {
effective_api =
static_cast<Settings::GraphicsAPI>(index - ConfigurationShared::USE_GLOBAL_OFFSET);
} }
const auto graphics_api = static_cast<Settings::GraphicsAPI>(index);
is_visible = (using_global && global_graphics_api == Settings::GraphicsAPI::Vulkan) ||
graphics_api == Settings::GraphicsAPI::Vulkan;
} else { } else {
const auto graphics_api = static_cast<Settings::GraphicsAPI>(index); effective_api = static_cast<Settings::GraphicsAPI>(index);
is_visible = graphics_api == Settings::GraphicsAPI::Vulkan;
} }
ui->physical_device_group->setVisible(is_visible);
ui->spirv_shader_gen->setVisible(is_visible); ui->physical_device_group->setVisible(effective_api == Settings::GraphicsAPI::Vulkan);
ui->spirv_shader_gen->setVisible(effective_api == Settings::GraphicsAPI::Vulkan);
ui->opengl_renderer_group->setVisible(effective_api == Settings::GraphicsAPI::OpenGL);
} }
@@ -21,8 +21,8 @@ class ConfigureGraphics : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit ConfigureGraphics(std::span<const QString> physical_devices, bool is_powered_on, explicit ConfigureGraphics(QString gl_renderer, std::span<const QString> physical_devices,
QWidget* parent = nullptr); bool is_powered_on, QWidget* parent = nullptr);
~ConfigureGraphics() override; ~ConfigureGraphics() override;
void ApplyConfiguration(); void ApplyConfiguration();
@@ -101,6 +101,34 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QWidget" name="opengl_renderer_group" native="true">
<layout class="QHBoxLayout" name="opengl_renderer_group_2">
<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>
<item>
<widget class="QLabel" name="opengl_renderer_label">
<property name="text">
<string>OpenGL Renderer</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="opengl_renderer_name_label"/>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="spirv_shader_gen"> <widget class="QCheckBox" name="spirv_shader_gen">
<property name="text"> <property name="text">
@@ -24,7 +24,8 @@
#include "ui_configure_per_game.h" #include "ui_configure_per_game.h"
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString& file_name, ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString& file_name,
std::span<const QString> physical_devices, Core::System& system_) QString gl_renderer, std::span<const QString> physical_devices,
Core::System& system_)
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()),
filename{file_name.toStdString()}, title_id{title_id_}, system{system_} { filename{file_name.toStdString()}, title_id{title_id_}, system{system_} {
const auto config_file_name = title_id == 0 ? std::string(FileUtil::GetFilename(filename)) const auto config_file_name = title_id == 0 ? std::string(FileUtil::GetFilename(filename))
@@ -35,7 +36,8 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString
audio_tab = std::make_unique<ConfigureAudio>(is_powered_on, this); audio_tab = std::make_unique<ConfigureAudio>(is_powered_on, this);
general_tab = std::make_unique<ConfigureGeneral>(this); general_tab = std::make_unique<ConfigureGeneral>(this);
enhancements_tab = std::make_unique<ConfigureEnhancements>(this); enhancements_tab = std::make_unique<ConfigureEnhancements>(this);
graphics_tab = std::make_unique<ConfigureGraphics>(physical_devices, is_powered_on, this); graphics_tab =
std::make_unique<ConfigureGraphics>(gl_renderer, physical_devices, is_powered_on, this);
system_tab = std::make_unique<ConfigureSystem>(system, this); system_tab = std::make_unique<ConfigureSystem>(system, this);
debug_tab = std::make_unique<ConfigureDebug>(is_powered_on, this); debug_tab = std::make_unique<ConfigureDebug>(is_powered_on, this);
cheat_tab = std::make_unique<ConfigureCheats>(system.CheatEngine(), title_id, this); cheat_tab = std::make_unique<ConfigureCheats>(system.CheatEngine(), title_id, this);
@@ -38,7 +38,8 @@ class ConfigurePerGame : public QDialog {
public: public:
explicit ConfigurePerGame(QWidget* parent, u64 title_id_, const QString& file_name, explicit ConfigurePerGame(QWidget* parent, u64 title_id_, const QString& file_name,
std::span<const QString> physical_devices, Core::System& system_); QString gl_renderer, std::span<const QString> physical_devices,
Core::System& system_);
~ConfigurePerGame() override; ~ConfigurePerGame() override;
/// Loads all button configurations to settings file /// Loads all button configurations to settings file
+15 -3
View File
@@ -64,7 +64,7 @@
#include "citra_qt/uisettings.h" #include "citra_qt/uisettings.h"
#include "citra_qt/updater/updater.h" #include "citra_qt/updater/updater.h"
#include "citra_qt/util/clickable_label.h" #include "citra_qt/util/clickable_label.h"
#include "citra_qt/util/vk_device_info.h" #include "citra_qt/util/graphics_device_info.h"
#include "common/arch.h" #include "common/arch.h"
#include "common/common_paths.h" #include "common/common_paths.h"
#include "common/detached_tasks.h" #include "common/detached_tasks.h"
@@ -270,6 +270,18 @@ GMainWindow::GMainWindow(Core::System& system_)
connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor); connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor);
connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::OnMouseActivity); connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::OnMouseActivity);
#ifdef ENABLE_OPENGL
gl_renderer = GetOpenGLRenderer();
#if defined(_WIN32)
if (gl_renderer.startsWith(QStringLiteral("D3D12"))) {
// OpenGLOn12 supports but does not yet advertise OpenGL 4.0+
// We can override the version here to allow Citra to work.
// TODO: Remove this when OpenGL 4.0+ is advertised.
qputenv("MESA_GL_VERSION_OVERRIDE", "4.6");
}
#endif
#endif
#ifdef ENABLE_VULKAN #ifdef ENABLE_VULKAN
physical_devices = GetVulkanPhysicalDevices(); physical_devices = GetVulkanPhysicalDevices();
if (physical_devices.empty()) { if (physical_devices.empty()) {
@@ -2158,7 +2170,7 @@ void GMainWindow::OnLoadState() {
void GMainWindow::OnConfigure() { void GMainWindow::OnConfigure() {
game_list->SetDirectoryWatcherEnabled(false); game_list->SetDirectoryWatcherEnabled(false);
Settings::SetConfiguringGlobal(true); Settings::SetConfiguringGlobal(true);
ConfigureDialog configureDialog(this, hotkey_registry, system, physical_devices, ConfigureDialog configureDialog(this, hotkey_registry, system, gl_renderer, physical_devices,
!multiplayer_state->IsHostingPublicRoom()); !multiplayer_state->IsHostingPublicRoom());
connect(&configureDialog, &ConfigureDialog::LanguageChanged, this, connect(&configureDialog, &ConfigureDialog::LanguageChanged, this,
&GMainWindow::OnLanguageChanged); &GMainWindow::OnLanguageChanged);
@@ -3006,7 +3018,7 @@ void GMainWindow::OnConfigurePerGame() {
void GMainWindow::OpenPerGameConfiguration(u64 title_id, const QString& file_name) { void GMainWindow::OpenPerGameConfiguration(u64 title_id, const QString& file_name) {
Settings::SetConfiguringGlobal(false); Settings::SetConfiguringGlobal(false);
ConfigurePerGame dialog(this, title_id, file_name, physical_devices, system); ConfigurePerGame dialog(this, title_id, file_name, gl_renderer, physical_devices, system);
const auto result = dialog.exec(); const auto result = dialog.exec();
if (result != QDialog::Accepted) { if (result != QDialog::Accepted) {
+1
View File
@@ -344,6 +344,7 @@ private:
// Whether game was paused due to stopping video dumping // Whether game was paused due to stopping video dumping
bool game_paused_for_dumping = false; bool game_paused_for_dumping = false;
QString gl_renderer;
std::vector<QString> physical_devices; std::vector<QString> physical_devices;
// Debugger panes // Debugger panes
@@ -2,9 +2,34 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "citra_qt/util/vk_device_info.h" #include "citra_qt/util/graphics_device_info.h"
#include "video_core/renderer_vulkan/vk_instance.h"
#ifdef ENABLE_OPENGL
#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
#endif
#ifdef ENABLE_VULKAN
#include "video_core/renderer_vulkan/vk_instance.h"
#endif
#ifdef ENABLE_OPENGL
QString GetOpenGLRenderer() {
QOffscreenSurface surface;
surface.create();
QOpenGLContext context;
if (context.create()) {
context.makeCurrent(&surface);
return QString::fromUtf8(context.functions()->glGetString(GL_RENDERER));
} else {
return QStringLiteral("");
}
}
#endif
#ifdef ENABLE_VULKAN
std::vector<QString> GetVulkanPhysicalDevices() { std::vector<QString> GetVulkanPhysicalDevices() {
std::vector<QString> result; std::vector<QString> result;
try { try {
@@ -21,3 +46,4 @@ std::vector<QString> GetVulkanPhysicalDevices() {
return result; return result;
} }
#endif
@@ -7,5 +7,12 @@
#include <vector> #include <vector>
#include <QString> #include <QString>
#ifdef ENABLE_OPENGL
/// Returns the name of the OpenGL renderer.
QString GetOpenGLRenderer();
#endif
#ifdef ENABLE_VULKAN
/// Returns a list of all available vulkan GPUs. /// Returns a list of all available vulkan GPUs.
std::vector<QString> GetVulkanPhysicalDevices(); std::vector<QString> GetVulkanPhysicalDevices();
#endif
+26 -2
View File
@@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <chrono> #include <chrono>
#include <boost/regex.hpp>
#include <fmt/format.h> #include <fmt/format.h>
@@ -234,6 +235,19 @@ public:
filter = f; filter = f;
} }
bool SetRegexFilter(const std::string& regex) {
if (regex.empty()) {
regex_filter = boost::regex();
return true;
}
regex_filter = boost::regex(regex, boost::regex_constants::no_except);
if (regex_filter.status() != 0) {
regex_filter = boost::regex();
return false;
}
return true;
}
void SetColorConsoleBackendEnabled(bool enabled) { void SetColorConsoleBackendEnabled(bool enabled) {
color_console_backend.SetEnabled(enabled); color_console_backend.SetEnabled(enabled);
} }
@@ -243,8 +257,13 @@ public:
if (!filter.CheckMessage(log_class, log_level)) { if (!filter.CheckMessage(log_class, log_level)) {
return; return;
} }
message_queue.EmplaceWait( Entry new_entry =
CreateEntry(log_class, log_level, filename, line_num, function, std::move(message))); CreateEntry(log_class, log_level, filename, line_num, function, std::move(message));
if (!regex_filter.empty() &&
!boost::regex_search(FormatLogMessage(new_entry), regex_filter)) {
return;
}
message_queue.EmplaceWait(new_entry);
} }
private: private:
@@ -406,6 +425,7 @@ private:
static inline std::unique_ptr<Impl, decltype(&Deleter)> instance{nullptr, Deleter}; static inline std::unique_ptr<Impl, decltype(&Deleter)> instance{nullptr, Deleter};
Filter filter; Filter filter;
boost::regex regex_filter;
DebuggerBackend debugger_backend{}; DebuggerBackend debugger_backend{};
ColorConsoleBackend color_console_backend{}; ColorConsoleBackend color_console_backend{};
FileBackend file_backend; FileBackend file_backend;
@@ -446,6 +466,10 @@ void SetGlobalFilter(const Filter& filter) {
Impl::Instance().SetGlobalFilter(filter); Impl::Instance().SetGlobalFilter(filter);
} }
bool SetRegexFilter(const std::string& regex) {
return Impl::Instance().SetRegexFilter(regex);
}
void SetColorConsoleBackendEnabled(bool enabled) { void SetColorConsoleBackendEnabled(bool enabled) {
Impl::Instance().SetColorConsoleBackendEnabled(enabled); Impl::Instance().SetColorConsoleBackendEnabled(enabled);
} }
+6
View File
@@ -26,5 +26,11 @@ void DisableLoggingInTests();
*/ */
void SetGlobalFilter(const Filter& filter); void SetGlobalFilter(const Filter& filter);
/**
* Only allow messages that match the specified regex. The regex is matched against the final log
* text.
*/
bool SetRegexFilter(const std::string& regex);
void SetColorConsoleBackendEnabled(bool enabled); void SetColorConsoleBackendEnabled(bool enabled);
} // namespace Common::Log } // namespace Common::Log
+1
View File
@@ -542,6 +542,7 @@ struct Values {
// Miscellaneous // Miscellaneous
Setting<std::string> log_filter{"*:Info", "log_filter"}; Setting<std::string> log_filter{"*:Info", "log_filter"};
Setting<std::string> log_regex_filter{"", "log_regex_filter"};
// Video Dumping // Video Dumping
std::string output_format; std::string output_format;
+1 -1
View File
@@ -101,7 +101,7 @@ void vfp_put_float(ARMul_State* state, s32 val, unsigned int reg) {
u64 vfp_get_double(ARMul_State* state, unsigned int reg) { u64 vfp_get_double(ARMul_State* state, unsigned int reg) {
u64 result = ((u64)state->ExtReg[reg * 2 + 1]) << 32 | state->ExtReg[reg * 2]; u64 result = ((u64)state->ExtReg[reg * 2 + 1]) << 32 | state->ExtReg[reg * 2];
LOG_TRACE(Core_ARM11, "VFP get double: s[{}-{}]=[{:016llx}]", reg * 2 + 1, reg * 2, result); LOG_TRACE(Core_ARM11, "VFP get double: s[{}-{}]=[{:016x}]", reg * 2 + 1, reg * 2, result);
return result; return result;
} }
+3 -4
View File
@@ -64,7 +64,7 @@ static struct vfp_double vfp_double_default_qnan = {
}; };
static void vfp_double_dump(const char* str, struct vfp_double* d) { static void vfp_double_dump(const char* str, struct vfp_double* d) {
LOG_TRACE(Core_ARM11, "VFP: {}: sign={} exponent={} significand={:016llx}", str, d->sign != 0, LOG_TRACE(Core_ARM11, "VFP: {}: sign={} exponent={} significand={:016x}", str, d->sign != 0,
d->exponent, d->significand); d->exponent, d->significand);
} }
@@ -166,7 +166,7 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double* vd,
} else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vd->sign != 0)) } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vd->sign != 0))
incr = (1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1; incr = (1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1;
LOG_TRACE(Core_ARM11, "VFP: rounding increment = 0x{:08llx}", incr); LOG_TRACE(Core_ARM11, "VFP: rounding increment = 0x{:08x}", incr);
/* /*
* Is our rounding going to overflow? * Is our rounding going to overflow?
@@ -221,8 +221,7 @@ pack:
vfp_double_dump("pack: final", vd); vfp_double_dump("pack: final", vd);
{ {
s64 d = vfp_double_pack(vd); s64 d = vfp_double_pack(vd);
LOG_TRACE(Core_ARM11, "VFP: {}: d(d{})={:016llx} exceptions={:08x}", func, dd, d, LOG_TRACE(Core_ARM11, "VFP: {}: d(d{})={:016x} exceptions={:08x}", func, dd, d, exceptions);
exceptions);
vfp_put_double(state, d, dd); vfp_put_double(state, d, dd);
} }
return exceptions; return exceptions;
-33
View File
@@ -4,7 +4,6 @@
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <chrono>
#include <fmt/format.h> #include <fmt/format.h>
#include "common/archives.h" #include "common/archives.h"
#include "common/logging/log.h" #include "common/logging/log.h"
@@ -269,10 +268,8 @@ enum class SystemInfoMemUsageRegion {
*/ */
enum class SystemInfoCitraInformation { enum class SystemInfoCitraInformation {
IS_CITRA = 0, // Always set the output to 1, signaling the app is running on Citra. IS_CITRA = 0, // Always set the output to 1, signaling the app is running on Citra.
HOST_TICK = 1, // Tick reference from the host in ns, unaffected by lag or cpu speed.
BUILD_NAME = 10, // (ie: Nightly, Canary). BUILD_NAME = 10, // (ie: Nightly, Canary).
BUILD_VERSION = 11, // Build version. BUILD_VERSION = 11, // Build version.
BUILD_PLATFORM = 12, // Build platform, see SystemInfoCitraPlatform.
BUILD_DATE_PART1 = 20, // Build date first 7 characters. BUILD_DATE_PART1 = 20, // Build date first 7 characters.
BUILD_DATE_PART2 = 21, // Build date next 7 characters. BUILD_DATE_PART2 = 21, // Build date next 7 characters.
BUILD_DATE_PART3 = 22, // Build date next 7 characters. BUILD_DATE_PART3 = 22, // Build date next 7 characters.
@@ -283,17 +280,6 @@ enum class SystemInfoCitraInformation {
BUILD_GIT_DESCRIPTION_PART2 = 41, // Git description (commit) last 7 characters. BUILD_GIT_DESCRIPTION_PART2 = 41, // Git description (commit) last 7 characters.
}; };
/**
* Current officially supported platforms.
*/
enum class SystemInfoCitraPlatform {
PLATFORM_UNKNOWN = 0,
PLATFORM_WINDOWS = 1,
PLATFORM_LINUX = 2,
PLATFORM_APPLE = 3,
PLATFORM_ANDROID = 4,
};
/** /**
* Accepted by the custom svcControlProcess. * Accepted by the custom svcControlProcess.
*/ */
@@ -1754,31 +1740,12 @@ Result SVC::GetSystemInfo(s64* out, u32 type, s32 param) {
case SystemInfoCitraInformation::IS_CITRA: case SystemInfoCitraInformation::IS_CITRA:
*out = 1; *out = 1;
break; break;
case SystemInfoCitraInformation::HOST_TICK:
*out = static_cast<s64>(std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch())
.count());
break;
case SystemInfoCitraInformation::BUILD_NAME: case SystemInfoCitraInformation::BUILD_NAME:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_name, 0, sizeof(s64)); CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_name, 0, sizeof(s64));
break; break;
case SystemInfoCitraInformation::BUILD_VERSION: case SystemInfoCitraInformation::BUILD_VERSION:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_version, 0, sizeof(s64)); CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_version, 0, sizeof(s64));
break; break;
case SystemInfoCitraInformation::BUILD_PLATFORM: {
#if defined(_WIN32)
*out = static_cast<s64>(SystemInfoCitraPlatform::PLATFORM_WINDOWS);
#elif defined(ANDROID)
*out = static_cast<s64>(SystemInfoCitraPlatform::PLATFORM_ANDROID);
#elif defined(__linux__)
*out = static_cast<s64>(SystemInfoCitraPlatform::PLATFORM_LINUX);
#elif defined(__APPLE__)
*out = static_cast<s64>(SystemInfoCitraPlatform::PLATFORM_APPLE);
#else
*out = static_cast<s64>(SystemInfoCitraPlatform::PLATFORM_UNKNOWN);
#endif
break;
}
case SystemInfoCitraInformation::BUILD_DATE_PART1: case SystemInfoCitraInformation::BUILD_DATE_PART1:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date, CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date,
(sizeof(s64) - 1) * 0, sizeof(s64)); (sizeof(s64) - 1) * 0, sizeof(s64));
+15 -10
View File
@@ -838,7 +838,7 @@ void SOC_U::Bind(Kernel::HLERequestContext& ctx) {
SocketHolder& holder = socket_holder_optional->get(); SocketHolder& holder = socket_holder_optional->get();
CTRSockAddr ctr_sock_addr; CTRSockAddr ctr_sock_addr;
std::memcpy(&ctr_sock_addr, sock_addr_buf.data(), len); std::memcpy(&ctr_sock_addr, sock_addr_buf.data(), std::min<size_t>(len, sizeof(ctr_sock_addr)));
sockaddr sock_addr = CTRSockAddr::ToPlatform(ctr_sock_addr); sockaddr sock_addr = CTRSockAddr::ToPlatform(ctr_sock_addr);
@@ -977,7 +977,7 @@ void SOC_U::Accept(Kernel::HLERequestContext& ctx) {
} }
if (ctr_addr_buf.size() > async_data->max_addr_len) { if (ctr_addr_buf.size() > async_data->max_addr_len) {
LOG_WARNING(Frontend, "CTRSockAddr is too long, truncating data."); LOG_DEBUG(Service_SOC, "CTRSockAddr is too long, truncating data.");
ctr_addr_buf.resize(async_data->max_addr_len); ctr_addr_buf.resize(async_data->max_addr_len);
} }
@@ -1107,7 +1107,8 @@ void SOC_U::SendToOther(Kernel::HLERequestContext& ctx) {
s32 ret = -1; s32 ret = -1;
if (addr_len > 0) { if (addr_len > 0) {
CTRSockAddr ctr_dest_addr; CTRSockAddr ctr_dest_addr;
std::memcpy(&ctr_dest_addr, dest_addr_buffer.data(), sizeof(ctr_dest_addr)); std::memcpy(&ctr_dest_addr, dest_addr_buffer.data(),
std::min<size_t>(addr_len, sizeof(ctr_dest_addr)));
sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr); sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr);
ret = static_cast<s32>(::sendto(holder.socket_fd, ret = static_cast<s32>(::sendto(holder.socket_fd,
reinterpret_cast<const char*>(input_buff.data()), len, reinterpret_cast<const char*>(input_buff.data()), len,
@@ -1156,7 +1157,8 @@ s32 SOC_U::SendToImpl(SocketHolder& holder, u32 len, u32 flags, u32 addr_len,
s32 ret = -1; s32 ret = -1;
if (addr_len > 0) { if (addr_len > 0) {
CTRSockAddr ctr_dest_addr; CTRSockAddr ctr_dest_addr;
std::memcpy(&ctr_dest_addr, dest_addr_buff, sizeof(ctr_dest_addr)); std::memcpy(&ctr_dest_addr, dest_addr_buff,
std::min<size_t>(addr_len, sizeof(ctr_dest_addr)));
sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr); sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr);
ret = static_cast<s32>(::sendto(holder.socket_fd, ret = static_cast<s32>(::sendto(holder.socket_fd,
reinterpret_cast<const char*>(input_buff.data()), len, reinterpret_cast<const char*>(input_buff.data()), len,
@@ -1306,7 +1308,8 @@ void SOC_U::RecvFromOther(Kernel::HLERequestContext& ctx) {
async_data->len, async_data->flags, &src_addr, &src_addr_len)); async_data->len, async_data->flags, &src_addr, &src_addr_len));
if (async_data->ret >= 0 && src_addr_len > 0) { if (async_data->ret >= 0 && src_addr_len > 0) {
ctr_src_addr = CTRSockAddr::FromPlatform(src_addr); ctr_src_addr = CTRSockAddr::FromPlatform(src_addr);
std::memcpy(async_data->addr_buff.data(), &ctr_src_addr, async_data->addr_len); std::memcpy(async_data->addr_buff.data(), &ctr_src_addr,
std::min<size_t>(async_data->addr_len, sizeof(ctr_src_addr)));
} }
} else { } else {
async_data->ret = static_cast<s32>( async_data->ret = static_cast<s32>(
@@ -1422,7 +1425,8 @@ void SOC_U::RecvFrom(Kernel::HLERequestContext& ctx) {
async_data->len, async_data->flags, &src_addr, &src_addr_len)); async_data->len, async_data->flags, &src_addr, &src_addr_len));
if (async_data->ret >= 0 && src_addr_len > 0) { if (async_data->ret >= 0 && src_addr_len > 0) {
ctr_src_addr = CTRSockAddr::FromPlatform(src_addr); ctr_src_addr = CTRSockAddr::FromPlatform(src_addr);
std::memcpy(async_data->addr_buff.data(), &ctr_src_addr, async_data->addr_len); std::memcpy(async_data->addr_buff.data(), &ctr_src_addr,
std::min<size_t>(async_data->addr_len, sizeof(ctr_src_addr)));
} }
} else { } else {
async_data->ret = static_cast<s32>( async_data->ret = static_cast<s32>(
@@ -1566,7 +1570,7 @@ void SOC_U::GetSockName(Kernel::HLERequestContext& ctx) {
ret = TranslateError(GET_ERRNO); ret = TranslateError(GET_ERRNO);
if (dest_addr_buff.size() > max_addr_len) { if (dest_addr_buff.size() > max_addr_len) {
LOG_WARNING(Frontend, "CTRSockAddr is too long, truncating data."); LOG_DEBUG(Service_SOC, "CTRSockAddr is too long, truncating data.");
dest_addr_buff.resize(max_addr_len); dest_addr_buff.resize(max_addr_len);
} }
@@ -1708,7 +1712,7 @@ void SOC_U::GetPeerName(Kernel::HLERequestContext& ctx) {
} }
if (dest_addr_buff.size() > max_addr_len) { if (dest_addr_buff.size() > max_addr_len) {
LOG_WARNING(Frontend, "CTRSockAddr is too long, truncating data."); LOG_DEBUG(Service_SOC, "CTRSockAddr is too long, truncating data.");
dest_addr_buff.resize(max_addr_len); dest_addr_buff.resize(max_addr_len);
} }
@@ -1724,7 +1728,7 @@ void SOC_U::GetPeerName(Kernel::HLERequestContext& ctx) {
void SOC_U::Connect(Kernel::HLERequestContext& ctx) { void SOC_U::Connect(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx); IPC::RequestParser rp(ctx);
const auto socket_handle = rp.Pop<u32>(); const auto socket_handle = rp.Pop<u32>();
[[maybe_unused]] const auto input_addr_len = rp.Pop<u32>(); const auto input_addr_len = rp.Pop<u32>();
const u32 pid = rp.PopPID(); const u32 pid = rp.PopPID();
auto input_addr_buf = rp.PopStaticBuffer(); auto input_addr_buf = rp.PopStaticBuffer();
@@ -1751,7 +1755,8 @@ void SOC_U::Connect(Kernel::HLERequestContext& ctx) {
async_data->pid = pid; async_data->pid = pid;
CTRSockAddr ctr_input_addr; CTRSockAddr ctr_input_addr;
std::memcpy(&ctr_input_addr, input_addr_buf.data(), sizeof(ctr_input_addr)); std::memcpy(&ctr_input_addr, input_addr_buf.data(),
std::min<size_t>(input_addr_len, sizeof(ctr_input_addr)));
async_data->input_addr = CTRSockAddr::ToPlatform(ctr_input_addr); async_data->input_addr = CTRSockAddr::ToPlatform(ctr_input_addr);
async_data->socket_handle = socket_handle; async_data->socket_handle = socket_handle;
+3 -3
View File
@@ -76,9 +76,9 @@ public:
public: public:
Uniforms uniforms; Uniforms uniforms;
PackedAttribute uniform_queue; PackedAttribute uniform_queue;
ProgramCode program_code; ProgramCode program_code{};
SwizzleData swizzle_data; SwizzleData swizzle_data{};
u32 entry_point; u32 entry_point{};
const void* cached_shader{}; const void* cached_shader{};
private: private:
@@ -629,7 +629,7 @@ void Instance::CreateAllocator() {
.device = *device, .device = *device,
.pVulkanFunctions = &functions, .pVulkanFunctions = &functions,
.instance = *instance, .instance = *instance,
.vulkanApiVersion = vk::enumerateInstanceVersion(), .vulkanApiVersion = properties.apiVersion,
}; };
const VkResult result = vmaCreateAllocator(&allocator_info, &allocator); const VkResult result = vmaCreateAllocator(&allocator_info, &allocator);