Merge branch 'shadps4-emu:main' into audio3d

This commit is contained in:
Lizardy 2024-09-06 16:10:06 -04:00 committed by GitHub
commit 8a27bb30ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 43 additions and 33 deletions

View file

@ -116,6 +116,7 @@ static auto UserPaths = [] {
create_path(PathType::CheatsDir, user_dir / CHEATS_DIR);
create_path(PathType::PatchesDir, user_dir / PATCHES_DIR);
create_path(PathType::AddonsDir, user_dir / ADDONS_DIR);
create_path(PathType::MetaDataDir, user_dir / METADATA_DIR);
return paths;
}();

View file

@ -23,6 +23,7 @@ enum class PathType {
CheatsDir, // Where cheats are stored.
PatchesDir, // Where patches are stored.
AddonsDir, // Where additional content is stored.
MetaDataDir, // Where game metadata (e.g. trophies and menu backgrounds) is stored.
};
constexpr auto PORTABLE_DIR = "user";
@ -41,6 +42,7 @@ constexpr auto CAPTURES_DIR = "captures";
constexpr auto CHEATS_DIR = "cheats";
constexpr auto PATCHES_DIR = "patches";
constexpr auto ADDONS_DIR = "addcont";
constexpr auto METADATA_DIR = "game_data";
// Filenames
constexpr auto LOG_FILE = "shad_log.txt";

