Compare commits
6 commits
dev
...
optimize-s
Author | SHA1 | Date | |
---|---|---|---|
4d5ac18068 | |||
8cd1a0a7c8 | |||
f05abd9b02 | |||
94b72df61e | |||
93e5d01452 | |||
4b54749954 |
64 changed files with 168 additions and 125 deletions
|
@ -7,8 +7,6 @@
|
||||||
export NDK_CCACHE="$(which ccache)"
|
export NDK_CCACHE="$(which ccache)"
|
||||||
ccache -s
|
ccache -s
|
||||||
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
BUILD_FLAVOR="mainline"
|
BUILD_FLAVOR="mainline"
|
||||||
|
|
||||||
BUILD_TYPE="release"
|
BUILD_TYPE="release"
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
# Exit on error, rather than continuing with the rest of the script.
|
# Exit on error, rather than continuing with the rest of the script.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ccache -s
|
ccache -sv
|
||||||
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
mkdir build || true && cd build
|
mkdir build || true && cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
# Exit on error, rather than continuing with the rest of the script.
|
# Exit on error, rather than continuing with the rest of the script.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ccache -s
|
ccache -sv
|
||||||
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
mkdir build || true && cd build
|
mkdir build || true && cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
|
@ -54,9 +52,9 @@ DESTDIR="$PWD/AppDir" ninja install
|
||||||
rm -vf AppDir/usr/bin/suyu-cmd AppDir/usr/bin/suyu-tester
|
rm -vf AppDir/usr/bin/suyu-cmd AppDir/usr/bin/suyu-tester
|
||||||
|
|
||||||
# Download tools needed to build an AppImage
|
# Download tools needed to build an AppImage
|
||||||
wget -nc https://git.suyu.dev/suyu/ext-linux-bin/raw/branch/main/appimage/deploy-linux.sh
|
wget -nc https://gitlab.com/suyu-emu/ext-linux-bin/-/raw/main/appimage/deploy-linux.sh
|
||||||
wget -nc https://git.suyu.dev/suyu/ext-linux-bin/raw/branch/main/appimage/exec-x86_64.so
|
wget -nc https://gitlab.com/suyu-emu/ext-linux-bin/-/raw/main/appimage/exec-x86_64.so
|
||||||
wget -nc https://git.suyu.dev/suyu/AppImageKit-checkrt/raw/branch/gh-workflow/AppRun
|
wget -nc https://gitlab.com/suyu-emu/AppImageKit-checkrt/-/raw/old/AppRun.sh
|
||||||
|
|
||||||
# Set executable bit
|
# Set executable bit
|
||||||
chmod 755 \
|
chmod 755 \
|
||||||
|
|
|
@ -8,9 +8,7 @@ set -e
|
||||||
|
|
||||||
#cd /suyu
|
#cd /suyu
|
||||||
|
|
||||||
ccache -s
|
ccache -sv
|
||||||
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
rm -rf build
|
rm -rf build
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
|
|
|
@ -8,7 +8,7 @@ name: 'suyu verify'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
# branches: [ "dev" ]
|
branches: [ "dev" ]
|
||||||
paths:
|
paths:
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- 'CMakeModules/**'
|
- 'CMakeModules/**'
|
||||||
|
@ -19,7 +19,7 @@ on:
|
||||||
# paths-ignore:
|
# paths-ignore:
|
||||||
# - 'src/android/**'
|
# - 'src/android/**'
|
||||||
push:
|
push:
|
||||||
# branches: [ "dev" ]
|
branches: [ "dev" ]
|
||||||
paths:
|
paths:
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- 'CMakeModules/**'
|
- 'CMakeModules/**'
|
||||||
|
|
5
.gitmodules
vendored
5
.gitmodules
vendored
|
@ -1,4 +1,6 @@
|
||||||
# SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
# SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
[submodule "enet"]
|
[submodule "enet"]
|
||||||
|
@ -67,3 +69,6 @@
|
||||||
[submodule "Vulkan-Utility-Libraries"]
|
[submodule "Vulkan-Utility-Libraries"]
|
||||||
path = externals/Vulkan-Utility-Libraries
|
path = externals/Vulkan-Utility-Libraries
|
||||||
url = https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
|
url = https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
|
||||||
|
[submodule "externals/SPIRV-Tools"]
|
||||||
|
path = externals/SPIRV-Tools
|
||||||
|
url = https://github.com/KhronosGroup/SPIRV-Tools.git
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
||||||
# SPDX-FileCopyrightText: 2024 suyu Emulator Project
|
# SPDX-FileCopyrightText: 2024 suyu Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.22)
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
@ -40,6 +41,8 @@ option(SUYU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
|
||||||
|
|
||||||
option(SUYU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
option(SUYU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||||
|
|
||||||
|
option(SUYU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ON)
|
||||||
|
|
||||||
option(SUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
option(SUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
||||||
|
|
||||||
option(SUYU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
option(SUYU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||||
|
@ -279,6 +282,8 @@ endif()
|
||||||
# Configure C++ standard
|
# Configure C++ standard
|
||||||
# ===========================
|
# ===========================
|
||||||
|
|
||||||
|
# boost asio's concept usage doesn't play nicely with some compilers yet.
|
||||||
|
add_definitions(-DBOOST_ASIO_DISABLE_CONCEPTS)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++20>)
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++20>)
|
||||||
|
|
||||||
|
@ -318,6 +323,11 @@ if (NOT SUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
|
||||||
find_package(VulkanUtilityLibraries REQUIRED)
|
find_package(VulkanUtilityLibraries REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT SUYU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(SPIRV-Tools REQUIRED SPIRV-Tools)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (ENABLE_LIBUSB)
|
if (ENABLE_LIBUSB)
|
||||||
find_package(libusb 1.0.24 MODULE)
|
find_package(libusb 1.0.24 MODULE)
|
||||||
endif()
|
endif()
|
||||||
|
|
20
README.md
20
README.md
|
@ -6,10 +6,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
**Note**: We do not support or condone piracy in any form. In order to use suyu, you'll need keys from your real Switch system, and games which you have legally obtained and paid for. We do not intend to make money or profit from this project.
|
**Note**: We do not support or condone piracy in any form. In order to use suyu, you'll need keys from your real Switch system, and games which you have legally obtained and paid for. We do not intend to make money or profit from this project.
|
||||||
|
|
||||||
We're in need of developers. Please join our chat below or DM a dev if you want to contribute!
|
We're in need of developers. Please join our chat below if you want to contribute!
|
||||||
This repo is currently based on Yuzu EA 4176 but the code will be rewritten for legal and performance reasons.
|
This repo was based on Yuzu EA 4176 but the code is being rewritten from the ground up for legal and performance reasons.
|
||||||
|
|
||||||
Our only website is suyu.dev so please be cautious when using other sites offering builds/downloads.
|
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
@ -23,13 +22,12 @@ Our only website is suyu.dev so please be cautious when using other sites offeri
|
||||||
|
|
||||||
<h4 align="center"><b>suyu</b> was the continuation of the world's most popular, open-source Nintendo Switch emulator, yuzu, but is now something more.
|
<h4 align="center"><b>suyu</b> was the continuation of the world's most popular, open-source Nintendo Switch emulator, yuzu, but is now something more.
|
||||||
<br>
|
<br>
|
||||||
It is written in C++ with portability in mind, and we actively provide builds for Windows, Linux and Android, iOS may come later.
|
It is written in C++ with portability in mind, and we actively provide builds for Windows, Linux, Android and iOS potentially coming soon.
|
||||||
|
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://chat.suyu.dev">Chat</a> |
|
<a href="https://chat.suyu.dev">Chat</a> |
|
||||||
<a href="https://www.reddit.com/r/suyu/">Reddit</a> |
|
|
||||||
<a href="#status">Status</a> |
|
<a href="#status">Status</a> |
|
||||||
<a href="#development">Development</a> |
|
<a href="#development">Development</a> |
|
||||||
<a href="#downloads">Downloads</a> |
|
<a href="#downloads">Downloads</a> |
|
||||||
|
@ -56,7 +54,7 @@ We currently have builds over at the [Releases](https://git.suyu.dev/suyu/suyu/r
|
||||||
|
|
||||||
This project is completely free and open source, and anyone can contribute to help improve suyu.
|
This project is completely free and open source, and anyone can contribute to help improve suyu.
|
||||||
|
|
||||||
Most of the development happens on Git. For development discussion, please join us in our [Chat](https://chat.suyu.dev) or [Subreddit](reddit.com/r/suyu/), you can also contact a developer.
|
Most of the development happens on the Git. For development discussion, please join us in our [Chat](https://chat.suyu.dev) or contact a developer.
|
||||||
|
|
||||||
If you want to contribute, please take a look at the [Contributor's Guide](https://git.suyu.dev/suyu/suyu/wiki/Contributing) and [Developer Information](https://git.suyu.dev/suyu/suyu/wiki/Developer-Information).
|
If you want to contribute, please take a look at the [Contributor's Guide](https://git.suyu.dev/suyu/suyu/wiki/Contributing) and [Developer Information](https://git.suyu.dev/suyu/suyu/wiki/Developer-Information).
|
||||||
You can also contact any of the developers on the Chat to learn more about the current state of suyu.
|
You can also contact any of the developers on the Chat to learn more about the current state of suyu.
|
||||||
|
@ -67,27 +65,25 @@ You can also contact any of the developers on the Chat to learn more about the c
|
||||||
* __Linux__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
* __Linux__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
||||||
* __macOS__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
* __macOS__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
||||||
* __Android__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
* __Android__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
|
||||||
###### We currently do not provide builds for iOS, however if you would like, you could try the experimental [Sudachi Emulator](https://sudachi.emuplace.app/) and it's bigger project: [Folium](https://apps.apple.com/us/app/folium/id6498623389).
|
###### We currently do not provide builds for iOS, however if you would like, you could try the experimental [Sudachi](https://github.com/emuPlace/Sudachi/releases)/[Folium](https://github.com/jarrodnorwell/Folium/releases).
|
||||||
|
|
||||||
If you want daily builds then [Click here](https://git.suyu.dev/suyu/suyu/actions).
|
If you want daily builds then [Click here](https://git.suyu.dev/suyu/suyu/actions).
|
||||||
If you don't know how to download the daily builds then [Click here](https://git.suyu.dev/suyu/suyu/raw/branch/dev/img/daily-builds.png)
|
If you don't know how to download the daily builds then [Click here](https://git.suyu.dev/suyu/suyu/raw/branch/dev/img/daily-builds.png)
|
||||||
|
|
||||||
We have official builds [here.](https://git.suyu.dev/suyu/suyu/releases)<br>If any website or person is claiming to have a build for suyu, take that with a grain of salt and let us know.
|
We have official builds [here.](https://git.suyu.dev/suyu/suyu/releases)<br>If any website or person is claiming to have a build for suyu, take that with a grain of salt.
|
||||||
|
|
||||||
For Multiplayer, we recommend using the "Yuzu Online" patch, install instructions can be found on Reddit and their Discord.
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
* __Windows__: [Windows Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Windows)
|
* __Windows__: [Windows Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Windows)
|
||||||
* __Linux__: [Linux Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Linux)
|
* __Linux__: [Linux Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Linux)
|
||||||
* __Android__: [Android Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Android)
|
* __Android__: [Android Build](https://git.suyu.dev/suyu/suyu/wiki/Building-For-Android)
|
||||||
* __MacOS__: [MacOS Build](https://git.suyu.dev/suyu/suyu/wiki/Building-for-macOS)
|
* __macOS__: [macOS Build](https://git.suyu.dev/suyu/suyu/wiki/Building-for-macOS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
If you have any questions, don't hesitate to ask us in our [Chat](https://chat.suyu.dev) or [Subreddit](https://www.reddit.com/r/suyu/), make an issue or contact a developer. We don't bite!
|
If you have any questions, don't hesitate to ask us in our [chat](https://chat.suyu.dev), make an issue or contact a developer. We don't bite!
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
7
externals/CMakeLists.txt
vendored
7
externals/CMakeLists.txt
vendored
|
@ -1,4 +1,6 @@
|
||||||
# SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
# SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
# Dynarmic has cmake_minimum_required(3.12) and we may want to override
|
# Dynarmic has cmake_minimum_required(3.12) and we may want to override
|
||||||
|
@ -160,6 +162,11 @@ if (SUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
|
||||||
add_subdirectory(Vulkan-Utility-Libraries)
|
add_subdirectory(Vulkan-Utility-Libraries)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# SPIRV-Tools
|
||||||
|
if (YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||||
|
add_subdirectory(SPIRV-Tools)
|
||||||
|
endif()
|
||||||
|
|
||||||
# TZDB (Time Zone Database)
|
# TZDB (Time Zone Database)
|
||||||
add_subdirectory(nx_tzdb)
|
add_subdirectory(nx_tzdb)
|
||||||
|
|
||||||
|
|
1
externals/SPIRV-Tools
vendored
Submodule
1
externals/SPIRV-Tools
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
Binary file not shown.
Before Width: | Height: | Size: 249 KiB |
|
@ -13,7 +13,7 @@
|
||||||
#include "common/polyfill_ranges.h"
|
#include "common/polyfill_ranges.h"
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
constexpr u32 CurrentRevision = 12;
|
constexpr u32 CurrentRevision = 11;
|
||||||
|
|
||||||
enum class SupportTags {
|
enum class SupportTags {
|
||||||
CommandProcessingTimeEstimatorVersion4,
|
CommandProcessingTimeEstimatorVersion4,
|
||||||
|
|
|
@ -54,8 +54,7 @@ public:
|
||||||
const s32 to_register{std::min(std::min(appended_count, BufferAppendLimit),
|
const s32 to_register{std::min(std::min(appended_count, BufferAppendLimit),
|
||||||
BufferAppendLimit - registered_count)};
|
BufferAppendLimit - registered_count)};
|
||||||
|
|
||||||
out_buffers.reserve(to_register);
|
for (s32 i = 0; i < to_register; i++) {
|
||||||
for (s32 i = 0; i < to_register; ++i) {
|
|
||||||
s32 index{appended_index - appended_count};
|
s32 index{appended_index - appended_count};
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
index += N;
|
index += N;
|
||||||
|
@ -181,7 +180,6 @@ public:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffers_flushed.reserve(registered_count + appended_count);
|
|
||||||
while (registered_count > 0) {
|
while (registered_count > 0) {
|
||||||
auto index{registered_index - registered_count};
|
auto index{registered_index - registered_count};
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ template <typename T>
|
||||||
struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>>
|
struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>>
|
||||||
: formatter<std::underlying_type_t<T>> {
|
: formatter<std::underlying_type_t<T>> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
|
auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) {
|
||||||
return fmt::formatter<std::underlying_type_t<T>>::format(
|
return fmt::formatter<std::underlying_type_t<T>>::format(
|
||||||
static_cast<std::underlying_type_t<T>>(value), ctx);
|
static_cast<std::underlying_type_t<T>>(value), ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -277,6 +279,8 @@ struct Values {
|
||||||
|
|
||||||
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
||||||
Category::Renderer};
|
Category::Renderer};
|
||||||
|
SwitchableSetting<bool> optimize_spirv_output{linkage, false, "optimize_spirv_output",
|
||||||
|
Category::Renderer};
|
||||||
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
|
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
|
||||||
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
|
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
|
||||||
SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
|
SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
|
||||||
|
|
|
@ -262,7 +262,7 @@ struct fmt::formatter<Common::PhysicalAddress> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Common::PhysicalAddress& addr, FormatContext& ctx) const {
|
auto format(const Common::PhysicalAddress& addr, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -273,7 +273,7 @@ struct fmt::formatter<Common::ProcessAddress> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Common::ProcessAddress& addr, FormatContext& ctx) const {
|
auto format(const Common::ProcessAddress& addr, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -284,7 +284,7 @@ struct fmt::formatter<Common::VirtualAddress> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Common::VirtualAddress& addr, FormatContext& ctx) const {
|
auto format(const Common::VirtualAddress& addr, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
return fmt::format_to(ctx.out(), "{:#x}", static_cast<u64>(addr.GetValue()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct fmt::formatter<Dynarmic::A32::CoprocReg> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Dynarmic::A32::CoprocReg& reg, FormatContext& ctx) const {
|
auto format(const Dynarmic::A32::CoprocReg& reg, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "cp{}", static_cast<size_t>(reg));
|
return fmt::format_to(ctx.out(), "cp{}", static_cast<size_t>(reg));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -80,7 +80,6 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs,
|
||||||
if (filename == "00") {
|
if (filename == "00") {
|
||||||
const auto dir = vfs->OpenDirectory(dir_name, FileSys::OpenMode::Read);
|
const auto dir = vfs->OpenDirectory(dir_name, FileSys::OpenMode::Read);
|
||||||
std::vector<FileSys::VirtualFile> concat;
|
std::vector<FileSys::VirtualFile> concat;
|
||||||
concat.reserve(0x10);
|
|
||||||
|
|
||||||
for (u32 i = 0; i < 0x10; ++i) {
|
for (u32 i = 0; i < 0x10; ++i) {
|
||||||
const auto file_name = fmt::format("{:02X}", i);
|
const auto file_name = fmt::format("{:02X}", i);
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <fmt/ranges.h>
|
|
||||||
|
|
||||||
#include "common/hex_util.h"
|
#include "common/hex_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
@ -482,7 +481,6 @@ void GDBStub::HandleQuery(std::string_view command) {
|
||||||
// beginning of list
|
// beginning of list
|
||||||
const auto& threads = GetProcess()->GetThreadList();
|
const auto& threads = GetProcess()->GetThreadList();
|
||||||
std::vector<std::string> thread_ids;
|
std::vector<std::string> thread_ids;
|
||||||
thread_ids.reserve(threads.size());
|
|
||||||
for (const auto& thread : threads) {
|
for (const auto& thread : threads) {
|
||||||
thread_ids.push_back(fmt::format("{:x}", thread.GetThreadId()));
|
thread_ids.push_back(fmt::format("{:x}", thread.GetThreadId()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ std::vector<NcaID> PlaceholderCache::List() const {
|
||||||
std::vector<NcaID> out;
|
std::vector<NcaID> out;
|
||||||
for (const auto& sdir : dir->GetSubdirectories()) {
|
for (const auto& sdir : dir->GetSubdirectories()) {
|
||||||
for (const auto& file : sdir->GetFiles()) {
|
for (const auto& file : sdir->GetFiles()) {
|
||||||
const auto& name = file->GetName();
|
const auto name = file->GetName();
|
||||||
if (name.length() == 36 && name.ends_with(".nca")) {
|
if (name.length() == 36 && name.ends_with(".nca")) {
|
||||||
out.push_back(Common::HexStringToArray<0x10>(name.substr(0, 32)));
|
out.push_back(Common::HexStringToArray<0x10>(name.substr(0, 32)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,9 +117,7 @@ std::vector<std::shared_ptr<NCA>> NSP::GetNCAsCollapsed() const {
|
||||||
if (extracted)
|
if (extracted)
|
||||||
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
|
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
|
||||||
std::vector<std::shared_ptr<NCA>> out;
|
std::vector<std::shared_ptr<NCA>> out;
|
||||||
out.reserve(ncas.size());
|
|
||||||
for (const auto& map : ncas) {
|
for (const auto& map : ncas) {
|
||||||
out.reserve(map.second.size());
|
|
||||||
for (const auto& inner_map : map.second)
|
for (const auto& inner_map : map.second)
|
||||||
out.push_back(inner_map.second);
|
out.push_back(inner_map.second);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace FileSys::SystemArchive {
|
||||||
|
|
||||||
namespace NgWord1Data {
|
namespace NgWord1Data {
|
||||||
|
|
||||||
[[maybe_unused]] constexpr std::size_t NUMBER_WORD_TXT_FILES = 0x10;
|
constexpr std::size_t NUMBER_WORD_TXT_FILES = 0x10;
|
||||||
|
|
||||||
// Should this archive replacement mysteriously not work on a future game, consider updating.
|
// Should this archive replacement mysteriously not work on a future game, consider updating.
|
||||||
constexpr std::array<u8, 4> VERSION_DAT{0x0, 0x0, 0x0, 0x20}; // 11.0.1 System Version
|
constexpr std::array<u8, 4> VERSION_DAT{0x0, 0x0, 0x0, 0x20}; // 11.0.1 System Version
|
||||||
|
@ -24,7 +24,7 @@ constexpr std::array<u8, 30> WORD_TXT{
|
||||||
|
|
||||||
VirtualDir NgWord1() {
|
VirtualDir NgWord1() {
|
||||||
std::vector<VirtualFile> files;
|
std::vector<VirtualFile> files;
|
||||||
files.reserve(files.size() + 2);
|
files.reserve(NgWord1Data::NUMBER_WORD_TXT_FILES);
|
||||||
|
|
||||||
for (std::size_t i = 0; i < files.size(); ++i) {
|
for (std::size_t i = 0; i < files.size(); ++i) {
|
||||||
files.push_back(MakeArrayFile(NgWord1Data::WORD_TXT, fmt::format("{}.txt", i)));
|
files.push_back(MakeArrayFile(NgWord1Data::WORD_TXT, fmt::format("{}.txt", i)));
|
||||||
|
@ -54,7 +54,7 @@ constexpr std::array<u8, 0x2C> AC_NX_DATA{
|
||||||
|
|
||||||
VirtualDir NgWord2() {
|
VirtualDir NgWord2() {
|
||||||
std::vector<VirtualFile> files;
|
std::vector<VirtualFile> files;
|
||||||
files.reserve(NgWord2Data::NUMBER_AC_NX_FILES + 4);
|
files.reserve(NgWord2Data::NUMBER_AC_NX_FILES * 3);
|
||||||
|
|
||||||
for (std::size_t i = 0; i < NgWord2Data::NUMBER_AC_NX_FILES; ++i) {
|
for (std::size_t i = 0; i < NgWord2Data::NUMBER_AC_NX_FILES; ++i) {
|
||||||
files.push_back(MakeArrayFile(NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b1_nx", i)));
|
files.push_back(MakeArrayFile(NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b1_nx", i)));
|
||||||
|
|
|
@ -37,7 +37,6 @@ const static std::map<std::string, const std::map<const char*, const std::vector
|
||||||
|
|
||||||
static void GenerateFiles(std::vector<VirtualFile>& directory,
|
static void GenerateFiles(std::vector<VirtualFile>& directory,
|
||||||
const std::map<const char*, const std::vector<u8>>& files) {
|
const std::map<const char*, const std::vector<u8>>& files) {
|
||||||
directory.reserve(files.size());
|
|
||||||
for (const auto& [filename, data] : files) {
|
for (const auto& [filename, data] : files) {
|
||||||
const auto data_copy{data};
|
const auto data_copy{data};
|
||||||
const std::string filename_copy{filename};
|
const std::string filename_copy{filename};
|
||||||
|
@ -55,7 +54,6 @@ static std::vector<VirtualFile> GenerateZoneinfoFiles() {
|
||||||
|
|
||||||
VirtualDir TimeZoneBinary() {
|
VirtualDir TimeZoneBinary() {
|
||||||
std::vector<VirtualDir> america_sub_dirs;
|
std::vector<VirtualDir> america_sub_dirs;
|
||||||
america_sub_dirs.reserve(tzdb_america_dirs.size());
|
|
||||||
for (const auto& [dir_name, files] : tzdb_america_dirs) {
|
for (const auto& [dir_name, files] : tzdb_america_dirs) {
|
||||||
std::vector<VirtualFile> vfs_files;
|
std::vector<VirtualFile> vfs_files;
|
||||||
GenerateFiles(vfs_files, files);
|
GenerateFiles(vfs_files, files);
|
||||||
|
@ -64,7 +62,6 @@ VirtualDir TimeZoneBinary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<VirtualDir> zoneinfo_sub_dirs;
|
std::vector<VirtualDir> zoneinfo_sub_dirs;
|
||||||
zoneinfo_sub_dirs.reserve(tzdb_zoneinfo_dirs.size());
|
|
||||||
for (const auto& [dir_name, files] : tzdb_zoneinfo_dirs) {
|
for (const auto& [dir_name, files] : tzdb_zoneinfo_dirs) {
|
||||||
std::vector<VirtualFile> vfs_files;
|
std::vector<VirtualFile> vfs_files;
|
||||||
GenerateFiles(vfs_files, files);
|
GenerateFiles(vfs_files, files);
|
||||||
|
|
|
@ -38,8 +38,7 @@ VirtualDir CachedVfsDirectory::GetSubdirectory(std::string_view dir_name) const
|
||||||
|
|
||||||
std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
||||||
std::vector<VirtualFile> out;
|
std::vector<VirtualFile> out;
|
||||||
out.reserve(files.size());
|
for (auto& [file_name, file] : files) {
|
||||||
for (const auto& [_, file] : files) {
|
|
||||||
out.push_back(file);
|
out.push_back(file);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
@ -47,8 +46,7 @@ std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
||||||
|
|
||||||
std::vector<VirtualDir> CachedVfsDirectory::GetSubdirectories() const {
|
std::vector<VirtualDir> CachedVfsDirectory::GetSubdirectories() const {
|
||||||
std::vector<VirtualDir> out;
|
std::vector<VirtualDir> out;
|
||||||
out.reserve(dirs.size());
|
for (auto& [dir_name, dir] : dirs) {
|
||||||
for (auto& [_, dir] : dirs) {
|
|
||||||
out.push_back(dir);
|
out.push_back(dir);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -121,7 +121,7 @@ void WindowSystem::RequestAppletVisibilityState(Applet& applet, bool visible) {
|
||||||
void WindowSystem::OnOperationModeChanged() {
|
void WindowSystem::OnOperationModeChanged() {
|
||||||
std::scoped_lock lk{m_lock};
|
std::scoped_lock lk{m_lock};
|
||||||
|
|
||||||
for (const auto& [_, applet] : m_applets) {
|
for (const auto& [aruid, applet] : m_applets) {
|
||||||
std::scoped_lock lk2{applet->lock};
|
std::scoped_lock lk2{applet->lock};
|
||||||
applet->lifecycle_manager.OnOperationAndPerformanceModeChanged();
|
applet->lifecycle_manager.OnOperationAndPerformanceModeChanged();
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ void WindowSystem::OnOperationModeChanged() {
|
||||||
void WindowSystem::OnExitRequested() {
|
void WindowSystem::OnExitRequested() {
|
||||||
std::scoped_lock lk{m_lock};
|
std::scoped_lock lk{m_lock};
|
||||||
|
|
||||||
for (const auto& [_, applet] : m_applets) {
|
for (const auto& [aruid, applet] : m_applets) {
|
||||||
std::scoped_lock lk2{applet->lock};
|
std::scoped_lock lk2{applet->lock};
|
||||||
applet->lifecycle_manager.RequestExit();
|
applet->lifecycle_manager.RequestExit();
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ void WindowSystem::OnHomeButtonPressed(ButtonPressDuration type) {
|
||||||
|
|
||||||
void WindowSystem::PruneTerminatedAppletsLocked() {
|
void WindowSystem::PruneTerminatedAppletsLocked() {
|
||||||
for (auto it = m_applets.begin(); it != m_applets.end(); /* ... */) {
|
for (auto it = m_applets.begin(); it != m_applets.end(); /* ... */) {
|
||||||
const auto& [_, applet] = *it;
|
const auto& [aruid, applet] = *it;
|
||||||
|
|
||||||
std::scoped_lock lk{applet->lock};
|
std::scoped_lock lk{applet->lock};
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ Result LANDiscovery::Scan(std::span<NetworkInfo> out_networks, s16& out_count,
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
|
|
||||||
std::scoped_lock lock{packet_mutex};
|
std::scoped_lock lock{packet_mutex};
|
||||||
for (const auto& [_, info] : scan_results) {
|
for (const auto& [key, info] : scan_results) {
|
||||||
if (out_count >= static_cast<s16>(out_networks.size())) {
|
if (out_count >= static_cast<s16>(out_networks.size())) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <fmt/ranges.h>
|
|
||||||
|
|
||||||
#include "common/fs/file.h"
|
#include "common/fs/file.h"
|
||||||
#include "common/fs/fs.h"
|
#include "common/fs/fs.h"
|
||||||
|
|
|
@ -348,7 +348,7 @@ Result IApplicationManagerInterface::ListApplicationRecord(
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
u8 ii = 24;
|
u8 ii = 24;
|
||||||
|
|
||||||
for (const auto& [_, game] : installed_games) {
|
for (const auto& [slot, game] : installed_games) {
|
||||||
if (i >= limit) {
|
if (i >= limit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ constexpr inline Result GetSpanBetweenTimePoints(s64* out_seconds, const SteadyC
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<Service::PSC::Time::TimeType> : fmt::formatter<fmt::string_view> {
|
struct fmt::formatter<Service::PSC::Time::TimeType> : fmt::formatter<fmt::string_view> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(Service::PSC::Time::TimeType type, FormatContext& ctx) const {
|
auto format(Service::PSC::Time::TimeType type, FormatContext& ctx) {
|
||||||
const string_view name = [type] {
|
const string_view name = [type] {
|
||||||
using Service::PSC::Time::TimeType;
|
using Service::PSC::Time::TimeType;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} {
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceManager::~ServiceManager() {
|
ServiceManager::~ServiceManager() {
|
||||||
for (auto& [_, port] : service_ports) {
|
for (auto& [name, port] : service_ports) {
|
||||||
port->Close();
|
port->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -571,7 +571,7 @@ SDLDriver::~SDLDriver() {
|
||||||
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||||
std::vector<Common::ParamPackage> devices;
|
std::vector<Common::ParamPackage> devices;
|
||||||
std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
|
std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
|
||||||
for (const auto& [_, value] : joystick_map) {
|
for (const auto& [key, value] : joystick_map) {
|
||||||
for (const auto& joystick : value) {
|
for (const auto& joystick : value) {
|
||||||
if (!joystick->GetSDLJoystick()) {
|
if (!joystick->GetSDLJoystick()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -591,7 +591,7 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add dual controllers
|
// Add dual controllers
|
||||||
for (const auto& [_, value] : joystick_map) {
|
for (const auto& [key, value] : joystick_map) {
|
||||||
for (const auto& joystick : value) {
|
for (const auto& joystick : value) {
|
||||||
if (joystick->IsJoyconRight()) {
|
if (joystick->IsJoyconRight()) {
|
||||||
if (!joycon_pairs.contains(joystick->GetPort())) {
|
if (!joycon_pairs.contains(joystick->GetPort())) {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
add_library(shader_recompiler STATIC
|
add_library(shader_recompiler STATIC
|
||||||
|
@ -242,7 +244,13 @@ add_library(shader_recompiler STATIC
|
||||||
varying_state.h
|
varying_state.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit)
|
if (SUYU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||||
|
set(SPIRV_TOOLS_LIBRARY SPIRV-Tools-opt)
|
||||||
|
else()
|
||||||
|
set(SPIRV_TOOLS_LIBRARY SPIRV-Tools-opt SPIRV-Tools SPIRV-Tools-link)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit ${SPIRV_TOOLS_LIBRARY})
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(shader_recompiler PRIVATE
|
target_compile_options(shader_recompiler PRIVATE
|
||||||
|
|
|
@ -184,7 +184,7 @@ struct fmt::formatter<Shader::Backend::GLASM::Id> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(Shader::Backend::GLASM::Id id, FormatContext& ctx) const {
|
auto format(Shader::Backend::GLASM::Id id, FormatContext& ctx) {
|
||||||
return Shader::Backend::GLASM::FormatTo<true>(ctx, id);
|
return Shader::Backend::GLASM::FormatTo<true>(ctx, id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -195,7 +195,7 @@ struct fmt::formatter<Shader::Backend::GLASM::Register> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::Register& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::Register& value, FormatContext& ctx) {
|
||||||
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
||||||
throw Shader::InvalidArgument("Register value type is not register");
|
throw Shader::InvalidArgument("Register value type is not register");
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarRegister> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::ScalarRegister& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::ScalarRegister& value, FormatContext& ctx) {
|
||||||
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
if (value.type != Shader::Backend::GLASM::Type::Register) {
|
||||||
throw Shader::InvalidArgument("Register value type is not register");
|
throw Shader::InvalidArgument("Register value type is not register");
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarU32> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::ScalarU32& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::ScalarU32& value, FormatContext& ctx) {
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case Shader::Backend::GLASM::Type::Void:
|
case Shader::Backend::GLASM::Type::Void:
|
||||||
break;
|
break;
|
||||||
|
@ -244,7 +244,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarS32> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::ScalarS32& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::ScalarS32& value, FormatContext& ctx) {
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case Shader::Backend::GLASM::Type::Void:
|
case Shader::Backend::GLASM::Type::Void:
|
||||||
break;
|
break;
|
||||||
|
@ -265,7 +265,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF32> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::ScalarF32& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::ScalarF32& value, FormatContext& ctx) {
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case Shader::Backend::GLASM::Type::Void:
|
case Shader::Backend::GLASM::Type::Void:
|
||||||
break;
|
break;
|
||||||
|
@ -286,7 +286,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF64> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Backend::GLASM::ScalarF64& value, FormatContext& ctx) const {
|
auto format(const Shader::Backend::GLASM::ScalarF64& value, FormatContext& ctx) {
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case Shader::Backend::GLASM::Type::Void:
|
case Shader::Backend::GLASM::Type::Void:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <span>
|
#include <span>
|
||||||
|
@ -6,6 +8,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <spirv-tools/optimizer.hpp>
|
||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "shader_recompiler/backend/spirv/emit_spirv.h"
|
#include "shader_recompiler/backend/spirv/emit_spirv.h"
|
||||||
|
@ -481,7 +484,7 @@ void PatchPhiNodes(IR::Program& program, EmitContext& ctx) {
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
||||||
IR::Program& program, Bindings& bindings) {
|
IR::Program& program, Bindings& bindings, bool optimize) {
|
||||||
EmitContext ctx{profile, runtime_info, program, bindings};
|
EmitContext ctx{profile, runtime_info, program, bindings};
|
||||||
const Id main{DefineMain(ctx, program)};
|
const Id main{DefineMain(ctx, program)};
|
||||||
DefineEntryPoint(program, ctx, main);
|
DefineEntryPoint(program, ctx, main);
|
||||||
|
@ -493,7 +496,28 @@ std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in
|
||||||
SetupCapabilities(profile, program.info, ctx);
|
SetupCapabilities(profile, program.info, ctx);
|
||||||
SetupTransformFeedbackCapabilities(ctx, main);
|
SetupTransformFeedbackCapabilities(ctx, main);
|
||||||
PatchPhiNodes(program, ctx);
|
PatchPhiNodes(program, ctx);
|
||||||
|
|
||||||
|
if (!optimize) {
|
||||||
return ctx.Assemble();
|
return ctx.Assemble();
|
||||||
|
} else {
|
||||||
|
std::vector<u32> spirv = ctx.Assemble();
|
||||||
|
|
||||||
|
spvtools::Optimizer spv_opt(SPV_ENV_VULKAN_1_3);
|
||||||
|
spv_opt.SetMessageConsumer([](spv_message_level_t, const char*, const spv_position_t&,
|
||||||
|
const char* m) { LOG_ERROR(HW_GPU, "spirv-opt: {}", m); });
|
||||||
|
spv_opt.RegisterPerformancePasses();
|
||||||
|
|
||||||
|
spvtools::OptimizerOptions opt_options;
|
||||||
|
opt_options.set_run_validator(false);
|
||||||
|
|
||||||
|
std::vector<u32> result;
|
||||||
|
if (!spv_opt.Run(spirv.data(), spirv.size(), &result, opt_options)) {
|
||||||
|
LOG_ERROR(HW_GPU,
|
||||||
|
"Failed to optimize SPIRV shader output, continuing without optimization");
|
||||||
|
result = std::move(spirv);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Id EmitPhi(EmitContext& ctx, IR::Inst* inst) {
|
Id EmitPhi(EmitContext& ctx, IR::Inst* inst) {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -31,11 +33,12 @@ constexpr u32 RESCALING_LAYOUT_DOWN_FACTOR_OFFSET = offsetof(RescalingLayout, do
|
||||||
constexpr u32 RENDERAREA_LAYOUT_OFFSET = offsetof(RenderAreaLayout, render_area);
|
constexpr u32 RENDERAREA_LAYOUT_OFFSET = offsetof(RenderAreaLayout, render_area);
|
||||||
|
|
||||||
[[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
[[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
||||||
IR::Program& program, Bindings& bindings);
|
IR::Program& program, Bindings& bindingss, bool optimize);
|
||||||
|
|
||||||
[[nodiscard]] inline std::vector<u32> EmitSPIRV(const Profile& profile, IR::Program& program) {
|
[[nodiscard]] inline std::vector<u32> EmitSPIRV(const Profile& profile, IR::Program& program,
|
||||||
|
bool optimize) {
|
||||||
Bindings binding;
|
Bindings binding;
|
||||||
return EmitSPIRV(profile, {}, program, binding);
|
return EmitSPIRV(profile, {}, program, binding, optimize);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Shader::Backend::SPIRV
|
} // namespace Shader::Backend::SPIRV
|
||||||
|
|
|
@ -196,11 +196,8 @@ Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR
|
||||||
}
|
}
|
||||||
|
|
||||||
Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) {
|
Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) {
|
||||||
// if (!index.IsImmediate() || index.Type() != Shader::IR::Type::U32 || index.U32() != 0) {
|
if (!index.IsImmediate() || index.U32() != 0) {
|
||||||
// throw NotImplementedException("Indirect image indexing");
|
throw NotImplementedException("Indirect image indexing");
|
||||||
// }
|
|
||||||
if (index.Type() != Shader::IR::Type::U32) {
|
|
||||||
LOG_WARNING(Shader_SPIRV, "Non-U32 type provided as index: {}", index.Type());
|
|
||||||
}
|
}
|
||||||
if (info.type == TextureType::Buffer) {
|
if (info.type == TextureType::Buffer) {
|
||||||
const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)};
|
const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)};
|
||||||
|
@ -218,11 +215,8 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& ind
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<Id, bool> Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) {
|
std::pair<Id, bool> Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) {
|
||||||
// if (!index.IsImmediate() || index.Type() != Shader::IR::Type::U32 || index.U32() != 0) {
|
if (!index.IsImmediate() || index.U32() != 0) {
|
||||||
// throw NotImplementedException("Indirect image indexing");
|
throw NotImplementedException("Indirect image indexing");
|
||||||
// }
|
|
||||||
if (index.Type() != Shader::IR::Type::U32) {
|
|
||||||
LOG_WARNING(Shader_SPIRV, "Non-U32 type provided as index: {}", index.Type());
|
|
||||||
}
|
}
|
||||||
if (info.type == TextureType::Buffer) {
|
if (info.type == TextureType::Buffer) {
|
||||||
const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)};
|
const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)};
|
||||||
|
|
|
@ -250,7 +250,7 @@ struct fmt::formatter<Shader::IR::Attribute> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Attribute& attribute, FormatContext& ctx) const {
|
auto format(const Shader::IR::Attribute& attribute, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(attribute));
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(attribute));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct fmt::formatter<Shader::IR::Condition> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Condition& cond, FormatContext& ctx) const {
|
auto format(const Shader::IR::Condition& cond, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(cond));
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(cond));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct fmt::formatter<Shader::IR::FlowTest> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::FlowTest& flow_test, FormatContext& ctx) const {
|
auto format(const Shader::IR::FlowTest& flow_test, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(flow_test));
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(flow_test));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct fmt::formatter<Shader::IR::Opcode> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Opcode& op, FormatContext& ctx) const {
|
auto format(const Shader::IR::Opcode& op, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(op));
|
return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(op));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct fmt::formatter<Shader::IR::Pred> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Pred& pred, FormatContext& ctx) const {
|
auto format(const Shader::IR::Pred& pred, FormatContext& ctx) {
|
||||||
if (pred == Shader::IR::Pred::PT) {
|
if (pred == Shader::IR::Pred::PT) {
|
||||||
return fmt::format_to(ctx.out(), "PT");
|
return fmt::format_to(ctx.out(), "PT");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -319,7 +319,7 @@ struct fmt::formatter<Shader::IR::Reg> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Reg& reg, FormatContext& ctx) const {
|
auto format(const Shader::IR::Reg& reg, FormatContext& ctx) {
|
||||||
if (reg == Shader::IR::Reg::RZ) {
|
if (reg == Shader::IR::Reg::RZ) {
|
||||||
return fmt::format_to(ctx.out(), "RZ");
|
return fmt::format_to(ctx.out(), "RZ");
|
||||||
} else if (static_cast<int>(reg) >= 0 && static_cast<int>(reg) < 255) {
|
} else if (static_cast<int>(reg) >= 0 && static_cast<int>(reg) < 255) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct fmt::formatter<Shader::IR::Type> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::IR::Type& type, FormatContext& ctx) const {
|
auto format(const Shader::IR::Type& type, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", NameOf(type));
|
return fmt::format_to(ctx.out(), "{}", NameOf(type));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -102,7 +102,7 @@ struct fmt::formatter<Shader::Maxwell::Location> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Maxwell::Location& location, FormatContext& ctx) const {
|
auto format(const Shader::Maxwell::Location& location, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{:04x}", location.Offset());
|
return fmt::format_to(ctx.out(), "{:04x}", location.Offset());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,7 +23,7 @@ struct fmt::formatter<Shader::Maxwell::Opcode> {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) const {
|
auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{}", NameOf(opcode));
|
return fmt::format_to(ctx.out(), "{}", NameOf(opcode));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,7 +69,7 @@ void ConfigureApplets::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
|
|
||||||
applets_hold.emplace(setting->Id(), widget);
|
applets_hold.emplace(setting->Id(), widget);
|
||||||
}
|
}
|
||||||
for (const auto& [_, widget] : applets_hold) {
|
for (const auto& [label, widget] : applets_hold) {
|
||||||
library_applets_layout.addWidget(widget);
|
library_applets_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [_, widget] : hold) {
|
for (const auto& [id, widget] : hold) {
|
||||||
layout.addWidget(widget);
|
layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [_, widget] : unsafe_hold) {
|
for (const auto& [label, widget] : unsafe_hold) {
|
||||||
unsafe_layout->addWidget(widget);
|
unsafe_layout->addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,10 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [_, widget] : general_hold) {
|
for (const auto& [id, widget] : general_hold) {
|
||||||
general_layout.addWidget(widget);
|
general_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
for (const auto& [_, widget] : linux_hold) {
|
for (const auto& [id, widget] : linux_hold) {
|
||||||
linux_layout.addWidget(widget);
|
linux_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [_, widget] : hold_graphics) {
|
for (const auto& [id, widget] : hold_graphics) {
|
||||||
graphics_layout.addWidget(widget);
|
graphics_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ void ConfigureGraphicsAdvanced::Setup(const ConfigurationShared::Builder& builde
|
||||||
checkbox_enable_compute_pipelines = widget;
|
checkbox_enable_compute_pipelines = widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& [_, widget] : hold) {
|
for (const auto& [id, widget] : hold) {
|
||||||
layout.addWidget(widget);
|
layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ void ConfigureLinuxTab::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
linux_hold.insert({setting->Id(), widget});
|
linux_hold.insert({setting->Id(), widget});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [_, widget] : linux_hold) {
|
for (const auto& [id, widget] : linux_hold) {
|
||||||
linux_layout.addWidget(widget);
|
linux_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,10 +174,10 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
widget->deleteLater();
|
widget->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& [_, widget] : core_hold) {
|
for (const auto& [label, widget] : core_hold) {
|
||||||
core_layout.addWidget(widget);
|
core_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
for (const auto& [_, widget] : system_hold) {
|
for (const auto& [id, widget] : system_hold) {
|
||||||
system_layout.addWidget(widget);
|
system_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void PopulateResolutionComboBox(QComboBox* screenshot_height, QWidget* pa
|
||||||
const auto& enumeration =
|
const auto& enumeration =
|
||||||
Settings::EnumMetadata<Settings::ResolutionSetup>::Canonicalizations();
|
Settings::EnumMetadata<Settings::ResolutionSetup>::Canonicalizations();
|
||||||
std::set<u32> resolutions{};
|
std::set<u32> resolutions{};
|
||||||
for (const auto& [_, value] : enumeration) {
|
for (const auto& [name, value] : enumeration) {
|
||||||
const float up_factor = GetUpFactor(value);
|
const float up_factor = GetUpFactor(value);
|
||||||
u32 height_undocked = Layout::ScreenUndocked::Height * up_factor;
|
u32 height_undocked = Layout::ScreenUndocked::Height * up_factor;
|
||||||
u32 height_docked = Layout::ScreenDocked::Height * up_factor;
|
u32 height_docked = Layout::ScreenDocked::Height * up_factor;
|
||||||
|
|
|
@ -61,7 +61,7 @@ std::vector<std::string> InputProfiles::GetInputProfileNames() {
|
||||||
|
|
||||||
auto it = map_profiles.cbegin();
|
auto it = map_profiles.cbegin();
|
||||||
while (it != map_profiles.cend()) {
|
while (it != map_profiles.cend()) {
|
||||||
const auto& [profile_name, _] = *it;
|
const auto& [profile_name, config] = *it;
|
||||||
if (!ProfileExistsInFilesystem(profile_name)) {
|
if (!ProfileExistsInFilesystem(profile_name)) {
|
||||||
it = map_profiles.erase(it);
|
it = map_profiles.erase(it);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "suyu/configuration/shared_translation.h"
|
#include "suyu/configuration/shared_translation.h"
|
||||||
|
@ -143,6 +145,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
||||||
tr("Allows saving shaders to storage for faster loading on following game "
|
tr("Allows saving shaders to storage for faster loading on following game "
|
||||||
"boots.\nDisabling "
|
"boots.\nDisabling "
|
||||||
"it is only intended for debugging."));
|
"it is only intended for debugging."));
|
||||||
|
INSERT(Settings, optimize_spirv_output, tr("Optimize SPIRV output shader"),
|
||||||
|
tr("Runs an additional optimization pass over generated SPIRV shaders.\n"
|
||||||
|
"Will increase time required for shader compilation.\nMay slightly improve "
|
||||||
|
"performance.\nThis feature is experimental."));
|
||||||
INSERT(
|
INSERT(
|
||||||
Settings, use_asynchronous_gpu_emulation, tr("Use asynchronous GPU emulation"),
|
Settings, use_asynchronous_gpu_emulation, tr("Use asynchronous GPU emulation"),
|
||||||
tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled."));
|
tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled."));
|
||||||
|
|
|
@ -135,7 +135,7 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
const ComboboxTranslations* enumeration{nullptr};
|
const ComboboxTranslations* enumeration{nullptr};
|
||||||
if (combobox_enumerations.contains(type)) {
|
if (combobox_enumerations.contains(type)) {
|
||||||
enumeration = &combobox_enumerations.at(type);
|
enumeration = &combobox_enumerations.at(type);
|
||||||
for (const auto& [_, name] : *enumeration) {
|
for (const auto& [id, name] : *enumeration) {
|
||||||
combobox->addItem(name);
|
combobox->addItem(name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -223,7 +223,7 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Settings::IsConfiguringGlobal()) {
|
if (!Settings::IsConfiguringGlobal()) {
|
||||||
for (const auto& [_, button] : radio_buttons) {
|
for (const auto& [id, button] : radio_buttons) {
|
||||||
QObject::connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
|
QObject::connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include <fmt/ranges.h>
|
|
||||||
|
|
||||||
#include "core/hle/service/am/applet_manager.h"
|
#include "core/hle/service/am/applet_manager.h"
|
||||||
#include "core/loader/nca.h"
|
#include "core/loader/nca.h"
|
||||||
#include "core/loader/nro.h"
|
#include "core/loader/nro.h"
|
||||||
|
|
|
@ -87,7 +87,7 @@ std::optional<std::filesystem::path> GetCurrentUserPlayTimePath(
|
||||||
std::vector<PlayTimeElement> elements;
|
std::vector<PlayTimeElement> elements;
|
||||||
elements.reserve(play_time_db.size());
|
elements.reserve(play_time_db.size());
|
||||||
|
|
||||||
for (const auto& [program_id, play_time] : play_time_db) {
|
for (auto& [program_id, play_time] : play_time_db) {
|
||||||
if (program_id != 0) {
|
if (program_id != 0) {
|
||||||
elements.push_back(PlayTimeElement{program_id, play_time});
|
elements.push_back(PlayTimeElement{program_id, play_time});
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] unsigned Count() const noexcept {
|
[[nodiscard]] unsigned Count() const noexcept {
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto& [_, value] : page_table) {
|
for (const auto& [index, value] : page_table) {
|
||||||
count += value;
|
count += value;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
// Vic does not know which nvdec is producing frames for it, so search all the fds here for
|
// Vic does not know which nvdec is producing frames for it, so search all the fds here for
|
||||||
// the given offset.
|
// the given offset.
|
||||||
for (auto& map : m_presentation_order) {
|
for (auto& map : m_presentation_order) {
|
||||||
for (auto& [offset, _] : map.second) {
|
for (auto& [offset, frame] : map.second) {
|
||||||
if (offset == search_offset) {
|
if (offset == search_offset) {
|
||||||
return map.first;
|
return map.first;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& map : m_decode_order) {
|
for (auto& map : m_decode_order) {
|
||||||
for (auto& [offset, _] : map.second) {
|
for (auto& [offset, frame] : map.second) {
|
||||||
if (offset == search_offset) {
|
if (offset == search_offset) {
|
||||||
return map.first;
|
return map.first;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
@ -537,7 +539,9 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline(
|
||||||
break;
|
break;
|
||||||
case Settings::ShaderBackend::SpirV:
|
case Settings::ShaderBackend::SpirV:
|
||||||
ConvertLegacyToGeneric(program, runtime_info);
|
ConvertLegacyToGeneric(program, runtime_info);
|
||||||
sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding);
|
sources_spirv[stage_index] =
|
||||||
|
EmitSPIRV(profile, runtime_info, program, binding,
|
||||||
|
Settings::values.optimize_spirv_output.GetValue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
previous_program = &program;
|
previous_program = &program;
|
||||||
|
@ -596,7 +600,7 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(
|
||||||
code = EmitGLASM(profile, info, program);
|
code = EmitGLASM(profile, info, program);
|
||||||
break;
|
break;
|
||||||
case Settings::ShaderBackend::SpirV:
|
case Settings::ShaderBackend::SpirV:
|
||||||
code_spirv = EmitSPIRV(profile, program);
|
code_spirv = EmitSPIRV(profile, program, Settings::values.optimize_spirv_output.GetValue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 Torzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -673,7 +675,8 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
|
||||||
|
|
||||||
const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)};
|
const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)};
|
||||||
ConvertLegacyToGeneric(program, runtime_info);
|
ConvertLegacyToGeneric(program, runtime_info);
|
||||||
const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding)};
|
const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding,
|
||||||
|
Settings::values.optimize_spirv_output.GetValue())};
|
||||||
device.SaveShader(code);
|
device.SaveShader(code);
|
||||||
modules[stage_index] = BuildShader(device, code);
|
modules[stage_index] = BuildShader(device, code);
|
||||||
if (device.HasDebuggingToolAttached()) {
|
if (device.HasDebuggingToolAttached()) {
|
||||||
|
@ -767,7 +770,8 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
|
||||||
}
|
}
|
||||||
|
|
||||||
auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
|
auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
|
||||||
const std::vector<u32> code{EmitSPIRV(profile, program)};
|
const std::vector<u32> code{
|
||||||
|
EmitSPIRV(profile, program, Settings::values.optimize_spirv_output.GetValue())};
|
||||||
device.SaveShader(code);
|
device.SaveShader(code);
|
||||||
vk::ShaderModule spv_module{BuildShader(device, code)};
|
vk::ShaderModule spv_module{BuildShader(device, code)};
|
||||||
if (device.HasDebuggingToolAttached()) {
|
if (device.HasDebuggingToolAttached()) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::string_view> {
|
struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::string_view> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(VideoCore::Surface::PixelFormat format, FormatContext& ctx) const {
|
auto format(VideoCore::Surface::PixelFormat format, FormatContext& ctx) {
|
||||||
using VideoCore::Surface::PixelFormat;
|
using VideoCore::Surface::PixelFormat;
|
||||||
const string_view name = [format] {
|
const string_view name = [format] {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
@ -234,7 +234,7 @@ struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::str
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<VideoCommon::ImageType> : fmt::formatter<fmt::string_view> {
|
struct fmt::formatter<VideoCommon::ImageType> : fmt::formatter<fmt::string_view> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(VideoCommon::ImageType type, FormatContext& ctx) const {
|
auto format(VideoCommon::ImageType type, FormatContext& ctx) {
|
||||||
const string_view name = [type] {
|
const string_view name = [type] {
|
||||||
using VideoCommon::ImageType;
|
using VideoCommon::ImageType;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -262,7 +262,7 @@ struct fmt::formatter<VideoCommon::Extent3D> {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const VideoCommon::Extent3D& extent, FormatContext& ctx) const {
|
auto format(const VideoCommon::Extent3D& extent, FormatContext& ctx) {
|
||||||
return fmt::format_to(ctx.out(), "{{{}, {}, {}}}", extent.width, extent.height,
|
return fmt::format_to(ctx.out(), "{{{}, {}, {}}}", extent.width, extent.height,
|
||||||
extent.depth);
|
extent.depth);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue