From 70576035b04051f04d832c2d5ff160ba6ff17442 Mon Sep 17 00:00:00 2001 From: Xphalnos <164882787+Xphalnos@users.noreply.github.com> Date: Sun, 18 Aug 2024 17:30:26 +0200 Subject: [PATCH 1/6] Misc changes --- .github/workflows/macos.yml | 6 +++--- .github/workflows/windows.yml | 2 +- CMakeLists.txt | 2 +- externals/glslang | 2 +- externals/toml11 | 2 +- externals/vma | 2 +- externals/vulkan-headers | 2 +- externals/xxhash | 2 +- externals/zydis | 2 +- src/qt_gui/main_window.cpp | 5 +++++ src/qt_gui/main_window_ui.h | 7 ++++++- 11 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e46401cb7..1a2a6eff6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -43,10 +43,10 @@ jobs: mv ${{github.workspace}}/build/shadps4 upload cp $(arch -x86_64 /usr/local/bin/brew --prefix)/opt/molten-vk/lib/libMoltenVK.dylib upload install_name_tool -add_rpath "@loader_path" upload/shadps4 - tar cf shadps4-macos.tar.gz -C upload . + tar cf shadps4-macos-sdl.tar.gz -C upload . - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-macos - path: shadps4-macos.tar.gz + name: shadps4-macos-sdl + path: shadps4-macos-sdl.tar.gz diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 46dc13a89..499124863 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,6 +29,6 @@ jobs: - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-win64 + name: shadps4-win64-sdl path: | ${{github.workspace}}/build/Release/shadPS4.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 74e0b32f0..9898e4060 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ find_package(glslang 14.2.0 CONFIG) find_package(magic_enum 0.9.6 CONFIG) find_package(RenderDoc 1.6.0 MODULE) find_package(SDL3 3.1.2 CONFIG) -find_package(toml11 3.8.1 CONFIG) +find_package(toml11 4.2.0 CONFIG) find_package(tsl-robin-map 1.3.0 CONFIG) find_package(VulkanHeaders 1.3.289 CONFIG) find_package(VulkanMemoryAllocator 3.1.0 CONFIG) diff --git a/externals/glslang b/externals/glslang index 7c4d91e78..d59c84d38 160000 --- a/externals/glslang +++ b/externals/glslang @@ -1 +1 @@ -Subproject commit 7c4d91e7819a1d27213aa3499953d54ae1a00e8f +Subproject commit d59c84d388c805022e2bddea08aa41cbe7e43e55 diff --git a/externals/toml11 b/externals/toml11 index fcb1d3d7e..cc0bee4fd 160000 --- a/externals/toml11 +++ b/externals/toml11 @@ -1 +1 @@ -Subproject commit fcb1d3d7e5885edfadbbe9572991dc4b3248af58 +Subproject commit cc0bee4fd46ea1f5db147d63ea545208cc9e8405 diff --git a/externals/vma b/externals/vma index 871913da6..e1bdbca9b 160000 --- a/externals/vma +++ b/externals/vma @@ -1 +1 @@ -Subproject commit 871913da6a4b132b567d7b65c509600363c0041e +Subproject commit e1bdbca9baf4d682fb6066b380f4aa4a7bdbb58a diff --git a/externals/vulkan-headers b/externals/vulkan-headers index 595c8d479..d205aff40 160000 --- a/externals/vulkan-headers +++ b/externals/vulkan-headers @@ -1 +1 @@ -Subproject commit 595c8d4794410a4e64b98dc58d27c0310d7ea2fd +Subproject commit d205aff40b4e15d4c568523ee6a26f85138126d9 diff --git a/externals/xxhash b/externals/xxhash index ee65ff988..dbea33e47 160000 --- a/externals/xxhash +++ b/externals/xxhash @@ -1 +1 @@ -Subproject commit ee65ff988bab34a184c700e2fbe1e1c5bc27485d +Subproject commit dbea33e47e7c0fe0b7c8592cd931c7430c1f130d diff --git a/externals/zydis b/externals/zydis index 16c6a369c..bd73bc03b 160000 --- a/externals/zydis +++ b/externals/zydis @@ -1 +1 @@ -Subproject commit 16c6a369c193981e9cf314126589eaa8763f92c3 +Subproject commit bd73bc03b0aacaa89c9c203b9b43cd08f1b1843b diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index f862c0646..653987b5b 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -202,6 +202,11 @@ void MainWindow::CreateConnects() { connect(m_game_list_frame.get(), &QTableWidget::cellDoubleClicked, this, &MainWindow::StartGame); + connect(ui->configureAct, &QAction::triggered, this, [this]() { + auto settingsDialog = new SettingsDialog(m_physical_devices, this); + settingsDialog->exec(); + }); + connect(ui->settingsButton, &QPushButton::clicked, this, [this]() { auto settingsDialog = new SettingsDialog(m_physical_devices, this); settingsDialog->exec(); diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index b7132c644..f8de30762 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -46,6 +46,7 @@ public: QAction* dumpGameListAct; QAction* pkgViewerAct; QAction* aboutAct; + QAction* configureAct; QAction* setThemeDark; QAction* setThemeLight; QAction* setThemeGreen; @@ -143,6 +144,8 @@ public: pkgViewerAct->setIcon(QIcon(":images/file_icon.png")); aboutAct = new QAction(MainWindow); aboutAct->setObjectName("aboutAct"); + configureAct = new QAction(MainWindow); + configureAct->setObjectName("configureAct"); setThemeDark = new QAction(MainWindow); setThemeDark->setObjectName("setThemeDark"); setThemeDark->setCheckable(true); @@ -285,6 +288,7 @@ public: menuGame_List_Mode->addAction(setlistModeListAct); menuGame_List_Mode->addAction(setlistModeGridAct); menuGame_List_Mode->addAction(setlistElfAct); + menuSettings->addAction(configureAct); menuSettings->addAction(gameInstallPathAct); menuSettings->addAction(menuUtils->menuAction()); menuUtils->addAction(dumpGameListAct); @@ -303,7 +307,8 @@ public: bootInstallPkgAct->setText( QCoreApplication::translate("MainWindow", "Install Packages (PKG)", nullptr)); bootGameAct->setText(QCoreApplication::translate("MainWindow", "Boot Game", nullptr)); - aboutAct->setText(QCoreApplication::translate("MainWindow", "About", nullptr)); + aboutAct->setText(QCoreApplication::translate("MainWindow", "About shadPS4", nullptr)); + configureAct->setText(QCoreApplication::translate("MainWindow", "Configure...", nullptr)); #if QT_CONFIG(tooltip) bootInstallPkgAct->setToolTip(QCoreApplication::translate( "MainWindow", "Install application from a .pkg file", nullptr)); From 1c898d084237a02b5e9e4c81eb50e056c1b28470 Mon Sep 17 00:00:00 2001 From: Vladislav Mikhalin Date: Sun, 18 Aug 2024 20:37:29 +0300 Subject: [PATCH 2/6] Fix stencil buffer not being used (#464) --- src/video_core/amdgpu/liverpool.h | 2 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 18 +++++++++++++----- .../renderer_vulkan/vk_scheduler.cpp | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index 92a247953..896927df6 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -452,7 +452,7 @@ struct Liverpool { BitField<11, 1, u32> enable_polygon_offset_front; BitField<12, 1, u32> enable_polygon_offset_back; BitField<13, 1, u32> enable_polygon_offset_para; - BitField<13, 1, u32> enable_window_offset; + BitField<16, 1, u32> enable_window_offset; BitField<19, 1, ProvokingVtxLast> provoking_vtx_last; PolygonMode PolyMode() const { diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 6bfe471c3..2d502737d 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -172,10 +172,17 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul .reference = key.stencil_ref_front.stencil_test_val, }, .back{ - .failOp = LiverpoolToVK::StencilOp(key.stencil.stencil_fail_back), - .passOp = LiverpoolToVK::StencilOp(key.stencil.stencil_zpass_back), - .depthFailOp = LiverpoolToVK::StencilOp(key.stencil.stencil_zfail_back), - .compareOp = LiverpoolToVK::CompareOp(key.depth.stencil_bf_func), + .failOp = LiverpoolToVK::StencilOp(key.depth.backface_enable + ? key.stencil.stencil_fail_back + : key.stencil.stencil_fail_front), + .passOp = LiverpoolToVK::StencilOp(key.depth.backface_enable + ? key.stencil.stencil_zpass_back + : key.stencil.stencil_zpass_front), + .depthFailOp = LiverpoolToVK::StencilOp(key.depth.backface_enable + ? key.stencil.stencil_zfail_back + : key.stencil.stencil_zfail_front), + .compareOp = LiverpoolToVK::CompareOp( + key.depth.backface_enable ? key.depth.stencil_bf_func : key.depth.stencil_ref_func), .compareMask = key.stencil_ref_back.stencil_mask, .writeMask = key.stencil_ref_back.stencil_write_mask, .reference = key.stencil_ref_back.stencil_test_val, @@ -207,7 +214,8 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul .colorAttachmentCount = num_color_formats, .pColorAttachmentFormats = key.color_formats.data(), .depthAttachmentFormat = key.depth_format, - .stencilAttachmentFormat = vk::Format::eUndefined, + .stencilAttachmentFormat = + key.depth.stencil_enable ? key.depth_format : vk::Format::eUndefined, }; std::array attachments; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index a6c2536ba..10ee6ea62 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -39,6 +39,7 @@ void Scheduler::BeginRendering(const RenderState& new_state) { .colorAttachmentCount = render_state.num_color_attachments, .pColorAttachments = render_state.color_attachments.data(), .pDepthAttachment = render_state.has_depth ? &render_state.depth_attachment : nullptr, + .pStencilAttachment = render_state.has_stencil ? &render_state.depth_attachment : nullptr, }; current_cmdbuf.beginRendering(rendering_info); From 5891900c6ecebf9909d002bcbd12caa45768d6ce Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 18 Aug 2024 16:04:48 -0300 Subject: [PATCH 3/6] alphabetical order console language --- src/qt_gui/settings_dialog.cpp | 51 ++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index ca47f3310..c1d1e8a3e 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -4,6 +4,39 @@ #include "settings_dialog.h" #include "ui_settings_dialog.h" +const QVector languageIndexes = { + 21, // Arabic + 23, // Czech + 14, // Danish + 6, // Dutch + 18, // English (United Kingdom) + 1, // English (United States) + 12, // Finnish + 22, // French (Canada) + 2, // French (France) + 4, // German + 25, // Greek + 24, // Hungarian + 29, // Indonesian + 5, // Italian + 0, // Japanese + 9, // Korean + 15, // Norwegian + 16, // Polish + 17, // Portuguese (Brazil) + 7, // Portuguese (Portugal) + 26, // Romanian + 8, // Russian + 11, // Simplified Chinese + 20, // Spanish (Latin America) + 3, // Spanish (Spain) + 13, // Swedish + 27, // Thai + 10, // Traditional Chinese + 19, // Turkish + 28, // Vietnamese +}; + SettingsDialog::SettingsDialog(std::span physical_devices, QWidget* parent) : QDialog(parent), ui(new Ui::SettingsDialog) { ui->setupUi(this); @@ -44,8 +77,13 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge connect(ui->userNameLineEdit, &QLineEdit::textChanged, this, [](const QString& text) { Config::setUserName(text.toStdString()); }); - connect(ui->consoleLanguageComboBox, &QComboBox::currentIndexChanged, this, - [](int index) { Config::setLanguage(index); }); + connect(ui->consoleLanguageComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, [this](int index) { + if (index >= 0 && index < languageIndexes.size()) { + int languageCode = languageIndexes[index]; + Config::setLanguage(languageCode); + } + }); connect(ui->fullscreenCheckBox, &QCheckBox::stateChanged, this, [](int val) { Config::setFullscreenMode(val); }); @@ -106,8 +144,11 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge } void SettingsDialog::LoadValuesFromConfig() { - ui->consoleLanguageComboBox->setCurrentIndex(Config::GetLanguage()); - + ui->consoleLanguageComboBox->setCurrentIndex( + std::distance( + languageIndexes.begin(), + std::find(languageIndexes.begin(), languageIndexes.end(), Config::GetLanguage())) % + languageIndexes.size()); ui->graphicsAdapterBox->setCurrentIndex(Config::getGpuId() + 1); ui->widthSpinBox->setValue(Config::getScreenWidth()); ui->heightSpinBox->setValue(Config::getScreenHeight()); @@ -133,4 +174,4 @@ int SettingsDialog::exec() { return QDialog::exec(); } -SettingsDialog::~SettingsDialog() {} \ No newline at end of file +SettingsDialog::~SettingsDialog() {} From ed96a9fb8e71613f7d88180354dc31670b04b5a4 Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 18 Aug 2024 16:15:06 -0300 Subject: [PATCH 4/6] alphabetical order console language --- src/qt_gui/settings_dialog.ui | 150 +++++++++++++++++----------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 11ba38d09..40ed905fb 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -115,32 +115,17 @@ - Japanese + Arabic - English (United States) + Czech - French (France) - - - - - Spanish (Spain) - - - - - German - - - - - Italian + Danish @@ -150,27 +135,12 @@ - Portuguese (Portugal) + English (United Kingdom) - Russian - - - - - Korean - - - - - Traditional Chinese - - - - - Simplified Chinese + English (United States) @@ -180,12 +150,47 @@ - Swedish + French (Canada) - Danish + French (France) + + + + + German + + + + + Greek + + + + + Hungarian + + + + + Indonesian + + + + + Italian + + + + + Japanese + + + + + Korean @@ -205,42 +210,7 @@ - English (United Kingdom) - - - - - Turkish - - - - - Spanish (Latin America) - - - - - Arabic - - - - - French (Canada) - - - - - Czech - - - - - Hungarian - - - - - Greek + Portuguese (Portugal) @@ -248,6 +218,31 @@ Romanian + + + Russian + + + + + Simplified Chinese + + + + + Spanish (Latin America) + + + + + Spanish (Spain) + + + + + Swedish + + Thai @@ -255,12 +250,17 @@ - Vietnamese + Traditional Chinese - Indonesian + Turkish + + + + + Vietnamese From c9a502b31a3fbbb8cc220d8a5e706ab97385b161 Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 18 Aug 2024 17:24:35 -0300 Subject: [PATCH 5/6] alphabetical order console language --- src/qt_gui/settings_dialog.ui | 150 ---------------------------------- 1 file changed, 150 deletions(-) diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 40ed905fb..dbb15206e 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -113,156 +113,6 @@ - - - Arabic - - - - - Czech - - - - - Danish - - - - - Dutch - - - - - English (United Kingdom) - - - - - English (United States) - - - - - Finnish - - - - - French (Canada) - - - - - French (France) - - - - - German - - - - - Greek - - - - - Hungarian - - - - - Indonesian - - - - - Italian - - - - - Japanese - - - - - Korean - - - - - Norwegian - - - - - Polish - - - - - Portuguese (Brazil) - - - - - Portuguese (Portugal) - - - - - Romanian - - - - - Russian - - - - - Simplified Chinese - - - - - Spanish (Latin America) - - - - - Spanish (Spain) - - - - - Swedish - - - - - Thai - - - - - Traditional Chinese - - - - - Turkish - - - - - Vietnamese - - From c58ad6d3b5a384035f628a27e266f79ecfd9261a Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 18 Aug 2024 17:24:41 -0300 Subject: [PATCH 6/6] alphabetical order console language --- src/qt_gui/settings_dialog.cpp | 72 +++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index c1d1e8a3e..aa2c73384 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -1,41 +1,43 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include "settings_dialog.h" #include "ui_settings_dialog.h" -const QVector languageIndexes = { - 21, // Arabic - 23, // Czech - 14, // Danish - 6, // Dutch - 18, // English (United Kingdom) - 1, // English (United States) - 12, // Finnish - 22, // French (Canada) - 2, // French (France) - 4, // German - 25, // Greek - 24, // Hungarian - 29, // Indonesian - 5, // Italian - 0, // Japanese - 9, // Korean - 15, // Norwegian - 16, // Polish - 17, // Portuguese (Brazil) - 7, // Portuguese (Portugal) - 26, // Romanian - 8, // Russian - 11, // Simplified Chinese - 20, // Spanish (Latin America) - 3, // Spanish (Spain) - 13, // Swedish - 27, // Thai - 10, // Traditional Chinese - 19, // Turkish - 28, // Vietnamese -}; +QStringList languageNames = {"Arabic", + "Czech", + "Danish", + "Dutch", + "English (United Kingdom)", + "English (United States)", + "Finnish", + "French (Canada)", + "French (France)", + "German", + "Greek", + "Hungarian", + "Indonesian", + "Italian", + "Japanese", + "Korean", + "Norwegian", + "Polish", + "Portuguese (Brazil)", + "Portuguese (Portugal)", + "Romanian", + "Russian", + "Simplified Chinese", + "Spanish (Latin America)", + "Spanish (Spain)", + "Swedish", + "Thai", + "Traditional Chinese", + "Turkish", + "Vietnamese"}; + +const QVector languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 24, 29, 5, 0, + 9, 15, 16, 17, 7, 26, 8, 11, 20, 3, 13, 27, 10, 19, 28}; SettingsDialog::SettingsDialog(std::span physical_devices, QWidget* parent) : QDialog(parent), ui(new Ui::SettingsDialog) { @@ -51,6 +53,12 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge ui->graphicsAdapterBox->addItem(device); } + ui->consoleLanguageComboBox->addItems(languageNames); + + QCompleter* completer = new QCompleter(languageNames, this); + completer->setCaseSensitivity(Qt::CaseInsensitive); + ui->consoleLanguageComboBox->setCompleter(completer); + LoadValuesFromConfig(); connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);