View file

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/path_util.h"
#include "trp.h"
TRP::TRP() = default;
@ -48,8 +49,9 @@ bool TRP::Extract(const std::filesystem::path& trophyPath) {
return false;
s64 seekPos = sizeof(TrpHeader);
std::filesystem::path trpFilesPath(std::filesystem::current_path() / "user/game_data" /
title / "TrophyFiles" / it.path().stem());
std::filesystem::path trpFilesPath(
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / title / "TrophyFiles" /
it.path().stem());
std::filesystem::create_directories(trpFilesPath / "Icons");
std::filesystem::create_directory(trpFilesPath / "Xml");

View file

@ -114,8 +114,8 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
QWidget* item = this->cellWidget(row, column);
if (item) {
QString pic1Path = QString::fromStdString((*m_games_shared)[itemID].pic_path);
const auto blurredPic1Path = Common::FS::GetUserPath(Common::FS::PathType::UserDir) /
"game_data" / (*m_games_shared)[itemID].serial / "pic1.png";
const auto blurredPic1Path = Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
(*m_games_shared)[itemID].serial / "pic1.png";
#ifdef _WIN32
const auto blurredPic1PathQt = QString::fromStdWString(blurredPic1Path.wstring());
#else
@ -128,7 +128,8 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
backgroundImage = m_game_list_utils.BlurImage(image, image.rect(), 16);
std::filesystem::path img_path =
std::filesystem::path("user/game_data/") / (*m_games_shared)[itemID].serial;
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
(*m_games_shared)[itemID].serial;
std::filesystem::create_directories(img_path);
if (!backgroundImage.save(blurredPic1PathQt, "PNG")) {
// qDebug() << "Error: Unable to save image.";

View file

@ -90,9 +90,8 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
}
QString pic1Path = QString::fromStdString(m_game_info->m_games[item->row()].pic_path);
const auto blurredPic1Path = Common::FS::GetUserPath(Common::FS::PathType::UserDir) /
"game_data" / m_game_info->m_games[item->row()].serial /
"pic1.png";
const auto blurredPic1Path = Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
m_game_info->m_games[item->row()].serial / "pic1.png";
#ifdef _WIN32
const auto blurredPic1PathQt = QString::fromStdWString(blurredPic1Path.wstring());
#else
@ -105,7 +104,8 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
backgroundImage = m_game_list_utils.BlurImage(image, image.rect(), 16);
std::filesystem::path img_path =
std::filesystem::path("user/game_data/") / m_game_info->m_games[item->row()].serial;
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
m_game_info->m_games[item->row()].serial;
std::filesystem::create_directories(img_path);
if (!backgroundImage.save(blurredPic1PathQt, "PNG")) {
// qDebug() << "Error: Unable to save image.";

View file

@ -16,7 +16,6 @@ int main(int argc, char* argv[]) {
// Load configurations and initialize Qt application
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::load(user_dir / "config.toml");
std::filesystem::create_directory(user_dir / "game_data");
// Check if elf or eboot.bin path was passed as a command line argument
bool has_command_line_argument = argc > 1;

View file

@ -37,7 +37,7 @@
<message>
<location filename="../game_info.cpp" line="26"/>
<source>Loading game list, please wait :3</source>
<translation>Duke ngarkuar listën e lojërave, lutem prit :3</translation>
<translation>Po ngarkohet lista e lojërave, lutem prit :3</translation>
</message>
<message>
<location filename="../game_info.cpp" line="26"/>
@ -181,7 +181,7 @@
<message>
<location filename="../main_window_ui.h" line="318"/>
<source>Install application from a .pkg file</source>
<translation>Instalo aplikacionin nga skedari .pkg</translation>
<translation>Instalo aplikacionin nga një skedar .pkg</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="320"/>
@ -256,12 +256,12 @@
<message>
<location filename="../main_window_ui.h" line="343"/>
<source>Download Cheats/Patches</source>
<translation>Shkarko Mashtrimet / Arnat</translation>
<translation>Shkarko Mashtrime/Arna</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="345"/>
<source>Dump Game List</source>
<translation>Zbraz Listën e lojërave</translation>
<translation>Zbraz Listën e Lojërave</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="346"/>
@ -276,12 +276,12 @@
<message>
<location filename="../main_window_ui.h" line="349"/>
<source>File</source>
<translation>Skedar</translation>
<translation>Skedari</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="350"/>
<source>View</source>
<translation>Pamje</translation>
<translation>Pamja</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="352"/>
@ -301,7 +301,7 @@
<message>
<location filename="../main_window_ui.h" line="356"/>
<source>Utils</source>
<translation>Shërbime</translation>
<translation>Shërbimet</translation>
</message>
<message>
<location filename="../main_window_ui.h" line="357"/>
@ -647,7 +647,7 @@
</message>
<message>
<location filename="../main_window.cpp" line="725"/>
<source>File doesn&apos;t appear to be a valid PKG file</source>
<source>File doesn't appear to be a valid PKG file</source>
<translation>Skedari nuk duket si skedar PKG i vlefshëm</translation>
</message>
</context>
@ -661,7 +661,7 @@
<message>
<location filename="../cheats_patches.cpp" line="50"/>
<source>defaultTextEdit_MSG</source>
<translation>Mashtrimet/Arnat janë eksperimentale.\nPërdori me kujdes.\n\nShkarko mashtrimet individualisht duke zgjedhur depon dhe duke klikuar butonin e shkarkimit.\nNë skedën Arna, mund t&apos;i shkarkosh gjitha arnat menjëherë, zgjidhësh cilat dëshiron përdorësh dhe ruash zgjedhjen tënde.\n\nMeqenëse ne nuk zhvillojmë Mashtrimet/Arnat,\ntë lutem raporto problemet te autori i mashtrimit.\n\nKe krijuar një mashtrim ri? Vizito:\nhttps://github.com/shadps4-emu/ps4_cheats</translation>
<translation>Mashtrimet/Arnat janë eksperimentale.\nPërdori me kujdes.\n\nShkarko mashtrimet individualisht duke zgjedhur depon dhe duke klikuar butonin e shkarkimit.\nNë skedën Arna, mund t'i shkarkosh gjitha arnat menjëherë, zgjidhësh cilat dëshiron përdorësh dhe ruash zgjedhjen tënde.\n\nMeqenëse ne nuk zhvillojmë Mashtrimet/Arnat,\ntë lutem raporto problemet te autori i mashtrimit.\n\nKe krijuar një mashtrim ri? Vizito:\nhttps://github.com/shadps4-emu/ps4_cheats</translation>
</message>
<message>
<location filename="../cheats_patches.cpp" line="69"/>
@ -856,7 +856,7 @@
<message>
<location filename="../cheats_patches.cpp" line="763"/>
<source>DownloadComplete_MSG</source>
<translation>Arnat u shkarkuan me sukses! gjitha arnat e ofruara për gjitha lojërat janë shkarkuar, nuk ka nevojë t&apos;i shkarkosh ato individualisht për secilën lojë siç ndodh me Mashtrimet. Nëse patch-i nuk shfaqet, mund mos ekzistojë për numrin e serisë dhe versionin specifik lojës. Mund jetë e nevojshme përditësoni lojën.</translation>
<translation>Arnat u shkarkuan me sukses! gjitha arnat e ofruara për gjitha lojërat janë shkarkuar, nuk ka nevojë t'i shkarkosh ato individualisht për secilën lojë siç ndodh me Mashtrimet. Nëse patch-i nuk shfaqet, mund mos ekzistojë për numrin e serisë dhe versionin specifik lojës. Mund jetë e nevojshme përditësosh lojën.</translation>
</message>
<message>
<location filename="../cheats_patches.cpp" line="773"/>
@ -906,7 +906,7 @@
<message>
<location filename="../cheats_patches.cpp" line="1163"/>
<source>Can't apply cheats before the game is started</source>
<translation>Nuk mund aplikoni mashtrime para se fillojë loja.</translation>
<translation>Nuk mund zbatohen mashtrime para se fillojë loja.</translation>
</message>
</context>
<context>
@ -919,12 +919,12 @@
<message>
<location filename="../settings_dialog.cpp" line="84"/>
<source>Apply</source>
<translation>Përdor</translation>
<translation>Zbato</translation>
</message>
<message>
<location filename="../settings_dialog.cpp" line="85"/>
<source>Restore Defaults</source>
<translation>Rikthe parazgjedhjet</translation>
<translation>Rikthe paracaktimet</translation>
</message>
<message>
<location filename="../settings_dialog.cpp" line="86"/>
@ -937,7 +937,7 @@
<message>
<location filename="../game_list_frame.cpp" line="34"/>
<source>Icon</source>
<translation>Ikonë</translation>
<translation>Ikona</translation>
</message>
<message>
<location filename="../game_list_frame.cpp" line="34"/>
@ -947,7 +947,7 @@
<message>
<location filename="../game_list_frame.cpp" line="34"/>
<source>Serial</source>
<translation>Seri</translation>
<translation>Seriku</translation>
</message>
<message>
<location filename="../game_list_frame.cpp" line="34"/>
@ -957,12 +957,12 @@
<message>
<location filename="../game_list_frame.cpp" line="34"/>
<source>Firmware</source>
<translation>Firmware</translation>
<translation>Firmueri</translation>
</message>
<message>
<location filename="../game_list_frame.cpp" line="35"/>
<source>Size</source>
<translation>Madësia</translation>
<translation>Madhësia</translation>
</message>
<message>
<location filename="../game_list_frame.cpp" line="35"/>
@ -972,7 +972,7 @@
<message>
<location filename="../game_list_frame.cpp" line="35"/>
<source>Path</source>
<translation>Rrugë</translation>
<translation>Shtegu</translation>
</message>
</context>
</TS>

View file

@ -21,11 +21,11 @@ TrophyViewer::TrophyViewer(QString trophyPath, QString gameTrpPath) : QMainWindo
void TrophyViewer::PopulateTrophyWidget(QString title) {
#ifdef _WIN32
const auto trophyDir = Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "game_data" /
const auto trophyDir = Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
title.toStdWString() / "TrophyFiles";
const auto trophyDirQt = QString::fromStdWString(trophyDir.wstring());
#else
const auto trophyDir = Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "game_data" /
const auto trophyDir = Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) /
title.toStdString() / "TrophyFiles";
const auto trophyDirQt = QString::fromStdString(trophyDir.string());
#endif

View file

@ -22,6 +22,7 @@ void Visit(Info& info, IR::Inst& inst) {
case IR::Opcode::WriteSharedU64:
info.uses_shared = true;
break;
case IR::Opcode::ConvertF16F32:
case IR::Opcode::ConvertF32F16:
case IR::Opcode::BitCastF16U16:
info.uses_fp16 = true;

View file

@ -220,12 +220,13 @@ bool Instance::CreateDevice() {
const bool robustness = add_extension(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
const bool topology_restart =
add_extension(VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME);
const bool maintenance5 = add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
// These extensions are promoted by Vulkan 1.3, but for greater compatibility we use Vulkan 1.2
// with extensions.
tooling_info = add_extension(VK_EXT_TOOLING_INFO_EXTENSION_NAME);
const bool maintenance4 = add_extension(VK_KHR_MAINTENANCE_4_EXTENSION_NAME);
const bool maintenance5 = add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
add_extension(VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME);
add_extension(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
add_extension(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME);
add_extension(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);

View file

@ -109,9 +109,12 @@ ImageId TextureCache::ResolveOverlap(const ImageInfo& image_info, ImageId cache_
}
if (image_info.pixel_format != tex_cache_image.info.pixel_format ||
image_info.size != tex_cache_image.info.size ||
image_info.guest_size_bytes <= tex_cache_image.info.guest_size_bytes) {
return merged_image_id ? merged_image_id : cache_image_id;
auto result_id = merged_image_id ? merged_image_id : cache_image_id;
const auto& result_image = slot_images[result_id];
return IsVulkanFormatCompatible(image_info.pixel_format, result_image.info.pixel_format)
? result_id
: ImageId{};
}
ImageId new_image_id{};