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 ff8bb5110..679325ec8 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)); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index ca47f3310..aa2c73384 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -1,9 +1,44 @@ // 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" +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) { ui->setupUi(this); @@ -18,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); @@ -44,8 +85,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 +152,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 +182,4 @@ int SettingsDialog::exec() { return QDialog::exec(); } -SettingsDialog::~SettingsDialog() {} \ No newline at end of file +SettingsDialog::~SettingsDialog() {} diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 11ba38d09..dbb15206e 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -113,156 +113,6 @@ - - - Japanese - - - - - English (United States) - - - - - French (France) - - - - - Spanish (Spain) - - - - - German - - - - - Italian - - - - - Dutch - - - - - Portuguese (Portugal) - - - - - Russian - - - - - Korean - - - - - Traditional Chinese - - - - - Simplified Chinese - - - - - Finnish - - - - - Swedish - - - - - Danish - - - - - Norwegian - - - - - Polish - - - - - Portuguese (Brazil) - - - - - English (United Kingdom) - - - - - Turkish - - - - - Spanish (Latin America) - - - - - Arabic - - - - - French (Canada) - - - - - Czech - - - - - Hungarian - - - - - Greek - - - - - Romanian - - - - - Thai - - - - - Vietnamese - - - - - Indonesian - - 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);