Compare commits

...
Sign in to create a new pull request.

10 commits
d24 ... master

Author SHA1 Message Date
896bfcdaaa
[vk] revert pApplicationName (#144)
Reverts Vulkan pApplicationName to fix rdna3 lines appearing (tested on totk gloom)

Co-authored-by: Maufeat <sahyno1996@gmail.com>
Reviewed-on: eden-emu/eden#144
Co-authored-by: Maufeat <maufeat@eden-emu.dev>
Co-committed-by: Maufeat <maufeat@eden-emu.dev>
2025-07-28 01:10:16 +02:00
9ccb792d29
[externals] fix cpp-httplib on Gentoo
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-07-27 18:31:58 -04:00
bbeb7dd56b
[ssl] add and unstub alpn option + functions (#142)
Should fix Jackbox 7,8,9,10 unable to connect to server errors. (See discord issues)

Co-authored-by: Maufeat <sahyno1996@gmail.com>
Reviewed-on: eden-emu/eden#142
Co-authored-by: Maufeat <maufeat@eden-emu.dev>
Co-committed-by: Maufeat <maufeat@eden-emu.dev>
2025-07-27 22:06:22 +02:00
eeb68768d6
[vk] Exclude size equal alpha different copies from incompatible copy (#138)
Should fix bugs in Splatoon 2 and TotK

Co-authored-by: Maufeat <sahyno1996@gmail.com>
Reviewed-on: eden-emu/eden#138
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
2025-07-27 19:56:22 +02:00
0b29fb7c8a
[audio_core] Revert EA3835 audio sink changes (#136)
Fixes diablo/totk audio stutters

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: eden-emu/eden#136
2025-07-27 19:46:54 +02:00
b2914247c3
[cmake] Build presets and System profiles (#135)
- Build Preset (Linux only): enables arch optimizations, e.g. generic,
  v3, zen2/4, armv8, armv9
- System Profiles: currently only steamdeck, uses an older sdl commit to
  fix virtual gamepad bug

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: eden-emu/eden#135
2025-07-27 06:36:33 +02:00
b5bbe6d865
[externals] Update some submodules (#119)
This updates some submodules to keep the project in sync with the latest, stable fixes.

Reviewed-on: eden-emu/eden#119
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
2025-07-27 02:41:08 +02:00
77a8f7b6a7
[vk, hle] fix storage buffer cache, unstubbed TryPopFriendInvitation (#129)
This fixes Jamboree + unstubes friend invitation channel which spammed a lot while testing jamboree.

Culprit was: #2

Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-authored-by: crueter <crueter@eden-emu.dev>
Reviewed-on: eden-emu/eden#129
Co-authored-by: Maufeat <maufeat@eden-emu.dev>
Co-committed-by: Maufeat <maufeat@eden-emu.dev>
2025-07-27 02:37:29 +02:00
3bcd5f95fe
[git] fix dup xbyak (#140)
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: eden-emu/eden#140
2025-07-27 02:36:18 +02:00
12d8cf79ea
Revert "[nvnflinger] unstub AdjustRefcount (#120)"
This reverts commit 410e782291.
2025-07-26 20:20:03 -04:00
31 changed files with 365 additions and 144 deletions

View file

@ -3,47 +3,53 @@
# SPDX-FileCopyrightText: 2025 eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
case "$1" in
amd64|"")
echo "Making amd64-v3 optimized build of Eden"
ARCH="amd64_v3"
ARCH_FLAGS="-march=x86-64-v3"
;;
steamdeck|zen2)
echo "Making Steam Deck (Zen 2) optimized build of Eden"
ARCH="steamdeck"
ARCH_FLAGS="-march=znver2 -mtune=znver2"
;;
rog-ally|allyx|zen4)
echo "Making ROG Ally X (Zen 4) optimized build of Eden"
ARCH="rog-ally-x"
ARCH_FLAGS="-march=znver4 -mtune=znver4"
;;
legacy)
echo "Making amd64 generic build of Eden"
ARCH=amd64
ARCH_FLAGS="-march=x86-64 -mtune=generic"
;;
aarch64)
echo "Making armv8-a build of Eden"
ARCH=aarch64
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
;;
armv9)
echo "Making armv9-a build of Eden"
ARCH=armv9
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
;;
native)
echo "Making native build of Eden"
ARCH="$(uname -m)"
ARCH_FLAGS="-march=native -mtune=native"
;;
*)
echo "Invalid target $1 specified, must be one of native, amd64, steamdeck, zen2, allyx, rog-ally, zen4, legacy, aarch64, armv9"
exit 1
;;
amd64 | "")
echo "Making amd64-v3 optimized build of Eden"
ARCH="amd64_v3"
ARCH_FLAGS="-march=x86-64-v3"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=v3)
;;
steamdeck | zen2)
echo "Making Steam Deck (Zen 2) optimized build of Eden"
ARCH="steamdeck"
ARCH_FLAGS="-march=znver2 -mtune=znver2"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
;;
rog-ally | allyx | zen4)
echo "Making ROG Ally X (Zen 4) optimized build of Eden"
ARCH="rog-ally-x"
ARCH_FLAGS="-march=znver4 -mtune=znver4"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
;;
legacy)
echo "Making amd64 generic build of Eden"
ARCH=amd64
ARCH_FLAGS="-march=x86-64 -mtune=generic"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
;;
aarch64)
echo "Making armv8-a build of Eden"
ARCH=aarch64
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
;;
armv9)
echo "Making armv9-a build of Eden"
ARCH=armv9
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=armv9)
;;
native)
echo "Making native build of Eden"
ARCH="$(uname -m)"
ARCH_FLAGS="-march=native -mtune=native"
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=native)
;;
*)
echo "Invalid target $1 specified, must be one of native, amd64, steamdeck, zen2, allyx, rog-ally, zen4, legacy, aarch64, armv9"
exit 1
;;
esac
export ARCH_FLAGS="$ARCH_FLAGS -O3"
@ -55,10 +61,10 @@ fi
if [ "$1" != "" ]; then shift; fi
if [ "$TARGET" = "appimage" ]; then
export EXTRA_CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
else
# For the linux-fresh verification target, verify compilation without PCH as well.
export EXTRA_CMAKE_FLAGS=(-DYUZU_USE_PRECOMPILED_HEADERS=OFF)
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_PRECOMPILED_HEADERS=OFF)
fi
if [ "$DEVEL" != "true" ]; then
@ -86,7 +92,7 @@ export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DENABLE_QT_TRANSLATION=ON \
-DENABLE_QT_TRANSLATION=ON \
-DUSE_DISCORD_PRESENCE=ON \
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
@ -99,12 +105,12 @@ cmake .. -G Ninja \
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
-DYUZU_USE_FASTER_LD=ON \
-DYUZU_ENABLE_LTO=ON \
"${EXTRA_CMAKE_FLAGS[@]}"
"${EXTRA_CMAKE_FLAGS[@]}"
ninja -j${NPROC}
if [ -d "bin/Release" ]; then
strip -s bin/Release/*
strip -s bin/Release/*
else
strip -s bin/*
strip -s bin/*
fi

View file

@ -92,7 +92,6 @@ chmod +x ./sharun-aio
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
../$BUILDDIR/bin/eden* \
$LIBDIR/lib*GL*.so* \
$LIBDIR/libSDL2*.so* \
$LIBDIR/dri/* \
$LIBDIR/vdpau/* \
$LIBDIR/libvulkan* \

6
.gitmodules vendored
View file

@ -16,9 +16,6 @@
[submodule "opus"]
path = externals/opus
url = https://github.com/xiph/opus.git
[submodule "SDL"]
path = externals/SDL
url = https://github.com/libsdl-org/SDL.git
[submodule "cpp-httplib"]
path = externals/cpp-httplib
url = https://github.com/yhirose/cpp-httplib.git
@ -49,9 +46,6 @@
[submodule "externals/dynarmic/externals/unordered_dense"]
path = externals/dynarmic/externals/unordered_dense
url = https://github.com/Lizzie841/unordered_dense.git
[submodule "externals/dynarmic/externals/xbyak"]
path = externals/dynarmic/externals/xbyak
url = https://github.com/Lizzie841/xbyak.git
[submodule "externals/dynarmic/externals/zycore-c"]
path = externals/dynarmic/externals/zycore-c
url = https://github.com/zyantific/zycore-c.git

View file

@ -33,9 +33,9 @@ endif()
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "ENABLE_SDL2;NOT MSVC" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "ENABLE_SDL2;NOT MSVC" OFF)
else()
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
endif()
cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF)
@ -332,6 +332,41 @@ if (YUZU_ROOM)
add_definitions(-DYUZU_ROOM)
endif()
# Build/optimization presets
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if (ARCHITECTURE_x86_64)
set(YUZU_BUILD_PRESET "generic" CACHE STRING "Build preset to use. One of: generic, v3, zen2, zen4, native")
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -mtune=generic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64 -mtune=generic")
elseif (${YUZU_BUILD_PRESET} STREQUAL "v3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64-v3 -mtune=generic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64-v3 -mtune=generic")
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=znver2 -mtune=znver2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=znver2 -mtune=znver2")
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=znver4 -mtune=znver4")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=znver4 -mtune=znver4")
elseif (${YUZU_BUILD_PRESET} STREQUAL "native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native")
endif()
elseif(ARCHITECTURE_arm64)
set(YUZU_BUILD_PRESET "generic" CACHE STRING "Build preset to use. One of: generic, armv9")
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a -mtune=generic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a -mtune=generic")
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv9-a -mtune=generic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv9-a -mtune=generic")
endif()
endif()
endif()
# Other presets, e.g. steamdeck
set(YUZU_SYSTEM_PROFILE "generic" CACHE STRING "CMake and Externals profile to use. One of: generic, steamdeck")
# Configure C++ standard
# ===========================
@ -420,6 +455,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
endif()
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package
# TODO(crueter): combine this all with CPM.
if (ENABLE_SDL2)
if (YUZU_USE_BUNDLED_SDL2)
# Detect toolchain and platform

View file

@ -83,7 +83,18 @@ if (YUZU_USE_EXTERNAL_SDL2)
set(SDL_FILE ON)
endif()
add_subdirectory(SDL)
include(CPM)
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm)
set(CPM_USE_LOCAL_PACKAGES OFF)
if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck")
set(SDL_HASH cc016b0046)
set(SDL_PIPEWIRE OFF) # build errors out with this on
else()
set(SDL_HASH 2e4c12cd2c)
endif()
CPMAddPackage("gh:libsdl-org/SDL#${SDL_HASH}")
endif()
# ENet

1
externals/SDL vendored

@ -1 +0,0 @@
Subproject commit 2e4c12cd2cb2c5d0b60ef2196b400339591e733c

@ -1 +1 @@
Subproject commit 16cedde3564629c43808401ad1eb3ca6ef24709a
Subproject commit 89268a6d17fc87003b209a1422c17ab288be99a0

@ -1 +1 @@
Subproject commit f216bb107bfc6d99a9605572963613e828b10880
Subproject commit df2e3581520f36776cd42b9fec3ec4a51ab878ef

@ -1 +1 @@
Subproject commit 6ec8481c8a13db586d7b3ba58f4eb9bbf017edf0
Subproject commit 1076b348abd17859a116f4b111c43d58a588a086

2
externals/cubeb vendored

@ -1 +1 @@
Subproject commit 832fcf38e600bf80b4b728a3e0227403088d992c
Subproject commit fa021607121360af7c171d881dc5bc8af7bb56eb

View file

@ -64,12 +64,13 @@ if (NOT TARGET ankerl::unordered_dense)
endif()
# xbyak
# uncomment if in an independent repo.
if (NOT TARGET xbyak::xbyak)
if ("x86_64" IN_LIST ARCHITECTURE)
add_subdirectory(xbyak)
endif()
endif()
# if (NOT TARGET xbyak::xbyak)
# if ("x86_64" IN_LIST ARCHITECTURE)
# add_subdirectory(xbyak)
# endif()
# endif()
# zydis

@ -1 +0,0 @@
Subproject commit 12557954c68a780563f9ab9fc24a3a156c96cba1

@ -1 +1 @@
Subproject commit c060e9ce30ac2e3ffb49d94209c4dae77b6642f7
Subproject commit 3dbfa16f0cd9e8ed4fec916c6c00f41c738cb8f4

2
externals/opus vendored

@ -1 +1 @@
Subproject commit df02d25f0c6334a60f8c01c5ecf63081845d6c9d
Subproject commit 5ded705cf4ffa13702c78eebecea0fdb2f4ef0de

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -334,6 +337,48 @@ std::vector<std::string> ListCubebSinkDevices(bool capture) {
return device_list;
}
/* REVERSION TO 3833 - function GetCubebLatency REINTRODUCED FROM 3833 - DIABLO 3 FIX */
u32 GetCubebLatency() {
cubeb* ctx;
#ifdef _WIN32
auto com_init_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
#endif
// Init cubeb
if (cubeb_init(&ctx, "yuzu Latency Getter", nullptr) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "cubeb_init failed");
// Return a large latency so we choose SDL instead.
return 10000u;
}
#ifdef _WIN32
if (SUCCEEDED(com_init_result)) {
CoUninitialize();
}
#endif
// Get min latency
cubeb_stream_params params{};
params.rate = TargetSampleRate;
params.channels = 2;
params.format = CUBEB_SAMPLE_S16LE;
params.prefs = CUBEB_STREAM_PREF_NONE;
params.layout = CUBEB_LAYOUT_STEREO;
u32 latency{0};
const auto latency_error = cubeb_get_min_latency(ctx, &params, &latency);
if (latency_error != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error getting minimum latency, error: {}", latency_error);
latency = TargetSampleCount * 2;
}
latency = std::max(latency, TargetSampleCount * 2);
cubeb_destroy(ctx);
return latency;
}
// REVERTED back to 3833 - Below namespace section and function IsCubebSuitable() removed, reverting to GetCubebLatency() above. - DIABLO 3 FIX
/*
namespace {
static long TmpDataCallback(cubeb_stream*, void*, const void*, void*, long) {
return TargetSampleCount;
@ -400,5 +445,6 @@ bool IsCubebSuitable() {
return true;
#endif
}
*/
} // namespace AudioCore::Sink

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -96,12 +99,20 @@ private:
*/
std::vector<std::string> ListCubebSinkDevices(bool capture);
// REVERSION - function GetCubebLatency() reintroduced from EA-3833 - DIABLO 3 FIX
/**
* Get the reported latency for this sink.
*
* @return Minimum latency for this sink.
*/
u32 GetCubebLatency();
/**
* Check if this backend is suitable for use.
* Checks if enabled, its latency, whether it opens successfully, etc.
*
* @return True is this backend is suitable, false otherwise.
*/
bool IsCubebSuitable();
// bool IsCubebSuitable(); // REVERTED BACK TO GetCubebLatency() FROM 3833
} // namespace AudioCore::Sink

