Updated externals, fixed SDL2 on Windows, fixed user presence view, maybe fixed Odin 2 with The Walking Dead
This commit is contained in:
parent
d065cb0521
commit
eec52f8808
|
@ -15,6 +15,9 @@ include(CTest)
|
||||||
# Set bundled sdl2/qt as dependent options.
|
# Set bundled sdl2/qt as dependent options.
|
||||||
# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
|
# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
|
||||||
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
|
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
|
||||||
|
|
||||||
|
set(USE_SDL2_FROM_EXTERNALS "Uses SDL2 from the externals directory" ON)
|
||||||
|
|
||||||
CMAKE_DEPENDENT_OPTION(SUDACHI_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
|
CMAKE_DEPENDENT_OPTION(SUDACHI_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
|
||||||
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
||||||
CMAKE_DEPENDENT_OPTION(SUDACHI_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
CMAKE_DEPENDENT_OPTION(SUDACHI_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
||||||
|
@ -535,7 +538,7 @@ if(ENABLE_QT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the sudachi_find_package
|
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the sudachi_find_package
|
||||||
if (ENABLE_SDL2)
|
if (ENABLE_SDL2 AND NOT USE_SDL2_FROM_EXTERNALS)
|
||||||
if (SUDACHI_USE_BUNDLED_SDL2)
|
if (SUDACHI_USE_BUNDLED_SDL2)
|
||||||
# Detect toolchain and platform
|
# Detect toolchain and platform
|
||||||
if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
|
if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
|
||||||
|
@ -556,7 +559,7 @@ if (ENABLE_SDL2)
|
||||||
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||||
target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}")
|
target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}")
|
||||||
target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
|
target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
|
||||||
elseif (SUDACHI_USE_EXTERNAL_SDL2)
|
elseif (USE_SDL2_FROM_EXTERNALS)
|
||||||
message(STATUS "Using SDL2 from externals.")
|
message(STATUS "Using SDL2 from externals.")
|
||||||
else()
|
else()
|
||||||
find_package(SDL2 2.26.4 REQUIRED)
|
find_package(SDL2 2.26.4 REQUIRED)
|
||||||
|
|
|
@ -3,8 +3,6 @@ Sudachi is a Nintendo Switch emulator for Android, Linux and Windows, written in
|
||||||
|
|
||||||
# Building
|
# Building
|
||||||
- **[Building for Android](documentation/building/ANDROID.md)**
|
- **[Building for Android](documentation/building/ANDROID.md)**
|
||||||
- TODO: ~~**[Building for Linux](https://official-antique.gitbook.io/sudachi/building/linux)**~~
|
|
||||||
- TODO: ~~**[Building for Windows](https://official-antique.gitbook.io/sudachi/building/window)**~~
|
|
||||||
|
|
||||||
# Compatibility
|
# Compatibility
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|
|
@ -63,7 +63,7 @@ if (ENABLE_LIBUSB AND NOT TARGET libusb::usb)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# SDL2
|
# SDL2
|
||||||
if (SUDACHI_USE_EXTERNAL_SDL2)
|
if (USE_SDL2_FROM_EXTERNALS)
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
# Sudachi itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers
|
# Sudachi itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers
|
||||||
# Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095)
|
# Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cc016b0046d563287f0aa9f09b958b5e70d43696
|
Subproject commit c60e2704c88ecb8bf55d69085b9c1bd2a68e5321
|
|
@ -1 +1 @@
|
||||||
Subproject commit c44b7d0f7ff21edb702745e4c019d0537928c373
|
Subproject commit 0b924c79ceb7b3c46d82dd00f6f1ed3f664d02d0
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6cf58bac95ff62cd3453cba2c898993b40e1da66
|
Subproject commit e678b3fad58a508cbd0a6e6dc777fb48346f948b
|
|
@ -1 +1 @@
|
||||||
Subproject commit c1f0f54018bf1f6f86710be1517313fb7b49556c
|
Subproject commit 2554a89e02c7fc30a980b4f7e635ceae1ecba5d6
|
|
@ -1 +1 @@
|
||||||
Subproject commit 099fb9250d916511782bf5215f01f2e7141beb3a
|
Subproject commit 1cdb5e0b24c303b41fcac0dce00baf21881f6da2
|
|
@ -1 +1 @@
|
||||||
Subproject commit 80477f635345e8f13efc512d84b01b94cad92cd9
|
Subproject commit aabb091ae37068498751fd58202a9854408ecb0e
|
|
@ -61,31 +61,33 @@ if (MSVC)
|
||||||
/external:W0 # Sets the default warning level to 0 for external headers, effectively disabling warnings for them.
|
/external:W0 # Sets the default warning level to 0 for external headers, effectively disabling warnings for them.
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
/W4
|
# /W4
|
||||||
/WX
|
# /WX
|
||||||
|
|
||||||
/we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
|
# /we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
|
||||||
/we4189 # 'identifier': local variable is initialized but not referenced
|
# /we4189 # 'identifier': local variable is initialized but not referenced
|
||||||
/we4265 # 'class': class has virtual functions, but destructor is not virtual
|
# /we4265 # 'class': class has virtual functions, but destructor is not virtual
|
||||||
/we4388 # 'expression': signed/unsigned mismatch
|
# /we4388 # 'expression': signed/unsigned mismatch
|
||||||
/we4389 # 'operator': signed/unsigned mismatch
|
# /we4389 # 'operator': signed/unsigned mismatch
|
||||||
/we4456 # Declaration of 'identifier' hides previous local declaration
|
# /we4456 # Declaration of 'identifier' hides previous local declaration
|
||||||
/we4457 # Declaration of 'identifier' hides function parameter
|
# /we4457 # Declaration of 'identifier' hides function parameter
|
||||||
/we4458 # Declaration of 'identifier' hides class member
|
# /we4458 # Declaration of 'identifier' hides class member
|
||||||
/we4459 # Declaration of 'identifier' hides global declaration
|
# /we4459 # Declaration of 'identifier' hides global declaration
|
||||||
/we4505 # 'function': unreferenced local function has been removed
|
# /we4505 # 'function': unreferenced local function has been removed
|
||||||
/we4547 # 'operator': operator before comma has no effect; expected operator with side-effect
|
# /we4547 # 'operator': operator before comma has no effect; expected operator with side-effect
|
||||||
/we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'?
|
# /we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'?
|
||||||
/we4555 # Expression has no effect; expected expression with side-effect
|
# /we4555 # Expression has no effect; expected expression with side-effect
|
||||||
/we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
|
# /we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
|
||||||
/we5038 # data member 'member1' will be initialized after data member 'member2'
|
# /we5038 # data member 'member1' will be initialized after data member 'member2'
|
||||||
/we5233 # explicit lambda capture 'identifier' is not used
|
# /we5233 # explicit lambda capture 'identifier' is not used
|
||||||
/we5245 # 'function': unreferenced function with internal linkage has been removed
|
# /we5245 # 'function': unreferenced function with internal linkage has been removed
|
||||||
|
|
||||||
/wd4100 # 'identifier': unreferenced formal parameter
|
# /wd4189
|
||||||
/wd4324 # 'struct_name': structure was padded due to __declspec(align())
|
# /wd4101
|
||||||
/wd4201 # nonstandard extension used : nameless struct/union
|
# /wd4100 # 'identifier': unreferenced formal parameter
|
||||||
/wd4702 # unreachable code (when used with LTO)
|
# /wd4324 # 'struct_name': structure was padded due to __declspec(align())
|
||||||
|
# /wd4201 # nonstandard extension used : nameless struct/union
|
||||||
|
# /wd4702 # unreachable code (when used with LTO)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_CCACHE OR SUDACHI_USE_PRECOMPILED_HEADERS)
|
if (USE_CCACHE OR SUDACHI_USE_PRECOMPILED_HEADERS)
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.4.1" apply false
|
id("com.android.application") version "8.5.0" apply false
|
||||||
id("com.android.library") version "8.4.1" apply false
|
id("com.android.library") version "8.5.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
|
id("org.jetbrains.kotlin.android") version "2.0.20-Beta1" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("clean").configure {
|
tasks.register("clean").configure {
|
||||||
|
@ -17,6 +17,6 @@ buildscript {
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.6.0")
|
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Tue May 28 14:57:37 GMT+08:00 2024
|
#Wed Jun 26 17:33:19 AWST 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-rc-1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -219,23 +219,23 @@ play {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("androidx.core:core-ktx:1.13.1")
|
implementation("androidx.core:core-ktx:1.13.1")
|
||||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
||||||
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||||
implementation("androidx.fragment:fragment-ktx:1.7.1")
|
implementation("androidx.fragment:fragment-ktx:1.8.0")
|
||||||
implementation("androidx.documentfile:documentfile:1.0.1")
|
implementation("androidx.documentfile:documentfile:1.0.1")
|
||||||
implementation("com.google.android.material:material:1.12.0")
|
implementation("com.google.android.material:material:1.12.0")
|
||||||
implementation("androidx.preference:preference-ktx:1.2.1")
|
implementation("androidx.preference:preference-ktx:1.2.1")
|
||||||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.0")
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
|
||||||
implementation("io.coil-kt:coil:2.6.0")
|
implementation("io.coil-kt:coil:2.6.0")
|
||||||
implementation("androidx.core:core-splashscreen:1.0.1")
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
||||||
implementation("androidx.window:window:1.2.0")
|
implementation("androidx.window:window:1.3.0")
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
||||||
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
|
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
|
||||||
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
|
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
|
||||||
implementation("info.debatty:java-string-similarity:2.0.0")
|
implementation("info.debatty:java-string-similarity:2.0.0")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun runGitCommand(command: List<String>): String {
|
fun runGitCommand(command: List<String>): String {
|
||||||
|
|
|
@ -41,10 +41,6 @@ void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsig
|
||||||
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Trace, \
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Trace, \
|
||||||
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
__VA_ARGS__)
|
__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define LOG_TRACE(log_class, fmt, ...) (void(0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LOG_DEBUG(log_class, ...) \
|
#define LOG_DEBUG(log_class, ...) \
|
||||||
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Debug, \
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Debug, \
|
||||||
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
|
@ -65,3 +61,23 @@ void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsig
|
||||||
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Critical, \
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Critical, \
|
||||||
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
__VA_ARGS__)
|
__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define LOG_TRACE(log_class, fmt, ...) (void(0))
|
||||||
|
#define LOG_DEBUG(log_class, fmt, ...) (void(0))
|
||||||
|
#define LOG_INFO(log_class, ...) \
|
||||||
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Info, \
|
||||||
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
|
__VA_ARGS__)
|
||||||
|
#define LOG_WARNING(log_class, ...) \
|
||||||
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Warning, \
|
||||||
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
|
__VA_ARGS__)
|
||||||
|
#define LOG_ERROR(log_class, ...) \
|
||||||
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Error, \
|
||||||
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
|
__VA_ARGS__)
|
||||||
|
#define LOG_CRITICAL(log_class, ...) \
|
||||||
|
Common::Log::FmtLogMessage(Common::Log::Class::log_class, Common::Log::Level::Critical, \
|
||||||
|
Common::Log::TrimSourcePath(__FILE__), __LINE__, __func__, \
|
||||||
|
__VA_ARGS__)
|
||||||
|
#endif
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
// Uncomment this to disable microprofile. This will get you cleaner profiles when using
|
// Uncomment this to disable microprofile. This will get you cleaner profiles when using
|
||||||
// external sampling profilers like "Very Sleepy", and will improve performance somewhat.
|
// external sampling profilers like "Very Sleepy", and will improve performance somewhat.
|
||||||
// #define MICROPROFILE_ENABLED 0
|
#define MICROPROFILE_ENABLED 0
|
||||||
|
|
||||||
// Customized Citra settings.
|
// Customized Citra settings.
|
||||||
// This file wraps the MicroProfile header so that these are consistent everywhere.
|
// This file wraps the MicroProfile header so that these are consistent everywhere.
|
||||||
|
@ -19,6 +19,9 @@
|
||||||
typedef void* HANDLE;
|
typedef void* HANDLE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED == 0
|
||||||
|
#define MicroProfileOnThreadExit __noop
|
||||||
|
#endif
|
||||||
#include <microprofile.h>
|
#include <microprofile.h>
|
||||||
|
|
||||||
#define MP_RGB(r, g, b) ((r) << 16 | (g) << 8 | (b) << 0)
|
#define MP_RGB(r, g, b) ((r) << 16 | (g) << 8 | (b) << 0)
|
||||||
|
|
|
@ -64,10 +64,12 @@
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
#include "video_core/video_core.h"
|
#include "video_core/video_core.h"
|
||||||
|
|
||||||
|
#if MICROPROFILE == 1
|
||||||
MICROPROFILE_DEFINE(ARM_CPU0, "ARM", "CPU 0", MP_RGB(255, 64, 64));
|
MICROPROFILE_DEFINE(ARM_CPU0, "ARM", "CPU 0", MP_RGB(255, 64, 64));
|
||||||
MICROPROFILE_DEFINE(ARM_CPU1, "ARM", "CPU 1", MP_RGB(255, 64, 64));
|
MICROPROFILE_DEFINE(ARM_CPU1, "ARM", "CPU 1", MP_RGB(255, 64, 64));
|
||||||
MICROPROFILE_DEFINE(ARM_CPU2, "ARM", "CPU 2", MP_RGB(255, 64, 64));
|
MICROPROFILE_DEFINE(ARM_CPU2, "ARM", "CPU 2", MP_RGB(255, 64, 64));
|
||||||
MICROPROFILE_DEFINE(ARM_CPU3, "ARM", "CPU 3", MP_RGB(255, 64, 64));
|
MICROPROFILE_DEFINE(ARM_CPU3, "ARM", "CPU 3", MP_RGB(255, 64, 64));
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
|
@ -290,10 +292,12 @@ struct System::Impl {
|
||||||
exit_locked = false;
|
exit_locked = false;
|
||||||
exit_requested = false;
|
exit_requested = false;
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
microprofile_cpu[0] = MICROPROFILE_TOKEN(ARM_CPU0);
|
microprofile_cpu[0] = MICROPROFILE_TOKEN(ARM_CPU0);
|
||||||
microprofile_cpu[1] = MICROPROFILE_TOKEN(ARM_CPU1);
|
microprofile_cpu[1] = MICROPROFILE_TOKEN(ARM_CPU1);
|
||||||
microprofile_cpu[2] = MICROPROFILE_TOKEN(ARM_CPU2);
|
microprofile_cpu[2] = MICROPROFILE_TOKEN(ARM_CPU2);
|
||||||
microprofile_cpu[3] = MICROPROFILE_TOKEN(ARM_CPU3);
|
microprofile_cpu[3] = MICROPROFILE_TOKEN(ARM_CPU3);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (Settings::values.enable_renderdoc_hotkey) {
|
if (Settings::values.enable_renderdoc_hotkey) {
|
||||||
renderdoc_api = std::make_unique<Tools::RenderdocAPI>();
|
renderdoc_api = std::make_unique<Tools::RenderdocAPI>();
|
||||||
|
@ -946,13 +950,17 @@ void System::RegisterHostThread() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::EnterCPUProfile() {
|
void System::EnterCPUProfile() {
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
std::size_t core = impl->kernel.GetCurrentHostThreadID();
|
std::size_t core = impl->kernel.GetCurrentHostThreadID();
|
||||||
impl->dynarmic_ticks[core] = MicroProfileEnter(impl->microprofile_cpu[core]);
|
impl->dynarmic_ticks[core] = MicroProfileEnter(impl->microprofile_cpu[core]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::ExitCPUProfile() {
|
void System::ExitCPUProfile() {
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
std::size_t core = impl->kernel.GetCurrentHostThreadID();
|
std::size_t core = impl->kernel.GetCurrentHostThreadID();
|
||||||
MicroProfileLeave(impl->microprofile_cpu[core], impl->dynarmic_ticks[core]);
|
MicroProfileLeave(impl->microprofile_cpu[core], impl->dynarmic_ticks[core]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool System::IsMulticore() const {
|
bool System::IsMulticore() const {
|
||||||
|
|
|
@ -46,7 +46,9 @@
|
||||||
#include "core/hle/service/sm/sm.h"
|
#include "core/hle/service/sm/sm.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70));
|
MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70));
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
@ -1279,11 +1281,15 @@ void KernelCore::ExceptionalExitApplication() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelCore::EnterSVCProfile() {
|
void KernelCore::EnterSVCProfile() {
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
impl->svc_ticks[CurrentPhysicalCoreIndex()] = MicroProfileEnter(MICROPROFILE_TOKEN(Kernel_SVC));
|
impl->svc_ticks[CurrentPhysicalCoreIndex()] = MicroProfileEnter(MICROPROFILE_TOKEN(Kernel_SVC));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelCore::ExitSVCProfile() {
|
void KernelCore::ExitSVCProfile() {
|
||||||
|
#if MICROPROFILE_ENABLED == 1
|
||||||
MicroProfileLeave(MICROPROFILE_TOKEN(Kernel_SVC), impl->svc_ticks[CurrentPhysicalCoreIndex()]);
|
MicroProfileLeave(MICROPROFILE_TOKEN(Kernel_SVC), impl->svc_ticks[CurrentPhysicalCoreIndex()]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() {
|
Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() {
|
||||||
|
|
|
@ -67,7 +67,7 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_,
|
||||||
{19, &ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout, "GetDesirableKeyboardLayout"},
|
{19, &ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout, "GetDesirableKeyboardLayout"},
|
||||||
{20, nullptr, "PopExtraStorage"},
|
{20, nullptr, "PopExtraStorage"},
|
||||||
{25, nullptr, "GetPopExtraStorageEvent"},
|
{25, nullptr, "GetPopExtraStorageEvent"},
|
||||||
{30, nullptr, "UnpopInData"},
|
{30, &ILibraryAppletSelfAccessor::UnpopInData, "UnpopInData"},
|
||||||
{31, nullptr, "UnpopExtraStorage"},
|
{31, nullptr, "UnpopExtraStorage"},
|
||||||
{40, nullptr, "GetIndirectLayerProducerHandle"},
|
{40, nullptr, "GetIndirectLayerProducerHandle"},
|
||||||
{50, nullptr, "ReportVisibleError"},
|
{50, nullptr, "ReportVisibleError"},
|
||||||
|
@ -226,6 +226,13 @@ void ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(HLERequestContext& c
|
||||||
rb.Push<u32>(0);
|
rb.Push<u32>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ILibraryAppletSelfAccessor::UnpopInData(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
void ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage(HLERequestContext& ctx) {
|
void ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage(HLERequestContext& ctx) {
|
||||||
// FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage
|
// FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage
|
||||||
auto identity = GetCallerIdentity(applet);
|
auto identity = GetCallerIdentity(applet);
|
||||||
|
|
|
@ -31,6 +31,7 @@ private:
|
||||||
void ExitProcessAndReturn(HLERequestContext& ctx);
|
void ExitProcessAndReturn(HLERequestContext& ctx);
|
||||||
void GetCallerAppletIdentityInfo(HLERequestContext& ctx);
|
void GetCallerAppletIdentityInfo(HLERequestContext& ctx);
|
||||||
void GetDesirableKeyboardLayout(HLERequestContext& ctx);
|
void GetDesirableKeyboardLayout(HLERequestContext& ctx);
|
||||||
|
void UnpopInData(HLERequestContext& ctx);
|
||||||
void GetMainAppletApplicationDesiredLanguage(HLERequestContext& ctx);
|
void GetMainAppletApplicationDesiredLanguage(HLERequestContext& ctx);
|
||||||
void GetCurrentApplicationId(HLERequestContext& ctx);
|
void GetCurrentApplicationId(HLERequestContext& ctx);
|
||||||
void GetMainAppletAvailableUsers(HLERequestContext& ctx);
|
void GetMainAppletAvailableUsers(HLERequestContext& ctx);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "core/hle/service/am/frontend/applets.h"
|
#include "core/hle/service/am/frontend/applets.h"
|
||||||
#include "core/hle/service/am/library_applet_accessor.h"
|
#include "core/hle/service/am/library_applet_accessor.h"
|
||||||
#include "core/hle/service/am/process_winding_controller.h"
|
#include "core/hle/service/am/process_winding_controller.h"
|
||||||
|
#include "core/hle/service/am/service/storage.h"
|
||||||
#include "core/hle/service/ipc_helpers.h"
|
#include "core/hle/service/ipc_helpers.h"
|
||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
@ -15,11 +16,11 @@ IProcessWindingController::IProcessWindingController(Core::System& system_,
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &IProcessWindingController::GetLaunchReason, "GetLaunchReason"},
|
{0, &IProcessWindingController::GetLaunchReason, "GetLaunchReason"},
|
||||||
{11, &IProcessWindingController::OpenCallingLibraryApplet, "OpenCallingLibraryApplet"},
|
{11, &IProcessWindingController::OpenCallingLibraryApplet, "OpenCallingLibraryApplet"},
|
||||||
{21, nullptr, "PushContext"},
|
{21, &IProcessWindingController::PushContext, "PushContext"},
|
||||||
{22, nullptr, "PopContext"},
|
{22, nullptr, "PopContext"},
|
||||||
{23, nullptr, "CancelWindingReservation"},
|
{23, nullptr, "CancelWindingReservation"},
|
||||||
{30, nullptr, "WindAndDoReserved"},
|
{30, &IProcessWindingController::WindAndDoReserved, "WindAndDoReserved"},
|
||||||
{40, nullptr, "ReserveToStartAndWaitAndUnwindThis"},
|
{40, &IProcessWindingController::ReserveToStartAndWaitAndUnwindThis, "ReserveToStartAndWaitAndUnwindThis"},
|
||||||
{41, nullptr, "ReserveToStartAndWait"},
|
{41, nullptr, "ReserveToStartAndWait"},
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -53,4 +54,25 @@ void IProcessWindingController::OpenCallingLibraryApplet(HLERequestContext& ctx)
|
||||||
caller_applet);
|
caller_applet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IProcessWindingController::PushContext(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IProcessWindingController::ReserveToStartAndWaitAndUnwindThis(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IProcessWindingController::WindAndDoReserved(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
struct Applet;
|
struct Applet;
|
||||||
|
class IStorage;
|
||||||
|
|
||||||
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
|
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
|
||||||
public:
|
public:
|
||||||
|
@ -17,6 +18,9 @@ public:
|
||||||
private:
|
private:
|
||||||
void GetLaunchReason(HLERequestContext& ctx);
|
void GetLaunchReason(HLERequestContext& ctx);
|
||||||
void OpenCallingLibraryApplet(HLERequestContext& ctx);
|
void OpenCallingLibraryApplet(HLERequestContext& ctx);
|
||||||
|
void PushContext(HLERequestContext& ctx);
|
||||||
|
void WindAndDoReserved(HLERequestContext& ctx);
|
||||||
|
void ReserveToStartAndWaitAndUnwindThis(HLERequestContext& ctx);
|
||||||
|
|
||||||
const std::shared_ptr<Applet> applet;
|
const std::shared_ptr<Applet> applet;
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,7 +63,7 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_,
|
||||||
{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"},
|
{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"},
|
||||||
{20, nullptr, "PopExtraStorage"},
|
{20, nullptr, "PopExtraStorage"},
|
||||||
{25, nullptr, "GetPopExtraStorageEvent"},
|
{25, nullptr, "GetPopExtraStorageEvent"},
|
||||||
{30, nullptr, "UnpopInData"},
|
{30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"},
|
||||||
{31, nullptr, "UnpopExtraStorage"},
|
{31, nullptr, "UnpopExtraStorage"},
|
||||||
{40, nullptr, "GetIndirectLayerProducerHandle"},
|
{40, nullptr, "GetIndirectLayerProducerHandle"},
|
||||||
{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"},
|
{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"},
|
||||||
|
@ -210,6 +210,11 @@ Result ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(Out<u32> out_desir
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::UnpopInData(SharedPointer<IStorage> storage) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) {
|
Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) {
|
||||||
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
||||||
error_code.number);
|
error_code.number);
|
||||||
|
|
|
@ -66,6 +66,7 @@ private:
|
||||||
Out<s32> out_count,
|
Out<s32> out_count,
|
||||||
OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info);
|
OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info);
|
||||||
Result GetDesirableKeyboardLayout(Out<u32> out_desirable_layout);
|
Result GetDesirableKeyboardLayout(Out<u32> out_desirable_layout);
|
||||||
|
Result UnpopInData(SharedPointer<IStorage> storage);
|
||||||
Result ReportVisibleError(ErrorCode error_code);
|
Result ReportVisibleError(ErrorCode error_code);
|
||||||
Result ReportVisibleErrorWithErrorContext(
|
Result ReportVisibleErrorWithErrorContext(
|
||||||
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);
|
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "core/hle/service/am/frontend/applets.h"
|
#include "core/hle/service/am/frontend/applets.h"
|
||||||
#include "core/hle/service/am/service/library_applet_accessor.h"
|
#include "core/hle/service/am/service/library_applet_accessor.h"
|
||||||
#include "core/hle/service/am/service/process_winding_controller.h"
|
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||||
|
#include "core/hle/service/am/service/storage.h"
|
||||||
#include "core/hle/service/cmif_serialization.h"
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
@ -15,11 +16,11 @@ IProcessWindingController::IProcessWindingController(Core::System& system_,
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
||||||
{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
||||||
{21, nullptr, "PushContext"},
|
{21, D<&IProcessWindingController::PushContext>, "PushContext"},
|
||||||
{22, nullptr, "PopContext"},
|
{22, nullptr, "PopContext"},
|
||||||
{23, nullptr, "CancelWindingReservation"},
|
{23, nullptr, "CancelWindingReservation"},
|
||||||
{30, nullptr, "WindAndDoReserved"},
|
{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"},
|
||||||
{40, nullptr, "ReserveToStartAndWaitAndUnwindThis"},
|
{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"},
|
||||||
{41, nullptr, "ReserveToStartAndWait"},
|
{41, nullptr, "ReserveToStartAndWait"},
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -51,4 +52,20 @@ Result IProcessWindingController::OpenCallingLibraryApplet(
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result IProcessWindingController::PushContext(SharedPointer<IStorage> storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IProcessWindingController::ReserveToStartAndWaitAndUnwindThis(
|
||||||
|
SharedPointer<ILibraryAppletAccessor> library_applet) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IProcessWindingController::WindAndDoReserved() {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace Service::AM {
|
||||||
|
|
||||||
struct Applet;
|
struct Applet;
|
||||||
class ILibraryAppletAccessor;
|
class ILibraryAppletAccessor;
|
||||||
|
class IStorage;
|
||||||
|
|
||||||
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
|
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
|
||||||
public:
|
public:
|
||||||
|
@ -21,6 +22,9 @@ private:
|
||||||
Result GetLaunchReason(Out<AppletProcessLaunchReason> out_launch_reason);
|
Result GetLaunchReason(Out<AppletProcessLaunchReason> out_launch_reason);
|
||||||
Result OpenCallingLibraryApplet(
|
Result OpenCallingLibraryApplet(
|
||||||
Out<SharedPointer<ILibraryAppletAccessor>> out_calling_library_applet);
|
Out<SharedPointer<ILibraryAppletAccessor>> out_calling_library_applet);
|
||||||
|
Result PushContext(SharedPointer<IStorage> storage);
|
||||||
|
Result ReserveToStartAndWaitAndUnwindThis(SharedPointer<ILibraryAppletAccessor> library_applet);
|
||||||
|
Result WindAndDoReserved();
|
||||||
|
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
{20401, nullptr, "SyncBlockedUserList"},
|
{20401, nullptr, "SyncBlockedUserList"},
|
||||||
{20500, nullptr, "GetProfileExtraList"},
|
{20500, nullptr, "GetProfileExtraList"},
|
||||||
{20501, nullptr, "GetRelationship"},
|
{20501, nullptr, "GetRelationship"},
|
||||||
{20600, nullptr, "GetUserPresenceView"},
|
{20600, &IFriendService::GetUserPresenceView, "GetUserPresenceView"},
|
||||||
{20700, nullptr, "GetPlayHistoryList"},
|
{20700, nullptr, "GetPlayHistoryList"},
|
||||||
{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
|
{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
|
||||||
{20800, nullptr, "LoadUserSetting"},
|
{20800, nullptr, "LoadUserSetting"},
|
||||||
|
@ -261,6 +261,13 @@ private:
|
||||||
rb.Push(0);
|
rb.Push(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetUserPresenceView(HLERequestContext& ctx) {
|
||||||
|
LOG_DEBUG(Service_Friend, "(STUBBED) called, check in out");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
KernelHelpers::ServiceContext service_context;
|
KernelHelpers::ServiceContext service_context;
|
||||||
|
|
||||||
Kernel::KEvent* completion_event;
|
Kernel::KEvent* completion_event;
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
|
|
||||||
void CreateFriendService(HLERequestContext& ctx);
|
void CreateFriendService(HLERequestContext& ctx);
|
||||||
void CreateNotificationService(HLERequestContext& ctx);
|
void CreateNotificationService(HLERequestContext& ctx);
|
||||||
|
void GetUserPresenceView(HLERequestContext& ctx);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<Module> module;
|
std::shared_ptr<Module> module;
|
||||||
|
|
|
@ -18,6 +18,7 @@ set(SHADER_FILES
|
||||||
blit_color_float.frag
|
blit_color_float.frag
|
||||||
block_linear_unswizzle_2d.comp
|
block_linear_unswizzle_2d.comp
|
||||||
block_linear_unswizzle_3d.comp
|
block_linear_unswizzle_3d.comp
|
||||||
|
convert_abgr8_srgb_to_d24s8.frag
|
||||||
convert_abgr8_to_d24s8.frag
|
convert_abgr8_to_d24s8.frag
|
||||||
convert_abgr8_to_d32f.frag
|
convert_abgr8_to_d32f.frag
|
||||||
convert_d32f_to_abgr8.frag
|
convert_d32f_to_abgr8.frag
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#version 450
|
||||||
|
#extension GL_ARB_shader_stencil_export : require
|
||||||
|
|
||||||
|
precision highp int;
|
||||||
|
precision highp float;
|
||||||
|
|
||||||
|
layout(binding = 0) uniform sampler2D color_texture;
|
||||||
|
|
||||||
|
// Utility function to convert sRGB to linear space
|
||||||
|
highp float srgbToLinear(highp float srgb) {
|
||||||
|
if (srgb <= 0.04045)
|
||||||
|
return srgb / 12.92;
|
||||||
|
else
|
||||||
|
return pow((srgb + 0.055) / 1.055, 2.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
ivec2 coord = ivec2(gl_FragCoord.xy);
|
||||||
|
|
||||||
|
// Fetch sRGB color and convert to linear space
|
||||||
|
vec4 srgbColor = texelFetch(color_texture, coord, 0);
|
||||||
|
highp float r_linear = srgbToLinear(srgbColor.r);
|
||||||
|
highp float g_linear = srgbToLinear(srgbColor.g);
|
||||||
|
highp float b_linear = srgbToLinear(srgbColor.b);
|
||||||
|
|
||||||
|
// Compute luminance for depth
|
||||||
|
highp float luminance = 0.2126 * r_linear + 0.7152 * g_linear + 0.0722 * b_linear;
|
||||||
|
highp uint depth_val = uint(luminance * (exp2(24.0) - 1.0));
|
||||||
|
|
||||||
|
// Extract the stencil value from the alpha component
|
||||||
|
highp uint stencil_val = uint(srgbColor.a * (exp2(8) - 1.0));
|
||||||
|
|
||||||
|
// Pack stencil and depth values into a single uint
|
||||||
|
highp uint byte0 = stencil_val << 24;
|
||||||
|
highp uint byte1 = (depth_val & 0x00FF0000u) >> 16;
|
||||||
|
highp uint byte2 = (depth_val & 0x0000FF00u) >> 8;
|
||||||
|
highp uint byte3 = depth_val & 0x000000FFu;
|
||||||
|
highp uint depth_stencil_unorm = byte0 | (byte1 << 16) | (byte2 << 8) | byte3;
|
||||||
|
|
||||||
|
// Set depth and stencil values for the fragment
|
||||||
|
gl_FragDepth = float(depth_stencil_unorm & 0x00FFFFFFu) / (exp2(24.0) - 1.0);
|
||||||
|
gl_FragStencilRefARB = int(depth_stencil_unorm >> 24);
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "video_core/host_shaders/blit_color_float_frag_spv.h"
|
#include "video_core/host_shaders/blit_color_float_frag_spv.h"
|
||||||
|
#include "video_core/host_shaders/convert_abgr8_srgb_to_d24s8_frag_spv.h"
|
||||||
#include "video_core/host_shaders/convert_abgr8_to_d24s8_frag_spv.h"
|
#include "video_core/host_shaders/convert_abgr8_to_d24s8_frag_spv.h"
|
||||||
#include "video_core/host_shaders/convert_abgr8_to_d32f_frag_spv.h"
|
#include "video_core/host_shaders/convert_abgr8_to_d32f_frag_spv.h"
|
||||||
#include "video_core/host_shaders/convert_d24s8_to_abgr8_frag_spv.h"
|
#include "video_core/host_shaders/convert_d24s8_to_abgr8_frag_spv.h"
|
||||||
|
@ -434,6 +435,7 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_,
|
||||||
clear_stencil_frag(BuildShader(device, VULKAN_DEPTHSTENCIL_CLEAR_FRAG_SPV)),
|
clear_stencil_frag(BuildShader(device, VULKAN_DEPTHSTENCIL_CLEAR_FRAG_SPV)),
|
||||||
convert_depth_to_float_frag(BuildShader(device, CONVERT_DEPTH_TO_FLOAT_FRAG_SPV)),
|
convert_depth_to_float_frag(BuildShader(device, CONVERT_DEPTH_TO_FLOAT_FRAG_SPV)),
|
||||||
convert_float_to_depth_frag(BuildShader(device, CONVERT_FLOAT_TO_DEPTH_FRAG_SPV)),
|
convert_float_to_depth_frag(BuildShader(device, CONVERT_FLOAT_TO_DEPTH_FRAG_SPV)),
|
||||||
|
convert_abgr8_srgb_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_SRGB_TO_D24S8_FRAG_SPV)),
|
||||||
convert_abgr8_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_TO_D24S8_FRAG_SPV)),
|
convert_abgr8_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_TO_D24S8_FRAG_SPV)),
|
||||||
convert_abgr8_to_d32f_frag(BuildShader(device, CONVERT_ABGR8_TO_D32F_FRAG_SPV)),
|
convert_abgr8_to_d32f_frag(BuildShader(device, CONVERT_ABGR8_TO_D32F_FRAG_SPV)),
|
||||||
convert_d32f_to_abgr8_frag(BuildShader(device, CONVERT_D32F_TO_ABGR8_FRAG_SPV)),
|
convert_d32f_to_abgr8_frag(BuildShader(device, CONVERT_D32F_TO_ABGR8_FRAG_SPV)),
|
||||||
|
@ -554,6 +556,13 @@ void BlitImageHelper::ConvertR16ToD16(const Framebuffer* dst_framebuffer,
|
||||||
Convert(*convert_r16_to_d16_pipeline, dst_framebuffer, src_image_view);
|
Convert(*convert_r16_to_d16_pipeline, dst_framebuffer, src_image_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlitImageHelper::ConvertABGR8SRGBToD24S8(const Framebuffer* dst_framebuffer,
|
||||||
|
const ImageView& src_image_view) {
|
||||||
|
ConvertPipelineDepthTargetEx(convert_abgr8_srgb_to_d24s8_pipeline,
|
||||||
|
dst_framebuffer->RenderPass(), convert_abgr8_srgb_to_d24s8_frag);
|
||||||
|
Convert(*convert_abgr8_srgb_to_d24s8_pipeline, dst_framebuffer, src_image_view);
|
||||||
|
}
|
||||||
|
|
||||||
void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer,
|
void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer,
|
||||||
const ImageView& src_image_view) {
|
const ImageView& src_image_view) {
|
||||||
ConvertPipelineDepthTargetEx(convert_abgr8_to_d24s8_pipeline, dst_framebuffer->RenderPass(),
|
ConvertPipelineDepthTargetEx(convert_abgr8_to_d24s8_pipeline, dst_framebuffer->RenderPass(),
|
||||||
|
|
|
@ -67,6 +67,9 @@ public:
|
||||||
|
|
||||||
void ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
|
void ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
|
||||||
|
|
||||||
|
void ConvertABGR8SRGBToD24S8(const Framebuffer* dst_framebuffer,
|
||||||
|
const ImageView& src_image_view);
|
||||||
|
|
||||||
void ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
|
void ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
|
||||||
|
|
||||||
void ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view);
|
void ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view);
|
||||||
|
@ -131,7 +134,7 @@ private:
|
||||||
vk::ShaderModule clear_stencil_frag;
|
vk::ShaderModule clear_stencil_frag;
|
||||||
vk::ShaderModule convert_depth_to_float_frag;
|
vk::ShaderModule convert_depth_to_float_frag;
|
||||||
vk::ShaderModule convert_float_to_depth_frag;
|
vk::ShaderModule convert_float_to_depth_frag;
|
||||||
vk::ShaderModule convert_abgr8_to_d24s8_frag;
|
vk::ShaderModule convert_abgr8_srgb_to_d24s8_frag, convert_abgr8_to_d24s8_frag;
|
||||||
vk::ShaderModule convert_abgr8_to_d32f_frag;
|
vk::ShaderModule convert_abgr8_to_d32f_frag;
|
||||||
vk::ShaderModule convert_d32f_to_abgr8_frag;
|
vk::ShaderModule convert_d32f_to_abgr8_frag;
|
||||||
vk::ShaderModule convert_d24s8_to_abgr8_frag;
|
vk::ShaderModule convert_d24s8_to_abgr8_frag;
|
||||||
|
@ -151,7 +154,7 @@ private:
|
||||||
vk::Pipeline convert_r32_to_d32_pipeline;
|
vk::Pipeline convert_r32_to_d32_pipeline;
|
||||||
vk::Pipeline convert_d16_to_r16_pipeline;
|
vk::Pipeline convert_d16_to_r16_pipeline;
|
||||||
vk::Pipeline convert_r16_to_d16_pipeline;
|
vk::Pipeline convert_r16_to_d16_pipeline;
|
||||||
vk::Pipeline convert_abgr8_to_d24s8_pipeline;
|
vk::Pipeline convert_abgr8_srgb_to_d24s8_pipeline, convert_abgr8_to_d24s8_pipeline;
|
||||||
vk::Pipeline convert_abgr8_to_d32f_pipeline;
|
vk::Pipeline convert_abgr8_to_d32f_pipeline;
|
||||||
vk::Pipeline convert_d32f_to_abgr8_pipeline;
|
vk::Pipeline convert_d32f_to_abgr8_pipeline;
|
||||||
vk::Pipeline convert_d24s8_to_abgr8_pipeline;
|
vk::Pipeline convert_d24s8_to_abgr8_pipeline;
|
||||||
|
|
|
@ -1230,11 +1230,14 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
|
||||||
return blit_image_helper.ConvertR16ToD16(dst, src_view);
|
return blit_image_helper.ConvertR16ToD16(dst, src_view);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PixelFormat::S8_UINT_D24_UNORM:
|
case PixelFormat::S8_UINT_D24_UNORM: // TODO: A8B8G8R8_SRGB
|
||||||
if (src_view.format == PixelFormat::A8B8G8R8_UNORM ||
|
if (src_view.format == PixelFormat::A8B8G8R8_UNORM ||
|
||||||
src_view.format == PixelFormat::B8G8R8A8_UNORM) {
|
src_view.format == PixelFormat::B8G8R8A8_UNORM) {
|
||||||
return blit_image_helper.ConvertABGR8ToD24S8(dst, src_view);
|
return blit_image_helper.ConvertABGR8ToD24S8(dst, src_view);
|
||||||
}
|
}
|
||||||
|
if (src_view.format == PixelFormat::A8B8G8R8_SRGB) {
|
||||||
|
return blit_image_helper.ConvertABGR8SRGBToD24S8(dst, src_view);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PixelFormat::D32_FLOAT:
|
case PixelFormat::D32_FLOAT:
|
||||||
if (src_view.format == PixelFormat::A8B8G8R8_UNORM ||
|
if (src_view.format == PixelFormat::A8B8G8R8_UNORM ||
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||||
"name": "sudachi",
|
"name": "sudachi",
|
||||||
"builtin-baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6",
|
"builtin-baseline": "1cdb5e0b24c303b41fcac0dce00baf21881f6da2",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"boost-algorithm",
|
"boost-algorithm",
|
||||||
|
|
Loading…
Reference in New Issue