View file

@ -234,6 +234,13 @@ std::vector<std::string> ListSDLSinkDevices(bool capture) {
return device_list;
}
/* REVERSION to 3833 - function GetSDLLatency() REINTRODUCED FROM 3833 - DIABLO 3 FIX */
u32 GetSDLLatency() {
return TargetSampleCount * 2;
}
// REVERTED back to 3833 - Below function IsSDLSuitable() removed, reverting to GetSDLLatency() above. - DIABLO 3 FIX
/*
bool IsSDLSuitable() {
#if !defined(HAVE_SDL2)
return false;
@ -271,5 +278,6 @@ bool IsSDLSuitable() {
return true;
#endif
}
*/
} // namespace AudioCore::Sink

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -87,12 +90,20 @@ private:
*/
std::vector<std::string> ListSDLSinkDevices(bool capture);
// REVERSION - function GetSDLLatency() reintroduced from EA-3833 - DIABLO 3 FIX
/**
* Get the reported latency for this sink.
*
* @return Minimum latency for this sink.
*/
u32 GetSDLLatency();
/** REVERTED back to 3833 - Below function IsSDLSuitable() removed, reverting to GetSDLLatency() above. - DIABLO 3 FIX
* Check if this backend is suitable for use.
* Checks if enabled, its latency, whether it opens successfully, etc.
*
* @return True is this backend is suitable, false otherwise.
*/
bool IsSDLSuitable();
//bool IsSDLSuitable(); // REVERTED for GetSDLLatency() from EA-3833
} // namespace AudioCore::Sink

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -25,7 +28,8 @@ namespace {
struct SinkDetails {
using FactoryFn = std::unique_ptr<Sink> (*)(std::string_view);
using ListDevicesFn = std::vector<std::string> (*)(bool);
using SuitableFn = bool (*)();
using LatencyFn = u32 (*)(); // REINTRODUCED FROM 3833 - DIABLO 3 FIX
// using SuitableFn = bool (*)(); // REVERTED FOR ABOVE - DIABLO 3 FIX
/// Name for this sink.
Settings::AudioEngine id;
@ -33,10 +37,18 @@ struct SinkDetails {
FactoryFn factory;
/// A method to call to list available devices.
ListDevicesFn list_devices;
/// Method to get the latency of this backend - REINTRODUCED FROM 3833 - DIABLO 3 FIX
LatencyFn latency;
/// Check whether this backend is suitable to be used.
SuitableFn is_suitable;
/// SuitableFn is_suitable; // REVERTED FOR LatencyFn latency ABOVE - DIABLO 3 FIX
};
// NOTE TO PROBABLY FIX LATER FOR ANDROID - the return value "0u" for the first HAVE_OBOE
// section below was just copied from the null section so there's a somewhat valid value
// being returned, since the previous "true" value probably isn't compatible with the
// previous EA-3833 code. (HAVE_OBOE was introduced in a later release.) Eventually need
// to change "0u" for something else directly from the oboe_sink.cpp functions.
// sink_details is ordered in terms of desirability, with the best choice at the top.
constexpr SinkDetails sink_details[] = {
#ifdef HAVE_OBOE
@ -46,7 +58,7 @@ constexpr SinkDetails sink_details[] = {
return std::make_unique<OboeSink>();
},
[](bool capture) { return std::vector<std::string>{"Default"}; },
[]() { return true; },
[]() { return 0u; },
},
#endif
#ifdef HAVE_CUBEB
@ -56,7 +68,7 @@ constexpr SinkDetails sink_details[] = {
return std::make_unique<CubebSink>(device_id);
},
&ListCubebSinkDevices,
&IsCubebSuitable,
&GetCubebLatency,
},
#endif
#ifdef HAVE_SDL2
@ -66,7 +78,7 @@ constexpr SinkDetails sink_details[] = {
return std::make_unique<SDLSink>(device_id);
},
&ListSDLSinkDevices,
&IsSDLSuitable,
&GetSDLLatency,
},
#endif
SinkDetails{
@ -75,7 +87,7 @@ constexpr SinkDetails sink_details[] = {
return std::make_unique<NullSink>(device_id);
},
[](bool capture) { return std::vector<std::string>{"null"}; },
[]() { return true; },
[]() { return 0u; },
},
};
@ -88,6 +100,8 @@ const SinkDetails& GetOutputSinkDetails(Settings::AudioEngine sink_id) {
auto iter = find_backend(sink_id);
if (sink_id == Settings::AudioEngine::Auto) {
// REVERTED TO 3833 BELOW - DIABLO 3 FIX
/*
// Auto-select a backend. Use the sink details ordering, preferring cubeb first, checking
// that the backend is available and suitable to use.
for (auto& details : sink_details) {
@ -96,14 +110,29 @@ const SinkDetails& GetOutputSinkDetails(Settings::AudioEngine sink_id) {
break;
}
}
*/ // END REVERTED CODE - DIABLO 3 FIX
// BEGIN REINTRODUCED FROM 3833 - REPLACED CODE BLOCK ABOVE - DIABLO 3 FIX
// Auto-select a backend. Prefer CubeB, but it may report a large minimum latency which
// causes audio issues, in that case go with SDL.
#if defined(HAVE_CUBEB) && defined(HAVE_SDL2)
iter = find_backend(Settings::AudioEngine::Cubeb);
if (iter->latency() > TargetSampleCount * 3) {
iter = find_backend(Settings::AudioEngine::Sdl2);
}
#else
iter = std::begin(sink_details);
#endif
// END REINTRODUCED SECTION FROM 3833 - DIABLO 3 FIX
LOG_INFO(Service_Audio, "Auto-selecting the {} backend",
Settings::CanonicalizeEnum(iter->id));
/* BEGIN REMOVED - REVERTING BACK TO 3833, this didn't exist at all. - DIABLO 3 FIX
} else {
if (iter != std::end(sink_details) && !iter->is_suitable()) {
LOG_ERROR(Service_Audio, "Selected backend {} is not suitable, falling back to null",
Settings::CanonicalizeEnum(iter->id));
iter = find_backend(Settings::AudioEngine::Null);
}
} */ // END REMOVED REVERT - DIABLO 3 FIX
}
if (iter == std::end(sink_details)) {

View file

@ -92,6 +92,7 @@ struct Applet {
// Channels
std::deque<std::vector<u8>> user_channel_launch_parameter{};
std::deque<std::vector<u8>> preselected_user_launch_parameter{};
std::deque<std::vector<u8>> friend_invitation_storage_channel{};
// Caller applet
std::weak_ptr<Applet> caller_applet{};

View file

@ -456,8 +456,21 @@ Result IApplicationFunctions::GetFriendInvitationStorageChannelEvent(
Result IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(
Out<SharedPointer<IStorage>> out_storage) {
LOG_INFO(Service_AM, "(STUBBED) called");
R_THROW(AM::ResultNoDataInChannel);
LOG_DEBUG(Service_AM, "called");
std::scoped_lock lk{m_applet->lock};
auto& channel = m_applet->friend_invitation_storage_channel;
if (channel.empty()) {
return AM::ResultNoDataInChannel;
}
auto data = channel.back();
channel.pop_back();
*out_storage = std::make_shared<IStorage>(system, std::move(data));
R_SUCCEED();
}
Result IApplicationFunctions::GetNotificationStorageChannelEvent(

View file

@ -728,26 +728,22 @@ Status BufferQueueProducer::Connect(const std::shared_ptr<IProducerListener>& li
return status;
}
// https://android.googlesource.com/platform/frameworks/native/%2B/master/libs/gui/BufferQueueProducer.cpp#1457
Status BufferQueueProducer::Disconnect(NativeWindowApi api) {
LOG_DEBUG(Service_Nvnflinger, "disconnect api = {}", api);
LOG_DEBUG(Service_Nvnflinger, "api = {}", api);
std::shared_ptr<IConsumerListener> listener;
Status status = Status::NoError;
std::shared_ptr<IConsumerListener> listener;
{
std::scoped_lock lock{core->mutex};
core->WaitWhileAllocatingLocked();
if (core->is_abandoned) {
// Disconnecting after the surface has been abandoned is a no-op.
return Status::NoError;
}
if (core->connected_api == NativeWindowApi::NoConnectedApi) {
LOG_DEBUG(Service_Nvnflinger, "disconnect: not connected (req = {})", api);
return Status::NoInit;
}
switch (api) {
case NativeWindowApi::Egl:
case NativeWindowApi::Cpu:
@ -762,20 +758,20 @@ Status BufferQueueProducer::Disconnect(NativeWindowApi api) {
buffer_wait_event->Signal();
listener = core->consumer_listener;
} else {
LOG_ERROR(Service_Nvnflinger,
"disconnect: still connected to another api (cur = {} req = {})",
LOG_ERROR(Service_Nvnflinger, "still connected to another api (cur = {} req = {})",
core->connected_api, api);
status = Status::BadValue;
}
break;
default:
LOG_ERROR(Service_Nvnflinger, "disconnect: unknown api = {}", api);
LOG_ERROR(Service_Nvnflinger, "unknown api = {}", api);
status = Status::BadValue;
break;
}
}
if (listener) {
// Call back without lock held
if (listener != nullptr) {
listener->OnBuffersReleased();
}

View file

@ -40,22 +40,17 @@ Result IHOSBinderDriver::TransactParcel(s32 binder_id, u32 transaction_id,
}
Result IHOSBinderDriver::AdjustRefcount(s32 binder_id, s32 addval, s32 type) {
LOG_DEBUG(Service_VI, "called id={}, addval={}, type={}", binder_id, addval, type);
R_UNLESS(type == 0 || type == 1, ResultUnknown);
m_server->AdjustRefcount(binder_id, addval, type == 1);
LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={}, type={}", binder_id, addval, type);
R_SUCCEED();
}
Result IHOSBinderDriver::GetNativeHandle(s32 binder_id, u32 type_id,
OutCopyHandle<Kernel::KReadableEvent> out_handle) {
LOG_DEBUG(Service_VI, "called id={}, type_id={}", binder_id, type_id);
LOG_WARNING(Service_VI, "(STUBBED) called id={}, type_id={}", binder_id, type_id);
const auto binder = m_server->TryGetBinder(binder_id);
R_UNLESS(binder != nullptr, ResultUnknown);
auto native_handle = binder->GetNativeHandle(type_id);
R_UNLESS(native_handle != nullptr, ResultUnknown);
*out_handle = binder->GetNativeHandle(type_id);
R_SUCCEED();

View file

@ -17,7 +17,6 @@ s32 HosBinderDriverServer::RegisterBinder(std::shared_ptr<android::IBinder>&& bi
last_id++;
binders[last_id] = std::move(binder);
refcounts[last_id] = {}; // strong = 1, weak = 0
return last_id;
}
@ -26,29 +25,6 @@ void HosBinderDriverServer::UnregisterBinder(s32 binder_id) {
std::scoped_lock lk{lock};
binders.erase(binder_id);
refcounts.erase(binder_id);
}
void HosBinderDriverServer::AdjustRefcount(s32 binder_id, s32 delta, bool is_weak) {
std::scoped_lock lk{lock};
auto search_rc = refcounts.find(binder_id);
if (search_rc == refcounts.end()) {
LOG_WARNING(Service_VI, "AdjustRefcount called for unknown binder id {}", binder_id);
return;
}
auto& rc = search_rc->second;
s32& counter = is_weak ? rc.weak : rc.strong;
counter += delta;
if (counter < 0)
counter = 0;
if (rc.strong == 0 && rc.weak == 0) {
binders.erase(binder_id);
refcounts.erase(search_rc);
}
}
std::shared_ptr<android::IBinder> HosBinderDriverServer::TryGetBinder(s32 id) const {

View file

@ -26,18 +26,10 @@ public:
std::shared_ptr<android::IBinder> TryGetBinder(s32 id) const;
void AdjustRefcount(s32 binder_id, s32 delta, bool is_weak);
private:
struct RefCounts {
s32 strong{1};
s32 weak{0};
};
mutable std::mutex lock;
s32 last_id = 0;
std::unordered_map<s32, std::shared_ptr<android::IBinder>> binders;
std::unordered_map<s32, RefCounts> refcounts;
mutable std::mutex lock;
s32 last_id{};
};
} // namespace Service::Nvnflinger

View file

@ -41,6 +41,8 @@ enum class IoMode : u32 {
enum class OptionType : u32 {
DoNotCloseSocket = 0,
GetServerCertChain = 1,
SkipDefaultVerify = 2,
EnableAlpn = 3,
};
// This is nn::ssl::sf::SslVersion
@ -93,11 +95,11 @@ public:
{20, nullptr, "SetRenegotiationMode"},
{21, nullptr, "GetRenegotiationMode"},
{22, &ISslConnection::SetOption, "SetOption"},
{23, nullptr, "GetOption"},
{23, &ISslConnection::GetOption, "GetOption"},
{24, nullptr, "GetVerifyCertErrors"},
{25, nullptr, "GetCipherInfo"},
{26, nullptr, "SetNextAlpnProto"},
{27, nullptr, "GetNextAlpnProto"},
{26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"},
{27, &ISslConnection::GetNextAlpnProto, "GetNextAlpnProto"},
{28, nullptr, "SetDtlsSocketDescriptor"},
{29, nullptr, "GetDtlsHandshakeTimeout"},
{30, nullptr, "SetPrivateOption"},
@ -140,7 +142,10 @@ private:
std::optional<int> fd_to_close;
bool do_not_close_socket = false;
bool get_server_cert_chain = false;
bool skip_default_verify = false;
bool enable_alpn = false;
std::shared_ptr<Network::SocketBase> socket;
std::vector<u8> next_alpn_proto;
bool did_handshake = false;
Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) {
@ -381,6 +386,12 @@ private:
case OptionType::GetServerCertChain:
get_server_cert_chain = static_cast<bool>(parameters.value);
break;
case OptionType::SkipDefaultVerify:
skip_default_verify = static_cast<bool>(parameters.value);
break;
case OptionType::EnableAlpn:
enable_alpn = static_cast<bool>(parameters.value);
break;
default:
LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option,
parameters.value);
@ -389,6 +400,63 @@ private:
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void GetOption(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto option = rp.PopRaw<OptionType>();
u8 value = 0;
switch (option) {
case OptionType::DoNotCloseSocket:
value = static_cast<u8>(do_not_close_socket);
break;
case OptionType::GetServerCertChain:
value = static_cast<u8>(get_server_cert_chain);
break;
case OptionType::SkipDefaultVerify:
value = static_cast<u8>(skip_default_verify);
break;
case OptionType::EnableAlpn:
value = static_cast<u8>(enable_alpn);
break;
default:
LOG_WARNING(Service_SSL, "Unknown option={}", option);
value = 0;
break;
}
LOG_DEBUG(Service_SSL, "GetOption called, option={}, ret value={}", option, value);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u8>(value);
}
void SetNextAlpnProto(HLERequestContext& ctx) {
const auto data = ctx.ReadBuffer(0);
next_alpn_proto.assign(data.begin(), data.end());
LOG_DEBUG(Service_SSL, "SetNextAlpnProto called, size={}", next_alpn_proto.size());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void GetNextAlpnProto(HLERequestContext& ctx) {
const size_t writable = ctx.GetWriteBufferSize();
const size_t to_write = std::min(next_alpn_proto.size(), writable);
if (to_write != 0) {
ctx.WriteBuffer(std::span<const u8>(next_alpn_proto.data(), to_write));
}
LOG_DEBUG(Service_SSL, "GetNextAlpnProto called, size={}", to_write);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u32>(static_cast<u32>(to_write));
}
};
class ISslContext final : public ServiceFramework<ISslContext> {
@ -398,7 +466,7 @@ public:
shared_data{std::make_shared<SslContextSharedData>()} {
static const FunctionInfo functions[] = {
{0, &ISslContext::SetOption, "SetOption"},
{1, nullptr, "GetOption"},
{1, &ISslContext::GetOption, "GetOption"},
{2, &ISslContext::CreateConnection, "CreateConnection"},
{3, &ISslContext::GetConnectionCount, "GetConnectionCount"},
{4, &ISslContext::ImportServerPki, "ImportServerPki"},
@ -434,6 +502,17 @@ private:
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void GetOption(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto parameters = rp.PopRaw<OptionType>();
LOG_WARNING(Service_SSL, "(STUBBED) called. option={}", parameters);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void CreateConnection(HLERequestContext& ctx) {

View file

@ -467,6 +467,10 @@ void BufferCache<P>::BindComputeStorageBuffer(size_t ssbo_index, u32 cbuf_index,
channel_state->written_compute_storage_buffers |= (is_written ? 1U : 0U) << ssbo_index;
const auto& launch_desc = kepler_compute->launch_description;
if (((launch_desc.const_buffer_enable_mask >> cbuf_index) & 1) == 0) {
LOG_WARNING(HW_GPU, "Skipped binding SSBO: cbuf index {} is not enabled", cbuf_index);
return;
}
ASSERT(((launch_desc.const_buffer_enable_mask >> cbuf_index) & 1) != 0);
const auto& cbufs = launch_desc.const_buffer_config;
@ -1701,6 +1705,11 @@ template <class P>
Binding BufferCache<P>::StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index,
bool is_written) const {
const GPUVAddr gpu_addr = gpu_memory->Read<u64>(ssbo_addr);
if (gpu_addr == 0) {
return NULL_BINDING;
}
const auto size = [&]() {
const bool is_nvn_cbuf = cbuf_index == 0;
// The NVN driver buffer (index 0) is known to pack the SSBO address followed by its size.
@ -1723,7 +1732,7 @@ Binding BufferCache<P>::StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index,
const std::optional<DAddr> aligned_device_addr = gpu_memory->GpuToCpuAddress(aligned_gpu_addr);
if (!aligned_device_addr || size == 0) {
LOG_WARNING(HW_GPU, "Failed to find storage buffer for cbuf index {}", cbuf_index);
LOG_DEBUG(HW_GPU, "Failed to find storage buffer for cbuf index {}", cbuf_index);
return NULL_BINDING;
}
const std::optional<DAddr> device_addr = gpu_memory->GpuToCpuAddress(gpu_addr);

View file

@ -324,9 +324,8 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) {
size_t ssbo_index{};
for (const auto& desc : info.storage_buffers_descriptors) {
ASSERT(desc.count == 1);
if (!buffer_cache.BindGraphicsStorageBuffer(stage, ssbo_index, desc.cbuf_index,
desc.cbuf_offset, desc.is_written))
return false;
buffer_cache.BindGraphicsStorageBuffer(stage, ssbo_index, desc.cbuf_index,
desc.cbuf_offset, desc.is_written);
++ssbo_index;
}
}

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
@ -1368,8 +1371,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
std::span<const VideoCommon::ImageCopy> copies) {
// As per the size-compatible formats section of vulkan, copy manually via ReinterpretImage
// these images that aren't size-compatible
if (HasAlpha(src.info.format) != HasAlpha(dst.info.format) ||
BytesPerBlock(src.info.format) != BytesPerBlock(dst.info.format)) {
if (BytesPerBlock(src.info.format) != BytesPerBlock(dst.info.format)) {
auto oneCopy = VideoCommon::ImageCopy{
.src_offset = VideoCommon::Offset3D(0, 0, 0),
.dst_offset = VideoCommon::Offset3D(0, 0, 0),

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -263,6 +266,12 @@ bool HasAlpha(PixelFormat pixel_format) {
case PixelFormat::B8G8R8A8_SRGB:
case PixelFormat::BC1_RGBA_SRGB:
case PixelFormat::A4B4G4R4_UNORM:
case PixelFormat::BC2_SRGB:
case PixelFormat::BC2_UNORM:
case PixelFormat::BC3_SRGB:
case PixelFormat::BC3_UNORM:
case PixelFormat::BC7_SRGB:
case PixelFormat::BC7_UNORM:
return true;
default:
return false;

View file

@ -444,7 +444,7 @@ Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char
const VkApplicationInfo application_info{
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pNext = nullptr,
.pApplicationName = "Eden Emulator",
.pApplicationName = "yuzu Emulator",
.applicationVersion = VK_MAKE_VERSION(0, 1, 0),
.pEngineName = "Eden Emulator",
.engineVersion = VK_MAKE_VERSION(0, 1, 0),