Compare commits

..

5 commits

Author SHA1 Message Date
4e9ede3e85 add MMPX filter
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-30 02:55:16 +02:00
cab8248be2 better logic
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-30 02:55:16 +02:00
5a1353b316 fix vk
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-30 02:55:16 +02:00
417e09cc18 fix ogl
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-30 02:55:16 +02:00
c11e352141 [vk, ogl] VK_QCOM ZTC, Bspline, Mitchell filter weights
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-30 02:55:16 +02:00
52 changed files with 802 additions and 187 deletions

View file

@ -224,7 +224,7 @@ set(YUZU_TZDB_PATH "" CACHE STRING "Path to a pre-downloaded timezone database")
cmake_dependent_option(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "LINUX" OFF) cmake_dependent_option(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "LINUX" OFF)
cmake_dependent_option(YUZU_USE_BUNDLED_MOLTENVK "Download bundled MoltenVK lib" ON "APPLE" OFF) cmake_dependent_option(YUZU_APPLE_USE_BUNDLED_MONTENVK "Download bundled MoltenVK lib" ON "APPLE" OFF)
option(YUZU_DISABLE_LLVM "Disable LLVM (useful for CI)" OFF) option(YUZU_DISABLE_LLVM "Disable LLVM (useful for CI)" OFF)
@ -319,18 +319,6 @@ if (YUZU_ROOM)
add_compile_definitions(YUZU_ROOM) add_compile_definitions(YUZU_ROOM)
endif() endif()
if (ANDROID OR PLATFORM_FREEBSD OR PLATFORM_OPENBSD OR PLATFORM_SUN OR APPLE)
if(CXX_APPLE OR CXX_CLANG)
# libc++ has stop_token and jthread as experimental
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexperimental-library")
else()
# Uses glibc, mostly?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_EXPERIMENTAL=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LIBCPP_ENABLE_EXPERIMENTAL=1")
endif()
endif()
# Build/optimization presets # Build/optimization presets
if (PLATFORM_LINUX OR CXX_CLANG) if (PLATFORM_LINUX OR CXX_CLANG)
if (ARCHITECTURE_x86_64) if (ARCHITECTURE_x86_64)

View file

@ -31,11 +31,7 @@ set(GIT_DESC ${BUILD_VERSION})
set(REPO_NAME "Eden") set(REPO_NAME "Eden")
set(BUILD_ID ${GIT_REFSPEC}) set(BUILD_ID ${GIT_REFSPEC})
set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ")
set(CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") set(CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
# Auto-updater metadata! Must somewhat mirror GitHub API endpoint
set(BUILD_AUTO_UPDATE_WEBSITE "https://github.com")
set(BUILD_AUTO_UPDATE_API "http://api.github.com")
set(BUILD_AUTO_UPDATE_REPO "eden-emulator/Releases")
configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY) configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY)

View file

@ -31,7 +31,7 @@ Notes:
* Currently, build fails without this * Currently, build fails without this
- `YUZU_USE_FASTER_LD` (ON) Check if a faster linker is available - `YUZU_USE_FASTER_LD` (ON) Check if a faster linker is available
* Only available on UNIX * Only available on UNIX
- `YUZU_USE_BUNDLED_MOLTENVK` (ON, macOS only) Download bundled MoltenVK lib) - `YUZU_APPLE_USE_BUNDLED_MONTENVK` (ON, macOS only) Download bundled MoltenVK lib)
- `YUZU_TZDB_PATH` (string) Path to a pre-downloaded timezone database (useful for nixOS) - `YUZU_TZDB_PATH` (string) Path to a pre-downloaded timezone database (useful for nixOS)
- `ENABLE_OPENSSL` (ON for Linux and *BSD) Enable OpenSSL backend for the ssl service - `ENABLE_OPENSSL` (ON for Linux and *BSD) Enable OpenSSL backend for the ssl service
* Always enabled if the web service is enabled * Always enabled if the web service is enabled

View file

@ -9,3 +9,21 @@ Eden will store configuration in the following directories:
- **Linux, macOS, FreeBSD, Solaris, OpenBSD**: `$XDG_DATA_HOME`, `$XDG_CACHE_HOME`, `$XDG_CONFIG_HOME`. - **Linux, macOS, FreeBSD, Solaris, OpenBSD**: `$XDG_DATA_HOME`, `$XDG_CACHE_HOME`, `$XDG_CONFIG_HOME`.
If a `user` directory is present in the current working directory, that will override all global configuration directories and the emulator will use that instead. If a `user` directory is present in the current working directory, that will override all global configuration directories and the emulator will use that instead.
# Enhancements
## Filters
Various graphical filters exist - each of them aimed at a specific target/image quality preset.
- **Nearest**: Provides no filtering - useful for debugging.
- **Bilinear**: Provides the hardware default filtering of the Tegra X1.
- **Bicubic**: Provides a bicubic interpolation using a Catmull-Rom (or hardware-accelerated) implementation.
- **Zero-Tangent, B-Spline, Mitchell**: Provides bicubic interpolation using the respective matrix weights. They're normally not hardware accelerated unless the device supports the `VK_QCOM_filter_cubic_weights` extension. The matrix weights are those matching [the specification itself](https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VkSamplerCubicWeightsCreateInfoQCOM).
- **Spline-1**: Bicubic interpolation (similar to Mitchell) but with a faster texel fetch method. Generally less blurry than bicubic.
- **Gaussian**: Whole-area blur, an applied gaussian blur is done to the entire frame.
- **Lanczos**: An implementation using `a = 3` (49 texel fetches). Provides sharper edges but blurrier artifacts.
- **ScaleForce**: Experimental texture upscale method, see [ScaleFish](https://github.com/BreadFish64/ScaleFish).
- **FSR**: Uses AMD FidelityFX Super Resolution to enhance image quality.
- **Area**: Area interpolation (high kernel count).
- **MMPX**: Nearest-neighbour filter aimed at providing higher pixel-art quality.

View file

@ -59,7 +59,7 @@ android {
defaultConfig { defaultConfig {
// TODO If this is ever modified, change application_id in strings.xml // TODO If this is ever modified, change application_id in strings.xml
applicationId = "dev.eden.eden_emulator" applicationId = "dev.eden.eden_emulator"
minSdk = 28 minSdk = 30
targetSdk = 36 targetSdk = 36
versionName = getGitVersion() versionName = getGitVersion()

View file

@ -19,7 +19,6 @@ import org.yuzu.yuzu_emu.adapters.GameAdapter
import androidx.core.view.doOnNextLayout import androidx.core.view.doOnNextLayout
import org.yuzu.yuzu_emu.YuzuApplication import org.yuzu.yuzu_emu.YuzuApplication
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.core.view.WindowInsetsCompat
/** /**
* CarouselRecyclerView encapsulates all carousel logic for the games UI. * CarouselRecyclerView encapsulates all carousel logic for the games UI.
@ -206,8 +205,8 @@ class CarouselRecyclerView @JvmOverloads constructor(
if (enabled) { if (enabled) {
useCustomDrawingOrder = true useCustomDrawingOrder = true
val insets = rootWindowInsets?.let { WindowInsetsCompat.toWindowInsetsCompat(it, this) } val insets = rootWindowInsets
val bottomInset = insets?.getInsets(WindowInsetsCompat.Type.systemBars())?.bottom ?: 0 val bottomInset = insets?.getInsets(android.view.WindowInsets.Type.systemBars())?.bottom ?: 0
val internalFactor = resources.getFraction(R.fraction.carousel_card_size_factor, 1, 1) val internalFactor = resources.getFraction(R.fraction.carousel_card_size_factor, 1, 1)
val userFactor = preferences.getFloat(CAROUSEL_CARD_SIZE_FACTOR, internalFactor).coerceIn( val userFactor = preferences.getFloat(CAROUSEL_CARD_SIZE_FACTOR, internalFactor).coerceIn(
0f, 0f,

View file

@ -251,12 +251,16 @@
<item>@string/scaling_filter_nearest_neighbor</item> <item>@string/scaling_filter_nearest_neighbor</item>
<item>@string/scaling_filter_bilinear</item> <item>@string/scaling_filter_bilinear</item>
<item>@string/scaling_filter_bicubic</item> <item>@string/scaling_filter_bicubic</item>
<item>@string/scaling_filter_zero_tangent</item>
<item>@string/scaling_filter_bspline</item>
<item>@string/scaling_filter_mitchell</item>
<item>@string/scaling_filter_spline1</item> <item>@string/scaling_filter_spline1</item>
<item>@string/scaling_filter_gaussian</item> <item>@string/scaling_filter_gaussian</item>
<item>@string/scaling_filter_lanczos</item> <item>@string/scaling_filter_lanczos</item>
<item>@string/scaling_filter_scale_force</item> <item>@string/scaling_filter_scale_force</item>
<item>@string/scaling_filter_fsr</item> <item>@string/scaling_filter_fsr</item>
<item>@string/scaling_filter_area</item> <item>@string/scaling_filter_area</item>
<item>@string/scaling_filter_mmpx</item>
</string-array> </string-array>
<integer-array name="rendererScalingFilterValues"> <integer-array name="rendererScalingFilterValues">
@ -269,6 +273,10 @@
<item>6</item> <item>6</item>
<item>7</item> <item>7</item>
<item>8</item> <item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
</integer-array> </integer-array>
<string-array name="rendererAntiAliasingNames"> <string-array name="rendererAntiAliasingNames">

View file

@ -1017,6 +1017,10 @@
<string name="scaling_filter_scale_force">ScaleForce</string> <string name="scaling_filter_scale_force">ScaleForce</string>
<string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string> <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
<string name="scaling_filter_area">Area</string> <string name="scaling_filter_area">Area</string>
<string name="scaling_filter_zero_tangent">Zero-Tangent</string>
<string name="scaling_filter_bspline">B-Spline</string>
<string name="scaling_filter_mitchell">Mitchell</string>
<string name="scaling_filter_mmpx">MMPX</string>
<!-- Anti-Aliasing --> <!-- Anti-Aliasing -->
<string name="anti_aliasing_none">None</string> <string name="anti_aliasing_none">None</string>

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -165,12 +162,6 @@ Result InfoUpdater::UpdateEffectsVersion1(EffectContext& effect_context, const b
reinterpret_cast<EffectInfoBase::OutStatusVersion1*>(output), effect_count}; reinterpret_cast<EffectInfoBase::OutStatusVersion1*>(output), effect_count};
for (u32 i = 0; i < effect_count; i++) { for (u32 i = 0; i < effect_count; i++) {
#ifdef _WIN32
// There's a bug in Windows where using this effect causes extreme noise. So let's skip it.
if (in_params[i].type == EffectInfoBase::Type::Reverb) {
continue;
}
#endif
auto effect_info{&effect_context.GetInfo(i)}; auto effect_info{&effect_context.GetInfo(i)};
if (effect_info->GetType() != in_params[i].type) { if (effect_info->GetType() != in_params[i].type) {
effect_info->ForceUnmapBuffers(pool_mapper); effect_info->ForceUnmapBuffers(pool_mapper);
@ -218,12 +209,6 @@ Result InfoUpdater::UpdateEffectsVersion2(EffectContext& effect_context, const b
reinterpret_cast<EffectInfoBase::OutStatusVersion2*>(output), effect_count}; reinterpret_cast<EffectInfoBase::OutStatusVersion2*>(output), effect_count};
for (u32 i = 0; i < effect_count; i++) { for (u32 i = 0; i < effect_count; i++) {
#ifdef _WIN32
// There's a bug in Windows where using this effect causes extreme noise. So let's skip it.
if (in_params[i].type == EffectInfoBase::Type::Reverb) {
continue;
}
#endif
auto effect_info{&effect_context.GetInfo(i)}; auto effect_info{&effect_context.GetInfo(i)};
if (effect_info->GetType() != in_params[i].type) { if (effect_info->GetType() != in_params[i].type) {
effect_info->ForceUnmapBuffers(pool_mapper); effect_info->ForceUnmapBuffers(pool_mapper);

View file

@ -293,7 +293,8 @@ void SinkStream::WaitFreeSpace(std::stop_token stop_token) {
release_cv.wait_for(lk, std::chrono::milliseconds(5), release_cv.wait_for(lk, std::chrono::milliseconds(5),
[this]() { return paused || queued_buffers < max_queue_size; }); [this]() { return paused || queued_buffers < max_queue_size; });
if (queued_buffers > max_queue_size + 3) { if (queued_buffers > max_queue_size + 3) {
release_cv.wait(lk, stop_token, [this] { return paused || queued_buffers < max_queue_size; }); Common::CondvarWait(release_cv, lk, stop_token,
[this] { return paused || queued_buffers < max_queue_size; });
} }
} }

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -126,7 +123,7 @@ private:
} else if constexpr (Mode == PopMode::WaitWithStopToken) { } else if constexpr (Mode == PopMode::WaitWithStopToken) {
// Wait until the queue is not empty. // Wait until the queue is not empty.
std::unique_lock lock{consumer_cv_mutex}; std::unique_lock lock{consumer_cv_mutex};
consumer_cv.wait(lock, stop_token, [this, read_index] { Common::CondvarWait(consumer_cv, lock, stop_token, [this, read_index] {
return read_index != m_write_index.load(std::memory_order::acquire); return read_index != m_write_index.load(std::memory_order::acquire);
}); });
if (stop_token.stop_requested()) { if (stop_token.stop_requested()) {

View file

@ -3,7 +3,6 @@
#include <vector> #include <vector>
#include "common/assert.h"
#include "common/fs/file.h" #include "common/fs/file.h"
#include "common/fs/fs.h" #include "common/fs/fs.h"
#ifdef ANDROID #ifdef ANDROID

View file

@ -9,7 +9,6 @@
#include <sstream> #include <sstream>
#include <unordered_map> #include <unordered_map>
#include "common/assert.h"
#include "common/fs/fs.h" #include "common/fs/fs.h"
#ifdef ANDROID #ifdef ANDROID
#include "common/fs/fs_android.h" #include "common/fs/fs_android.h"

View file

@ -56,16 +56,6 @@
#include "common/host_memory.h" #include "common/host_memory.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#if defined(__ANDROID__) && __ANDROID_API__ < 30
#include <sys/syscall.h>
#ifndef MFD_CLOEXEC
#define MFD_CLOEXEC 0x0001U
#endif
static int memfd_create(const char* name, unsigned int flags) {
return syscall(__NR_memfd_create, name, flags);
}
#endif
namespace Common { namespace Common {
constexpr size_t PageAlignment = 0x1000; constexpr size_t PageAlignment = 0x1000;

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2022 yuzu Emulator Project // SPDX-FileCopyrightText: 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -10,13 +7,23 @@
#pragma once #pragma once
#include <version>
#ifdef __cpp_lib_jthread
#include <chrono> #include <chrono>
#include <condition_variable> #include <condition_variable>
#include <stop_token>
#include <thread> #include <thread>
#include <utility> #include <utility>
namespace Common { namespace Common {
template <typename Condvar, typename Lock, typename Pred>
void CondvarWait(Condvar& cv, std::unique_lock<Lock>& lk, std::stop_token token, Pred&& pred) {
cv.wait(lk, token, std::forward<Pred>(pred));
}
template <typename Rep, typename Period> template <typename Rep, typename Period>
bool StoppableTimedWait(std::stop_token token, const std::chrono::duration<Rep, Period>& rel_time) { bool StoppableTimedWait(std::stop_token token, const std::chrono::duration<Rep, Period>& rel_time) {
std::condition_variable_any cv; std::condition_variable_any cv;
@ -28,3 +35,341 @@ bool StoppableTimedWait(std::stop_token token, const std::chrono::duration<Rep,
} }
} // namespace Common } // namespace Common
#else
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <functional>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <thread>
#include <type_traits>
#include <utility>
namespace std {
namespace polyfill {
using stop_state_callback = size_t;
class stop_state {
public:
stop_state() = default;
~stop_state() = default;
bool request_stop() {
unique_lock lk{m_lock};
if (m_stop_requested) {
// Already set, nothing to do.
return false;
}
// Mark stop requested.
m_stop_requested = true;
while (!m_callbacks.empty()) {
// Get an iterator to the first element.
const auto it = m_callbacks.begin();
// Move the callback function out of the map.
function<void()> f;
swap(it->second, f);
// Erase the now-empty map element.
m_callbacks.erase(it);
// Run the callback.
if (f) {
f();
}
}
return true;
}
bool stop_requested() const {
unique_lock lk{m_lock};
return m_stop_requested;
}
stop_state_callback insert_callback(function<void()> f) {
unique_lock lk{m_lock};
if (m_stop_requested) {
// Stop already requested. Don't insert anything,
// just run the callback synchronously.
if (f) {
f();
}
return 0;
}
// Insert the callback.
stop_state_callback ret = ++m_next_callback;
m_callbacks.emplace(ret, std::move(f));
return ret;
}
void remove_callback(stop_state_callback cb) {
unique_lock lk{m_lock};
m_callbacks.erase(cb);
}
private:
mutable recursive_mutex m_lock;
map<stop_state_callback, function<void()>> m_callbacks;
stop_state_callback m_next_callback{0};
bool m_stop_requested{false};
};
} // namespace polyfill
class stop_token;
class stop_source;
struct nostopstate_t {
explicit nostopstate_t() = default;
};
inline constexpr nostopstate_t nostopstate{};
template <class Callback>
class stop_callback;
class stop_token {
public:
stop_token() noexcept = default;
stop_token(const stop_token&) noexcept = default;
stop_token(stop_token&&) noexcept = default;
stop_token& operator=(const stop_token&) noexcept = default;
stop_token& operator=(stop_token&&) noexcept = default;
~stop_token() = default;
void swap(stop_token& other) noexcept {
m_stop_state.swap(other.m_stop_state);
}
[[nodiscard]] bool stop_requested() const noexcept {
return m_stop_state && m_stop_state->stop_requested();
}
[[nodiscard]] bool stop_possible() const noexcept {
return m_stop_state != nullptr;
}
private:
friend class stop_source;
template <typename Callback>
friend class stop_callback;
stop_token(shared_ptr<polyfill::stop_state> stop_state) : m_stop_state(std::move(stop_state)) {}
private:
shared_ptr<polyfill::stop_state> m_stop_state;
};
class stop_source {
public:
stop_source() : m_stop_state(make_shared<polyfill::stop_state>()) {}
explicit stop_source(nostopstate_t) noexcept {}
stop_source(const stop_source&) noexcept = default;
stop_source(stop_source&&) noexcept = default;
stop_source& operator=(const stop_source&) noexcept = default;
stop_source& operator=(stop_source&&) noexcept = default;
~stop_source() = default;
void swap(stop_source& other) noexcept {
m_stop_state.swap(other.m_stop_state);
}
[[nodiscard]] stop_token get_token() const noexcept {
return stop_token(m_stop_state);
}
[[nodiscard]] bool stop_possible() const noexcept {
return m_stop_state != nullptr;
}
[[nodiscard]] bool stop_requested() const noexcept {
return m_stop_state && m_stop_state->stop_requested();
}
bool request_stop() noexcept {
return m_stop_state && m_stop_state->request_stop();
}
private:
friend class jthread;
explicit stop_source(shared_ptr<polyfill::stop_state> stop_state)
: m_stop_state(std::move(stop_state)) {}
private:
shared_ptr<polyfill::stop_state> m_stop_state;
};
template <typename Callback>
class stop_callback {
static_assert(is_nothrow_destructible_v<Callback>);
static_assert(is_invocable_v<Callback>);
public:
using callback_type = Callback;
template <typename C>
requires constructible_from<Callback, C>
explicit stop_callback(const stop_token& st,
C&& cb) noexcept(is_nothrow_constructible_v<Callback, C>)
: m_stop_state(st.m_stop_state) {
if (m_stop_state) {
m_callback = m_stop_state->insert_callback(std::move(cb));
}
}
template <typename C>
requires constructible_from<Callback, C>
explicit stop_callback(stop_token&& st,
C&& cb) noexcept(is_nothrow_constructible_v<Callback, C>)
: m_stop_state(std::move(st.m_stop_state)) {
if (m_stop_state) {
m_callback = m_stop_state->insert_callback(std::move(cb));
}
}
~stop_callback() {
if (m_stop_state && m_callback) {
m_stop_state->remove_callback(m_callback);
}
}
stop_callback(const stop_callback&) = delete;
stop_callback(stop_callback&&) = delete;
stop_callback& operator=(const stop_callback&) = delete;
stop_callback& operator=(stop_callback&&) = delete;
private:
shared_ptr<polyfill::stop_state> m_stop_state;
polyfill::stop_state_callback m_callback;
};
template <typename Callback>
stop_callback(stop_token, Callback) -> stop_callback<Callback>;
class jthread {
public:
using id = thread::id;
using native_handle_type = thread::native_handle_type;
jthread() noexcept = default;
template <typename F, typename... Args,
typename = enable_if_t<!is_same_v<remove_cvref_t<F>, jthread>>>
explicit jthread(F&& f, Args&&... args)
: m_stop_state(make_shared<polyfill::stop_state>()),
m_thread(make_thread(std::forward<F>(f), std::forward<Args>(args)...)) {}
~jthread() {
if (joinable()) {
request_stop();
join();
}
}
jthread(const jthread&) = delete;
jthread(jthread&&) noexcept = default;
jthread& operator=(const jthread&) = delete;
jthread& operator=(jthread&& other) noexcept {
m_thread.swap(other.m_thread);
m_stop_state.swap(other.m_stop_state);
return *this;
}
void swap(jthread& other) noexcept {
m_thread.swap(other.m_thread);
m_stop_state.swap(other.m_stop_state);
}
[[nodiscard]] bool joinable() const noexcept {
return m_thread.joinable();
}
void join() {
m_thread.join();
}
void detach() {
m_thread.detach();
m_stop_state.reset();
}
[[nodiscard]] id get_id() const noexcept {
return m_thread.get_id();
}
[[nodiscard]] native_handle_type native_handle() {
return m_thread.native_handle();
}
[[nodiscard]] stop_source get_stop_source() noexcept {
return stop_source(m_stop_state);
}
[[nodiscard]] stop_token get_stop_token() const noexcept {
return stop_source(m_stop_state).get_token();
}
bool request_stop() noexcept {
return get_stop_source().request_stop();
}
[[nodiscard]] static unsigned int hardware_concurrency() noexcept {
return thread::hardware_concurrency();
}
private:
template <typename F, typename... Args>
thread make_thread(F&& f, Args&&... args) {
if constexpr (is_invocable_v<decay_t<F>, stop_token, decay_t<Args>...>) {
return thread(std::forward<F>(f), get_stop_token(), std::forward<Args>(args)...);
} else {
return thread(std::forward<F>(f), std::forward<Args>(args)...);
}
}
shared_ptr<polyfill::stop_state> m_stop_state;
thread m_thread;
};
} // namespace std
namespace Common {
template <typename Condvar, typename Lock, typename Pred>
void CondvarWait(Condvar& cv, std::unique_lock<Lock>& lk, std::stop_token token, Pred pred) {
if (token.stop_requested()) {
return;
}
std::stop_callback callback(token, [&] {
{ std::scoped_lock lk2{*lk.mutex()}; }
cv.notify_all();
});
cv.wait(lk, [&] { return pred() || token.stop_requested(); });
}
template <typename Rep, typename Period>
bool StoppableTimedWait(std::stop_token token, const std::chrono::duration<Rep, Period>& rel_time) {
if (token.stop_requested()) {
return false;
}
bool stop_requested = false;
std::condition_variable cv;
std::mutex m;
std::stop_callback cb(token, [&] {
// Wake up the waiting thread.
{
std::scoped_lock lk{m};
stop_requested = true;
}
cv.notify_one();
});
// Perform the timed wait.
std::unique_lock lk{m};
return !cv.wait_for(lk, rel_time, [&] { return stop_requested; });
}
} // namespace Common
#endif

View file

@ -18,9 +18,6 @@
#define TITLE_BAR_FORMAT_RUNNING "@TITLE_BAR_FORMAT_RUNNING@" #define TITLE_BAR_FORMAT_RUNNING "@TITLE_BAR_FORMAT_RUNNING@"
#define IS_DEV_BUILD @IS_DEV_BUILD@ #define IS_DEV_BUILD @IS_DEV_BUILD@
#define COMPILER_ID "@CXX_COMPILER@" #define COMPILER_ID "@CXX_COMPILER@"
#define BUILD_AUTO_UPDATE_WEBSITE "@BUILD_AUTO_UPDATE_WEBSITE@"
#define BUILD_AUTO_UPDATE_API "@BUILD_AUTO_UPDATE_API@"
#define BUILD_AUTO_UPDATE_REPO "@BUILD_AUTO_UPDATE_REPO@"
namespace Common { namespace Common {
@ -37,8 +34,4 @@ constexpr const char g_title_bar_format_running[] = TITLE_BAR_FORMAT_RUNNING;
constexpr const char g_compiler_id[] = COMPILER_ID; constexpr const char g_compiler_id[] = COMPILER_ID;
constexpr const bool g_is_dev_build = IS_DEV_BUILD; constexpr const bool g_is_dev_build = IS_DEV_BUILD;
constexpr const char g_build_auto_update_website[] = BUILD_AUTO_UPDATE_WEBSITE;
constexpr const char g_build_auto_update_api[] = BUILD_AUTO_UPDATE_API;
constexpr const char g_build_auto_update_repo[] = BUILD_AUTO_UPDATE_REPO;
} // namespace Common } // namespace Common

View file

@ -21,8 +21,5 @@ extern const char g_title_bar_format_running[];
extern const char g_shader_cache_version[]; extern const char g_shader_cache_version[];
extern const char g_compiler_id[]; extern const char g_compiler_id[];
extern const bool g_is_dev_build; extern const bool g_is_dev_build;
extern const char g_build_auto_update_website[];
extern const char g_build_auto_update_api[];
extern const char g_build_auto_update_repo[];
} // namespace Common } // namespace Common

View file

@ -143,7 +143,7 @@ ENUM(ConfirmStop, Ask_Always, Ask_Based_On_Game, Ask_Never);
ENUM(FullscreenMode, Borderless, Exclusive); ENUM(FullscreenMode, Borderless, Exclusive);
ENUM(NvdecEmulation, Off, Cpu, Gpu); ENUM(NvdecEmulation, Off, Cpu, Gpu);
ENUM(ResolutionSetup, Res1_4X, Res1_2X, Res3_4X, Res1X, Res3_2X, Res2X, Res3X, Res4X, Res5X, Res6X, Res7X, Res8X); ENUM(ResolutionSetup, Res1_4X, Res1_2X, Res3_4X, Res1X, Res3_2X, Res2X, Res3X, Res4X, Res5X, Res6X, Res7X, Res8X);
ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Spline1, Gaussian, Lanczos, ScaleForce, Fsr, Area, MaxEnum); ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, ZeroTangent, BSpline, Mitchell, Spline1, Gaussian, Lanczos, ScaleForce, Fsr, Area, Mmpx, MaxEnum);
ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum); ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum);
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch); ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
ENUM(ConsoleMode, Handheld, Docked); ENUM(ConsoleMode, Handheld, Docked);

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
// SPDX-FileCopyrightText: 2014 Citra Emulator Project // SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -83,7 +80,7 @@ public:
condvar.notify_all(); condvar.notify_all();
return true; return true;
} else { } else {
condvar.wait(lk, token, CondvarWait(condvar, lk, token,
[this, current_generation] { return current_generation != generation; }); [this, current_generation] { return current_generation != generation; });
return !token.stop_requested(); return !token.stop_requested();
} }

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -50,8 +47,8 @@ public:
if (requests.empty()) { if (requests.empty()) {
wait_condition.notify_all(); wait_condition.notify_all();
} }
condition.wait(lock, stop_token, Common::CondvarWait(condition, lock, stop_token,
[this] { return !requests.empty(); }); [this] { return !requests.empty(); });
if (stop_token.stop_requested()) { if (stop_token.stop_requested()) {
break; break;
} }

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2010 Dolphin Emulator Project // SPDX-FileCopyrightText: 2010 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -102,11 +99,7 @@ public:
T PopWait(std::stop_token stop_token) { T PopWait(std::stop_token stop_token) {
if (Empty()) { if (Empty()) {
std::unique_lock lock{cv_mutex}; std::unique_lock lock{cv_mutex};
if constexpr (with_stop_token) { Common::CondvarWait(cv, lock, stop_token, [this] { return !Empty(); });
cv.wait(lock, stop_token, [this] { return !Empty(); });
} else {
cv.wait(lock, [this] { return !Empty(); });
}
} }
if (stop_token.stop_requested()) { if (stop_token.stop_requested()) {
return T{}; return T{};

View file

@ -554,12 +554,16 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent)
PAIR(ScalingFilter, NearestNeighbor, tr("Nearest Neighbor")), PAIR(ScalingFilter, NearestNeighbor, tr("Nearest Neighbor")),
PAIR(ScalingFilter, Bilinear, tr("Bilinear")), PAIR(ScalingFilter, Bilinear, tr("Bilinear")),
PAIR(ScalingFilter, Bicubic, tr("Bicubic")), PAIR(ScalingFilter, Bicubic, tr("Bicubic")),
PAIR(ScalingFilter, ZeroTangent, tr("Zero-Tangent")),
PAIR(ScalingFilter, BSpline, tr("B-Spline")),
PAIR(ScalingFilter, Mitchell, tr("Mitchell")),
PAIR(ScalingFilter, Spline1, tr("Spline-1")), PAIR(ScalingFilter, Spline1, tr("Spline-1")),
PAIR(ScalingFilter, Gaussian, tr("Gaussian")), PAIR(ScalingFilter, Gaussian, tr("Gaussian")),
PAIR(ScalingFilter, Lanczos, tr("Lanczos")), PAIR(ScalingFilter, Lanczos, tr("Lanczos")),
PAIR(ScalingFilter, ScaleForce, tr("ScaleForce")), PAIR(ScalingFilter, ScaleForce, tr("ScaleForce")),
PAIR(ScalingFilter, Fsr, tr("AMD FidelityFX™ Super Resolution")), PAIR(ScalingFilter, Fsr, tr("AMD FidelityFX™ Super Resolution")),
PAIR(ScalingFilter, Area, tr("Area")), PAIR(ScalingFilter, Area, tr("Area")),
PAIR(ScalingFilter, Mmpx, tr("MMPX")),
}}); }});
translations->insert({Settings::EnumMetadata<Settings::AntiAliasing>::Index(), translations->insert({Settings::EnumMetadata<Settings::AntiAliasing>::Index(),
{ {

View file

@ -38,6 +38,9 @@ static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map
{Settings::ScalingFilter::Bilinear, {Settings::ScalingFilter::Bilinear,
QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bilinear"))}, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bilinear"))},
{Settings::ScalingFilter::Bicubic, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bicubic"))}, {Settings::ScalingFilter::Bicubic, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bicubic"))},
{Settings::ScalingFilter::ZeroTangent, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Zero-Tangent"))},
{Settings::ScalingFilter::BSpline, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "B-Spline"))},
{Settings::ScalingFilter::Mitchell, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Mitchell"))},
{Settings::ScalingFilter::Spline1, {Settings::ScalingFilter::Spline1,
QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Spline-1"))}, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Spline-1"))},
{Settings::ScalingFilter::Gaussian, {Settings::ScalingFilter::Gaussian,
@ -48,6 +51,7 @@ static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map
QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "ScaleForce"))}, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "ScaleForce"))},
{Settings::ScalingFilter::Fsr, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "FSR"))}, {Settings::ScalingFilter::Fsr, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "FSR"))},
{Settings::ScalingFilter::Area, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Area"))}, {Settings::ScalingFilter::Area, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Area"))},
{Settings::ScalingFilter::Mmpx, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "MMPX"))},
}; };
static const std::map<Settings::ConsoleMode, QString> use_docked_mode_texts_map = { static const std::map<Settings::ConsoleMode, QString> use_docked_mode_texts_map = {

View file

@ -991,7 +991,6 @@ IR::AbstractSyntaxList BuildASL(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::
Statement& root{goto_pass.RootStatement()}; Statement& root{goto_pass.RootStatement()};
IR::AbstractSyntaxList syntax_list; IR::AbstractSyntaxList syntax_list;
TranslatePass{inst_pool, block_pool, stmt_pool, env, root, syntax_list, host_info}; TranslatePass{inst_pool, block_pool, stmt_pool, env, root, syntax_list, host_info};
stmt_pool.ReleaseContents();
return syntax_list; return syntax_list;
} }

View file

@ -39,8 +39,8 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
while (!stop_token.stop_requested()) { while (!stop_token.stop_requested()) {
{ {
std::unique_lock l{command_mutex}; std::unique_lock l{command_mutex};
command_cv.wait(l, stop_token, Common::CondvarWait(command_cv, l, stop_token,
[this]() { return command_lists.size() > 0; }); [this]() { return command_lists.size() > 0; });
if (stop_token.stop_requested()) { if (stop_token.stop_requested()) {
return; return;
} }

View file

@ -116,7 +116,7 @@ u64 ThreadManager::PushCommand(CommandData&& command_data, bool block) {
state.queue.EmplaceWait(std::move(command_data), fence, block); state.queue.EmplaceWait(std::move(command_data), fence, block);
if (block) { if (block) {
state.cv.wait(lk, thread.get_stop_token(), [this, fence] { Common::CondvarWait(state.cv, lk, thread.get_stop_token(), [this, fence] {
return fence <= state.signaled_fence.load(std::memory_order_relaxed); return fence <= state.signaled_fence.load(std::memory_order_relaxed);
}); });
} }

View file

@ -44,9 +44,13 @@ set(SHADER_FILES
pitch_unswizzle.comp pitch_unswizzle.comp
present_area.frag present_area.frag
present_bicubic.frag present_bicubic.frag
present_zero_tangent.frag
present_bspline.frag
present_mitchell.frag
present_gaussian.frag present_gaussian.frag
present_lanczos.frag present_lanczos.frag
present_spline1.frag present_spline1.frag
present_mmpx.frag
queries_prefix_scan_sum.comp queries_prefix_scan_sum.comp
queries_prefix_scan_sum_nosubgroups.comp queries_prefix_scan_sum_nosubgroups.comp
resolve_conditional_render.comp resolve_conditional_render.comp

View file

@ -1,56 +1,37 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#version 460 core #version 460 core
layout (location = 0) in vec2 frag_tex_coord; layout (location = 0) in vec2 frag_tex_coord;
layout (location = 0) out vec4 color; layout (location = 0) out vec4 color;
layout (binding = 0) uniform sampler2D color_texture; layout (binding = 0) uniform sampler2D color_texture;
vec4 cubic(float x) {
vec4 cubic(float v) { float x2 = x * x;
vec4 n = vec4(1.0, 2.0, 3.0, 4.0) - v; float x3 = x2 * x;
vec4 s = n * n * n; return vec4(1.0, x, x2, x3) * transpose(mat4x4(
float x = s.x; 0.0, 2.0, 0.0, 0.0,
float y = s.y - 4.0 * s.x; -1.0, 0.0, 1.0, 0.0,
float z = s.z - 4.0 * s.y + 6.0 * s.x; 2.0, -5.0, 4.0, -1.0,
float w = 6.0 - x - y - z; -1.0, 3.0, -3.0, 1.0
return vec4(x, y, z, w) * (1.0 / 6.0); ) * (1.0 / 2.0));
} }
vec4 textureBicubic(sampler2D samp, vec2 uv) {
vec4 textureBicubic( sampler2D textureSampler, vec2 texCoords ) { vec2 tex_size = vec2(textureSize(samp, 0));
vec2 cc_tex = uv * tex_size - 0.5f;
vec2 texSize = textureSize(textureSampler, 0); vec2 fex = cc_tex - floor(cc_tex);
vec2 invTexSize = 1.0 / texSize; vec4 xcubic = cubic(fex.x);
vec4 ycubic = cubic(fex.y);
texCoords = texCoords * texSize - 0.5; vec4 c = floor(cc_tex).xxyy + vec2(-0.5f, 1.5f).xyxy;
vec4 z = vec4(xcubic.yw, ycubic.yw);
vec2 fxy = fract(texCoords); vec4 s = vec4(xcubic.xz, ycubic.xz) + z;
texCoords -= fxy; vec4 offset = (c + z / s) * (1.0f / tex_size).xxyy;
vec2 n = vec2(s.x / (s.x + s.y), s.z / (s.z + s.w));
vec4 xcubic = cubic(fxy.x); return mix(
vec4 ycubic = cubic(fxy.y); mix(texture(samp, offset.yw), texture(samp, offset.xw), n.x),
mix(texture(samp, offset.yz), texture(samp, offset.xz), n.x),
vec4 c = texCoords.xxyy + vec2(-0.5, +1.5).xyxy; n.y);
vec4 s = vec4(xcubic.xz + xcubic.yw, ycubic.xz + ycubic.yw);
vec4 offset = c + vec4(xcubic.yw, ycubic.yw) / s;
offset *= invTexSize.xxyy;
vec4 sample0 = texture(textureSampler, offset.xz);
vec4 sample1 = texture(textureSampler, offset.yz);
vec4 sample2 = texture(textureSampler, offset.xw);
vec4 sample3 = texture(textureSampler, offset.yw);
float sx = s.x / (s.x + s.y);
float sy = s.z / (s.z + s.w);
return mix(mix(sample3, sample2, sx), mix(sample1, sample0, sx), sy);
} }
void main() { void main() {
color = textureBicubic(color_texture, frag_tex_coord); color = textureBicubic(color_texture, frag_tex_coord);
} }

View file

@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#version 460 core
layout (location = 0) in vec2 frag_tex_coord;
layout (location = 0) out vec4 color;
layout (binding = 0) uniform sampler2D color_texture;
vec4 cubic(float x) {
float x2 = x * x;
float x3 = x2 * x;
return vec4(1.0, x, x2, x3) * transpose(mat4x4(
1.0, 4.0, 1.0, 0.0,
-3.0, 0.0, 3.0, 0.0,
3.0, -6.0, 3.0, 0.0,
-1.0, 3.0, -3.0, 1.0
) * (1.0 / 6.0));
}
vec4 textureBicubic(sampler2D samp, vec2 uv) {
vec2 tex_size = vec2(textureSize(samp, 0));
vec2 cc_tex = uv * tex_size - 0.5f;
vec2 fex = cc_tex - floor(cc_tex);
vec4 xcubic = cubic(fex.x);
vec4 ycubic = cubic(fex.y);
vec4 c = floor(cc_tex).xxyy + vec2(-0.5f, 1.5f).xyxy;
vec4 z = vec4(xcubic.yw, ycubic.yw);
vec4 s = vec4(xcubic.xz, ycubic.xz) + z;
vec4 offset = (c + z / s) * (1.0f / tex_size).xxyy;
vec2 n = vec2(s.x / (s.x + s.y), s.z / (s.z + s.w));
return mix(
mix(texture(samp, offset.yw), texture(samp, offset.xw), n.x),
mix(texture(samp, offset.yz), texture(samp, offset.xz), n.x),
n.y);
}
void main() {
color = textureBicubic(color_texture, frag_tex_coord);
}

View file

@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#version 460 core
layout (location = 0) in vec2 frag_tex_coord;
layout (location = 0) out vec4 color;
layout (binding = 0) uniform sampler2D color_texture;
vec4 cubic(float x) {
float x2 = x * x;
float x3 = x2 * x;
return vec4(1.0, x, x2, x3) * transpose(mat4x4(
1.0, 16.0, 1.0, 0.0,
-9.0, 0.0, 9.0, 0.0,
15.0, -36.0, 27.0, -6.0,
-7.0, 21.0, -21.0, 7.0
) * (1.0 / 18.0));
}
vec4 textureBicubic(sampler2D samp, vec2 uv) {
vec2 tex_size = vec2(textureSize(samp, 0));
vec2 cc_tex = uv * tex_size - 0.5f;
vec2 fex = cc_tex - floor(cc_tex);
vec4 xcubic = cubic(fex.x);
vec4 ycubic = cubic(fex.y);
vec4 c = floor(cc_tex).xxyy + vec2(-0.5f, 1.5f).xyxy;
vec4 z = vec4(xcubic.yw, ycubic.yw);
vec4 s = vec4(xcubic.xz, ycubic.xz) + z;
vec4 offset = (c + z / s) * (1.0f / tex_size).xxyy;
vec2 n = vec2(s.x / (s.x + s.y), s.z / (s.z + s.w));
return mix(
mix(texture(samp, offset.yw), texture(samp, offset.xw), n.x),
mix(texture(samp, offset.yz), texture(samp, offset.xz), n.x),
n.y);
}
void main() {
color = textureBicubic(color_texture, frag_tex_coord);
}

View file

@ -0,0 +1,131 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2023 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#version 460 core
layout(location = 0) in vec2 tex_coord;
layout(location = 0) out vec4 frag_color;
layout(binding = 0) uniform sampler2D tex;
#define src(x, y) texture(tex, coord + vec2(x, y) * 1.0 / source_size)
float luma(vec4 col) {
return dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)) * (1.0 - col.a);
}
bool same(vec4 B, vec4 A0) {
return all(equal(B, A0));
}
bool notsame(vec4 B, vec4 A0) {
return any(notEqual(B, A0));
}
bool all_eq2(vec4 B, vec4 A0, vec4 A1) {
return (same(B,A0) && same(B,A1));
}
bool all_eq3(vec4 B, vec4 A0, vec4 A1, vec4 A2) {
return (same(B,A0) && same(B,A1) && same(B,A2));
}
bool all_eq4(vec4 B, vec4 A0, vec4 A1, vec4 A2, vec4 A3) {
return (same(B,A0) && same(B,A1) && same(B,A2) && same(B,A3));
}
bool any_eq3(vec4 B, vec4 A0, vec4 A1, vec4 A2) {
return (same(B,A0) || same(B,A1) || same(B,A2));
}
bool none_eq2(vec4 B, vec4 A0, vec4 A1) {
return (notsame(B,A0) && notsame(B,A1));
}
bool none_eq4(vec4 B, vec4 A0, vec4 A1, vec4 A2, vec4 A3) {
return (notsame(B,A0) && notsame(B,A1) && notsame(B,A2) && notsame(B,A3));
}
void main()
{
vec2 source_size = vec2(textureSize(tex, 0));
vec2 pos = fract(tex_coord * source_size) - vec2(0.5, 0.5);
vec2 coord = tex_coord - pos / source_size;
vec4 E = src(0.0,0.0);
vec4 A = src(-1.0,-1.0);
vec4 B = src(0.0,-1.0);
vec4 C = src(1.0,-1.0);
vec4 D = src(-1.0,0.0);
vec4 F = src(1.0,0.0);
vec4 G = src(-1.0,1.0);
vec4 H = src(0.0,1.0);
vec4 I = src(1.0,1.0);
vec4 J = E;
vec4 K = E;
vec4 L = E;
vec4 M = E;
frag_color = E;
if(same(E,A) && same(E,B) && same(E,C) && same(E,D) && same(E,F) && same(E,G) && same(E,H) && same(E,I)) return;
vec4 P = src(0.0,2.0);
vec4 Q = src(-2.0,0.0);
vec4 R = src(2.0,0.0);
vec4 S = src(0.0,2.0);
float Bl = luma(B);
float Dl = luma(D);
float El = luma(E);
float Fl = luma(F);
float Hl = luma(H);
if (((same(D,B) && notsame(D,H) && notsame(D,F))) && ((El>=Dl) || same(E,A)) && any_eq3(E,A,C,G) && ((El<Dl) || notsame(A,D) || notsame(E,P) || notsame(E,Q))) J=mix(D, J, 0.5);
if (((same(B,F) && notsame(B,D) && notsame(B,H))) && ((El>=Bl) || same(E,C)) && any_eq3(E,A,C,I) && ((El<Bl) || notsame(C,B) || notsame(E,P) || notsame(E,R))) K=mix(B, K, 0.5);
if (((same(H,D) && notsame(H,F) && notsame(H,B))) && ((El>=Hl) || same(E,G)) && any_eq3(E,A,G,I) && ((El<Hl) || notsame(G,H) || notsame(E,S) || notsame(E,Q))) L=mix(H, L, 0.5);
if (((same(F,H) && notsame(F,B) && notsame(F,D))) && ((El>=Fl) || same(E,I)) && any_eq3(E,C,G,I) && ((El<Fl) || notsame(I,H) || notsame(E,R) || notsame(E,S))) M=mix(F, M, 0.5);
if ((notsame(E,F) && all_eq4(E,C,I,D,Q) && all_eq2(F,B,H)) && notsame(F,src(3.0,0.0))) {M=mix(M, F, 0.5); K=mix(K, M, 0.5);};
if ((notsame(E,D) && all_eq4(E,A,G,F,R) && all_eq2(D,B,H)) && notsame(D,src(-3.0,0.0))) {L=mix(L, D, 0.5); J=mix(J, L, 0.5);};
if ((notsame(E,H) && all_eq4(E,G,I,B,P) && all_eq2(H,D,F)) && notsame(H,src(0.0,3.0))) {M=mix(M, H, 0.5); L=mix(L, M, 0.5);};
if ((notsame(E,B) && all_eq4(E,A,C,H,S) && all_eq2(B,D,F)) && notsame(B,src(0.0,-3.0))) {K=mix(K, B, 0.5); J=mix(J, K, 0.5);};
if ((Bl<El) && all_eq4(E,G,H,I,S) && none_eq4(E,A,D,C,F)) {K=mix(K, B, 0.5); J=mix(J, K, 0.5);}
if ((Hl<El) && all_eq4(E,A,B,C,P) && none_eq4(E,D,G,I,F)) {M=mix(M, H, 0.5); L=mix(L, M, 0.5);}
if ((Fl<El) && all_eq4(E,A,D,G,Q) && none_eq4(E,B,C,I,H)) {M=mix(M, F, 0.5); K=mix(K, M, 0.5);}
if ((Dl<El) && all_eq4(E,C,F,I,R) && none_eq4(E,B,A,G,H)) {L=mix(L, D, 0.5); J=mix(J, L, 0.5);}
if (notsame(H,B)) {
if (notsame(H,A) && notsame(H,E) && notsame(H,C)) {
if (all_eq3(H,G,F,R) && none_eq2(H,D,src(2.0,-1.0))) L=mix(M, L, 0.5);
if (all_eq3(H,I,D,Q) && none_eq2(H,F,src(-2.0,-1.0))) M=mix(L, M, 0.5);
}
if (notsame(B,I) && notsame(B,G) && notsame(B,E)) {
if (all_eq3(B,A,F,R) && none_eq2(B,D,src(2.0,1.0))) J=mix(K, L, 0.5);
if (all_eq3(B,C,D,Q) && none_eq2(B,F,src(-2.0,1.0))) K=mix(J, K, 0.5);
}
}
if (notsame(F,D)) {
if (notsame(D,I) && notsame(D,E) && notsame(D,C)) {
if (all_eq3(D,A,H,S) && none_eq2(D,B,src(1.0,2.0))) J=mix(L, J, 0.5);
if (all_eq3(D,G,B,P) && none_eq2(D,H,src(1.0,2.0))) L=mix(J, L, 0.5);
}
if (notsame(F,E) && notsame(F,A) && notsame(F,G)) {
if (all_eq3(F,C,H,S) && none_eq2(F,B,src(-1.0,2.0))) K=mix(M, K, 0.5);
if (all_eq3(F,I,B,P) && none_eq2(F,H,src(-1.0,-2.0))) M=mix(K, M, 0.5);
}
}
vec2 a = fract(tex_coord * source_size);
vec4 colour = (a.x < 0.5) ? (a.y < 0.5 ? J : L) : (a.y < 0.5 ? K : M);
frag_color = colour;
}

View file

@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#version 460 core
layout (location = 0) in vec2 frag_tex_coord;
layout (location = 0) out vec4 color;
layout (binding = 0) uniform sampler2D color_texture;
vec4 cubic(float x) {
float x2 = x * x;
float x3 = x2 * x;
return vec4(1.0, x, x2, x3) * transpose(mat4x4(
0.0, 2.0, 0.0, 0.0,
-2.0, 0.0, 2.0, 0.0,
4.0, -4.0, 2.0, -2.0,
-2.0, 2.0, -2.0, 1.0
) * (1.0 / 2.0));
}
vec4 textureBicubic(sampler2D samp, vec2 uv) {
vec2 tex_size = vec2(textureSize(samp, 0));
vec2 cc_tex = uv * tex_size - 0.5f;
vec2 fex = cc_tex - floor(cc_tex);
vec4 xcubic = cubic(fex.x);
vec4 ycubic = cubic(fex.y);
vec4 c = floor(cc_tex).xxyy + vec2(-0.5f, 1.5f).xyxy;
vec4 z = vec4(xcubic.yw, ycubic.yw);
vec4 s = vec4(xcubic.xz, ycubic.xz) + z;
vec4 offset = (c + z / s) * (1.0f / tex_size).xxyy;
vec2 n = vec2(s.x / (s.x + s.y), s.z / (s.z + s.w));
return mix(
mix(texture(samp, offset.yw), texture(samp, offset.xw), n.x),
mix(texture(samp, offset.yz), texture(samp, offset.xz), n.x),
n.y);
}
void main() {
color = textureBicubic(color_texture, frag_tex_coord);
}

View file

@ -8,6 +8,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "common/settings.h" #include "common/settings.h"
#include "common/settings_enums.h"
#include "video_core/present.h" #include "video_core/present.h"
#include "video_core/renderer_opengl/gl_blit_screen.h" #include "video_core/renderer_opengl/gl_blit_screen.h"
#include "video_core/renderer_opengl/gl_state_tracker.h" #include "video_core/renderer_opengl/gl_state_tracker.h"
@ -86,6 +87,15 @@ void BlitScreen::CreateWindowAdapt() {
case Settings::ScalingFilter::Bicubic: case Settings::ScalingFilter::Bicubic:
window_adapt = MakeBicubic(device); window_adapt = MakeBicubic(device);
break; break;
case Settings::ScalingFilter::ZeroTangent:
window_adapt = MakeZeroTangent(device);
break;
case Settings::ScalingFilter::BSpline:
window_adapt = MakeBSpline(device);
break;
case Settings::ScalingFilter::Mitchell:
window_adapt = MakeMitchell(device);
break;
case Settings::ScalingFilter::Gaussian: case Settings::ScalingFilter::Gaussian:
window_adapt = MakeGaussian(device); window_adapt = MakeGaussian(device);
break; break;
@ -101,6 +111,9 @@ void BlitScreen::CreateWindowAdapt() {
case Settings::ScalingFilter::Area: case Settings::ScalingFilter::Area:
window_adapt = MakeArea(device); window_adapt = MakeArea(device);
break; break;
case Settings::ScalingFilter::Mmpx:
window_adapt = MakeMmpx(device);
break;
case Settings::ScalingFilter::Fsr: case Settings::ScalingFilter::Fsr:
case Settings::ScalingFilter::Bilinear: case Settings::ScalingFilter::Bilinear:
default: default:

View file

@ -14,6 +14,10 @@
#include "video_core/host_shaders/present_gaussian_frag.h" #include "video_core/host_shaders/present_gaussian_frag.h"
#include "video_core/host_shaders/present_lanczos_frag.h" #include "video_core/host_shaders/present_lanczos_frag.h"
#include "video_core/host_shaders/present_spline1_frag.h" #include "video_core/host_shaders/present_spline1_frag.h"
#include "video_core/host_shaders/present_mitchell_frag.h"
#include "video_core/host_shaders/present_bspline_frag.h"
#include "video_core/host_shaders/present_zero_tangent_frag.h"
#include "video_core/host_shaders/present_mmpx_frag.h"
#include "video_core/renderer_opengl/present/filters.h" #include "video_core/renderer_opengl/present/filters.h"
#include "video_core/renderer_opengl/present/util.h" #include "video_core/renderer_opengl/present/util.h"
@ -39,6 +43,21 @@ std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device) {
HostShaders::PRESENT_BICUBIC_FRAG); HostShaders::PRESENT_BICUBIC_FRAG);
} }
std::unique_ptr<WindowAdaptPass> MakeMitchell(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
HostShaders::PRESENT_MITCHELL_FRAG);
}
std::unique_ptr<WindowAdaptPass> MakeZeroTangent(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
HostShaders::PRESENT_ZERO_TANGENT_FRAG);
}
std::unique_ptr<WindowAdaptPass> MakeBSpline(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
HostShaders::PRESENT_BSPLINE_FRAG);
}
std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device) { std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(), return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
HostShaders::PRESENT_GAUSSIAN_FRAG); HostShaders::PRESENT_GAUSSIAN_FRAG);
@ -60,4 +79,9 @@ std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device) {
HostShaders::PRESENT_AREA_FRAG); HostShaders::PRESENT_AREA_FRAG);
} }
std::unique_ptr<WindowAdaptPass> MakeMmpx(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateNearestNeighborSampler(),
HostShaders::PRESENT_MMPX_FRAG);
}
} // namespace OpenGL } // namespace OpenGL

View file

@ -17,10 +17,14 @@ namespace OpenGL {
std::unique_ptr<WindowAdaptPass> MakeNearestNeighbor(const Device& device); std::unique_ptr<WindowAdaptPass> MakeNearestNeighbor(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeBilinear(const Device& device); std::unique_ptr<WindowAdaptPass> MakeBilinear(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device); std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeZeroTangent(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeMitchell(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeBSpline(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device); std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeSpline1(const Device& device); std::unique_ptr<WindowAdaptPass> MakeSpline1(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device); std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device); std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device); std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeMmpx(const Device& device);
} // namespace OpenGL } // namespace OpenGL

View file

@ -7,6 +7,8 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <vulkan/vulkan_core.h>
#include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/host_shaders/present_area_frag_spv.h" #include "video_core/host_shaders/present_area_frag_spv.h"
@ -14,6 +16,10 @@
#include "video_core/host_shaders/present_gaussian_frag_spv.h" #include "video_core/host_shaders/present_gaussian_frag_spv.h"
#include "video_core/host_shaders/present_lanczos_frag_spv.h" #include "video_core/host_shaders/present_lanczos_frag_spv.h"
#include "video_core/host_shaders/present_spline1_frag_spv.h" #include "video_core/host_shaders/present_spline1_frag_spv.h"
#include "video_core/host_shaders/present_mitchell_frag_spv.h"
#include "video_core/host_shaders/present_bspline_frag_spv.h"
#include "video_core/host_shaders/present_zero_tangent_frag_spv.h"
#include "video_core/host_shaders/present_mmpx_frag_spv.h"
#include "video_core/host_shaders/vulkan_present_frag_spv.h" #include "video_core/host_shaders/vulkan_present_frag_spv.h"
#include "video_core/host_shaders/vulkan_present_scaleforce_fp16_frag_spv.h" #include "video_core/host_shaders/vulkan_present_scaleforce_fp16_frag_spv.h"
#include "video_core/host_shaders/vulkan_present_scaleforce_fp32_frag_spv.h" #include "video_core/host_shaders/vulkan_present_scaleforce_fp32_frag_spv.h"
@ -52,13 +58,28 @@ std::unique_ptr<WindowAdaptPass> MakeSpline1(const Device& device, VkFormat fram
BuildShader(device, PRESENT_SPLINE1_FRAG_SPV)); BuildShader(device, PRESENT_SPLINE1_FRAG_SPV));
} }
std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device, VkFormat frame_format) { std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device, VkFormat frame_format, VkCubicFilterWeightsQCOM qcom_weights) {
// No need for handrolled shader -- if the VK impl can do it for us ;) // No need for handrolled shader -- if the VK impl can do it for us ;)
if (device.IsExtFilterCubicSupported()) // Catmull-Rom is default bicubic for all implementations...
return std::make_unique<WindowAdaptPass>(device, frame_format, CreateCubicSampler(device), if (device.IsExtFilterCubicSupported() && (device.IsQcomFilterCubicWeightsSupported() || qcom_weights == VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM)) {
BuildShader(device, VULKAN_PRESENT_FRAG_SPV)); return std::make_unique<WindowAdaptPass>(device, frame_format, CreateCubicSampler(device,
return std::make_unique<WindowAdaptPass>(device, frame_format, CreateBilinearSampler(device), qcom_weights), BuildShader(device, VULKAN_PRESENT_FRAG_SPV));
BuildShader(device, PRESENT_BICUBIC_FRAG_SPV)); } else {
return std::make_unique<WindowAdaptPass>(device, frame_format, CreateBilinearSampler(device), [&](){
switch (qcom_weights) {
case VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM:
return BuildShader(device, PRESENT_BICUBIC_FRAG_SPV);
case VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM:
return BuildShader(device, PRESENT_ZERO_TANGENT_FRAG_SPV);
case VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM:
return BuildShader(device, PRESENT_BSPLINE_FRAG_SPV);
case VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM:
return BuildShader(device, PRESENT_MITCHELL_FRAG_SPV);
default:
UNREACHABLE();
}
}());
}
} }
std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device, VkFormat frame_format) { std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device, VkFormat frame_format) {
@ -81,4 +102,9 @@ std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device, VkFormat frame_f
BuildShader(device, PRESENT_AREA_FRAG_SPV)); BuildShader(device, PRESENT_AREA_FRAG_SPV));
} }
std::unique_ptr<WindowAdaptPass> MakeMmpx(const Device& device, VkFormat frame_format) {
return std::make_unique<WindowAdaptPass>(device, frame_format, CreateNearestNeighborSampler(device),
BuildShader(device, PRESENT_MMPX_FRAG_SPV));
}
} // namespace Vulkan } // namespace Vulkan

View file

@ -17,11 +17,12 @@ class MemoryAllocator;
std::unique_ptr<WindowAdaptPass> MakeNearestNeighbor(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeNearestNeighbor(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeBilinear(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeBilinear(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device, VkFormat frame_format, VkCubicFilterWeightsQCOM qcom_weights);
std::unique_ptr<WindowAdaptPass> MakeSpline1(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeSpline1(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device, VkFormat frame_format); std::unique_ptr<WindowAdaptPass> MakeArea(const Device& device, VkFormat frame_format);
std::unique_ptr<WindowAdaptPass> MakeMmpx(const Device& device, VkFormat frame_format);
} // namespace Vulkan } // namespace Vulkan

View file

@ -624,8 +624,8 @@ vk::Sampler CreateNearestNeighborSampler(const Device& device) {
return device.GetLogical().CreateSampler(ci_nn); return device.GetLogical().CreateSampler(ci_nn);
} }
vk::Sampler CreateCubicSampler(const Device& device) { vk::Sampler CreateCubicSampler(const Device& device, VkCubicFilterWeightsQCOM qcom_weights) {
const VkSamplerCreateInfo ci_nn{ VkSamplerCreateInfo ci_nn{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
.pNext = nullptr, .pNext = nullptr,
.flags = 0, .flags = 0,
@ -645,7 +645,14 @@ vk::Sampler CreateCubicSampler(const Device& device) {
.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, .borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK,
.unnormalizedCoordinates = VK_FALSE, .unnormalizedCoordinates = VK_FALSE,
}; };
const VkSamplerCubicWeightsCreateInfoQCOM ci_qcom_nn{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM,
.pNext = nullptr,
.cubicWeights = qcom_weights
};
// If not specified, assume Catmull-Rom
if (qcom_weights != VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM)
ci_nn.pNext = &ci_qcom_nn;
return device.GetLogical().CreateSampler(ci_nn); return device.GetLogical().CreateSampler(ci_nn);
} }

View file

@ -57,7 +57,7 @@ VkWriteDescriptorSet CreateWriteDescriptorSet(std::vector<VkDescriptorImageInfo>
VkDescriptorSet set, u32 binding); VkDescriptorSet set, u32 binding);
vk::Sampler CreateBilinearSampler(const Device& device); vk::Sampler CreateBilinearSampler(const Device& device);
vk::Sampler CreateNearestNeighborSampler(const Device& device); vk::Sampler CreateNearestNeighborSampler(const Device& device);
vk::Sampler CreateCubicSampler(const Device& device); vk::Sampler CreateCubicSampler(const Device& device, VkCubicFilterWeightsQCOM qcom_weights);
void BeginRenderPass(vk::CommandBuffer& cmdbuf, VkRenderPass render_pass, VkFramebuffer framebuffer, void BeginRenderPass(vk::CommandBuffer& cmdbuf, VkRenderPass render_pass, VkFramebuffer framebuffer,
VkExtent2D extent); VkExtent2D extent);

View file

@ -7,6 +7,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <vulkan/vulkan_core.h>
#include "video_core/framebuffer_config.h" #include "video_core/framebuffer_config.h"
#include "video_core/present.h" #include "video_core/present.h"
#include "video_core/renderer_vulkan/present/filters.h" #include "video_core/renderer_vulkan/present/filters.h"
@ -41,7 +42,16 @@ void BlitScreen::SetWindowAdaptPass() {
window_adapt = MakeNearestNeighbor(device, swapchain_view_format); window_adapt = MakeNearestNeighbor(device, swapchain_view_format);
break; break;
case Settings::ScalingFilter::Bicubic: case Settings::ScalingFilter::Bicubic:
window_adapt = MakeBicubic(device, swapchain_view_format); window_adapt = MakeBicubic(device, swapchain_view_format, VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM);
break;
case Settings::ScalingFilter::ZeroTangent:
window_adapt = MakeBicubic(device, swapchain_view_format, VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM);
break;
case Settings::ScalingFilter::BSpline:
window_adapt = MakeBicubic(device, swapchain_view_format, VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM);
break;
case Settings::ScalingFilter::Mitchell:
window_adapt = MakeBicubic(device, swapchain_view_format, VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM);
break; break;
case Settings::ScalingFilter::Spline1: case Settings::ScalingFilter::Spline1:
window_adapt = MakeSpline1(device, swapchain_view_format); window_adapt = MakeSpline1(device, swapchain_view_format);
@ -58,6 +68,9 @@ void BlitScreen::SetWindowAdaptPass() {
case Settings::ScalingFilter::Area: case Settings::ScalingFilter::Area:
window_adapt = MakeArea(device, swapchain_view_format); window_adapt = MakeArea(device, swapchain_view_format);
break; break;
case Settings::ScalingFilter::Mmpx:
window_adapt = MakeMmpx(device, swapchain_view_format);
break;
case Settings::ScalingFilter::Fsr: case Settings::ScalingFilter::Fsr:
case Settings::ScalingFilter::Bilinear: case Settings::ScalingFilter::Bilinear:
default: default:

View file

@ -208,7 +208,7 @@ void MasterSemaphore::WaitThread(std::stop_token token) {
vk::Fence fence; vk::Fence fence;
{ {
std::unique_lock lock{wait_mutex}; std::unique_lock lock{wait_mutex};
wait_cv.wait(lock, token, [this] { return !wait_queue.empty(); }); Common::CondvarWait(wait_cv, lock, token, [this] { return !wait_queue.empty(); });
if (token.stop_requested()) { if (token.stop_requested()) {
return; return;
} }

View file

@ -279,7 +279,7 @@ void PresentManager::PresentThread(std::stop_token token) {
std::unique_lock lock{queue_mutex}; std::unique_lock lock{queue_mutex};
// Wait for presentation frames // Wait for presentation frames
frame_cv.wait(lock, token, [this] { return !present_queue.empty(); }); Common::CondvarWait(frame_cv, lock, token, [this] { return !present_queue.empty(); });
if (token.stop_requested()) { if (token.stop_requested()) {
return; return;
} }

View file

@ -166,7 +166,7 @@ void Scheduler::WorkerThread(std::stop_token stop_token) {
std::unique_lock lk{queue_mutex}; std::unique_lock lk{queue_mutex};
// Wait for work. // Wait for work.
event_cv.wait(lk, stop_token, [&] { return TryPopQueue(work); }); Common::CondvarWait(event_cv, lk, stop_token, [&] { return TryPopQueue(work); });
// If we've been asked to stop, we're done. // If we've been asked to stop, we're done.
if (stop_token.stop_requested()) { if (stop_token.stop_requested()) {

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -227,7 +224,7 @@ void TurboMode::Run(std::stop_token stop_token) {
#endif #endif
// Wait for the next graphics queue submission if necessary. // Wait for the next graphics queue submission if necessary.
std::unique_lock lk{m_submission_lock}; std::unique_lock lk{m_submission_lock};
m_submission_cv.wait(lk, stop_token, [this] { Common::CondvarWait(m_submission_cv, lk, stop_token, [this] {
return (std::chrono::steady_clock::now() - m_submission_time) <= return (std::chrono::steady_clock::now() - m_submission_time) <=
std::chrono::milliseconds{100}; std::chrono::milliseconds{100};
}); });

View file

@ -89,7 +89,8 @@ VK_DEFINE_HANDLE(VmaAllocator)
EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \ EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \
EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle) \ EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle) \
EXTENSION(EXT, DESCRIPTOR_INDEXING, descriptor_indexing) \ EXTENSION(EXT, DESCRIPTOR_INDEXING, descriptor_indexing) \
EXTENSION(EXT, FILTER_CUBIC, filter_cubic) EXTENSION(EXT, FILTER_CUBIC, filter_cubic) \
EXTENSION(QCOM, FILTER_CUBIC_WEIGHTS, filter_cubic_weights)
// Define extensions which must be supported. // Define extensions which must be supported.
#define FOR_EACH_VK_MANDATORY_EXTENSION(EXTENSION_NAME) \ #define FOR_EACH_VK_MANDATORY_EXTENSION(EXTENSION_NAME) \
@ -558,6 +559,11 @@ public:
return extensions.filter_cubic; return extensions.filter_cubic;
} }
/// Returns true if the device supports VK_QCOM_filter_cubic_weights
bool IsQcomFilterCubicWeightsSupported() const {
return extensions.filter_cubic_weights;
}
/// Returns true if the device supports VK_EXT_line_rasterization. /// Returns true if the device supports VK_EXT_line_rasterization.
bool IsExtLineRasterizationSupported() const { bool IsExtLineRasterizationSupported() const {
return extensions.line_rasterization; return extensions.line_rasterization;

View file

@ -366,7 +366,7 @@ if (APPLE)
set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE TRUE) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
if (YUZU_USE_BUNDLED_MOLTENVK) if (YUZU_APPLE_USE_BUNDLED_MONTENVK)
set(MOLTENVK_PLATFORM "macOS") set(MOLTENVK_PLATFORM "macOS")
set(MOLTENVK_VERSION "v1.3.0") set(MOLTENVK_VERSION "v1.3.0")
download_moltenvk(${MOLTENVK_PLATFORM} ${MOLTENVK_VERSION}) download_moltenvk(${MOLTENVK_PLATFORM} ${MOLTENVK_VERSION})

View file

@ -14,12 +14,11 @@ AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent) : QDialog(parent)
, ui{std::make_unique<Ui::AboutDialog>()} , ui{std::make_unique<Ui::AboutDialog>()}
{ {
static const std::string description = std::string{Common::g_build_version};
static const std::string build_id = std::string{Common::g_build_id}; static const std::string build_id = std::string{Common::g_build_id};
static const std::string yuzu_build = fmt::format("{} | {} | {}", static const std::string compiler = std::string{Common::g_compiler_id};
std::string{Common::g_build_name},
std::string{Common::g_build_version}, static const std::string yuzu_build = fmt::format("Eden | {} | {}", description, compiler);
std::string{Common::g_compiler_id}
);
const auto override_build = fmt::format(fmt::runtime( const auto override_build = fmt::format(fmt::runtime(
std::string(Common::g_title_bar_format_idle)), std::string(Common::g_title_bar_format_idle)),

View file

@ -108,13 +108,13 @@ void EmuThread::run() {
m_system.Run(); m_system.Run();
m_stopped.Reset(); m_stopped.Reset();
m_should_run_cv.wait(lk, stop_token, [&] { return !m_should_run; }); Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return !m_should_run; });
} else { } else {
m_system.Pause(); m_system.Pause();
m_stopped.Set(); m_stopped.Set();
EmulationPaused(lk); EmulationPaused(lk);
m_should_run_cv.wait(lk, stop_token, [&] { return m_should_run; }); Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; });
EmulationResumed(lk); EmulationResumed(lk);
} }
} }

View file

@ -4192,25 +4192,23 @@ void GMainWindow::OnEmulatorUpdateAvailable() {
update_prompt.addButton(QMessageBox::Yes); update_prompt.addButton(QMessageBox::Yes);
update_prompt.addButton(QMessageBox::Ignore); update_prompt.addButton(QMessageBox::Ignore);
update_prompt.setText( update_prompt.setText(
tr("Download the %1 update?").arg(version_string)); tr("Update %1 for Eden is available.\nWould you like to download it?").arg(version_string));
update_prompt.exec(); update_prompt.exec();
if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) { if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) {
auto const full_url = fmt::format("{}/{}/releases/tag/", QDesktopServices::openUrl(
std::string{Common::g_build_auto_update_website}, QUrl(QString::fromStdString("https://github.com/eden-emulator/Releases/releases/tag/") +
std::string{Common::g_build_auto_update_repo} version_string));
);
QDesktopServices::openUrl(QUrl(QString::fromStdString(full_url) + version_string));
} }
} }
#endif #endif
void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version, std::string_view gpu_vendor) { void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version,
std::string_view gpu_vendor) {
static const std::string description = std::string{Common::g_build_version};
static const std::string build_id = std::string{Common::g_build_id}; static const std::string build_id = std::string{Common::g_build_id};
static const std::string yuzu_title = fmt::format("{} | {} | {}", static const std::string compiler = std::string{Common::g_compiler_id};
std::string{Common::g_build_name},
std::string{Common::g_build_version}, static const std::string yuzu_title = fmt::format("Eden | {} | {}", description, compiler);
std::string{Common::g_compiler_id}
);
const auto override_title = const auto override_title =
fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id); fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id);

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright Citra Emulator Project / Azahar Emulator Project // Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
@ -15,7 +12,6 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <optional> #include <optional>
#include <string> #include <string>
#include "common/scm_rev.h"
std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::string path) std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::string path)
{ {
@ -58,8 +54,8 @@ std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::stri
std::optional<std::string> UpdateChecker::GetLatestRelease(bool include_prereleases) std::optional<std::string> UpdateChecker::GetLatestRelease(bool include_prereleases)
{ {
const auto update_check_url = std::string{Common::g_build_auto_update_api}; constexpr auto update_check_url = "http://api.github.com";
std::string update_check_path = fmt::format("/repos/{}", std::string{Common::g_build_auto_update_repo}); std::string update_check_path = "/repos/eden-emulator/Releases";
try { try {
if (include_prereleases) { // This can return either a prerelease or a stable release, if (include_prereleases) { // This can return either a prerelease or a stable release,
// whichever is more recent. // whichever is more recent.

View file

@ -229,7 +229,7 @@ void EmuWindow_SDL2::WaitEvent() {
const u32 current_time = SDL_GetTicks(); const u32 current_time = SDL_GetTicks();
if (current_time > last_time + 2000) { if (current_time > last_time + 2000) {
const auto results = system.GetAndResetPerfStats(); const auto results = system.GetAndResetPerfStats();
const auto title = fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", const auto title = fmt::format("Eden {} | {}-{} | FPS: {:.0f} ({:.0f}%)",
Common::g_build_fullname, Common::g_build_fullname,
Common::g_scm_branch, Common::g_scm_branch,
Common::g_scm_desc, Common::g_scm_desc,

View file

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -93,7 +90,7 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste
} }
SDL_GL_SetSwapInterval(0); SDL_GL_SetSwapInterval(0);
std::string window_title = fmt::format("{} | {}-{}", Common::g_build_fullname, std::string window_title = fmt::format("Eden {} | {}-{}", Common::g_build_fullname,
Common::g_scm_branch, Common::g_scm_desc); Common::g_scm_branch, Common::g_scm_desc);
render_window = render_window =
SDL_CreateWindow(window_title.c_str(), SDL_CreateWindow(window_title.c_str(),
@ -141,7 +138,7 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste
OnResize(); OnResize();
OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);
SDL_PumpEvents(); SDL_PumpEvents();
LOG_INFO(Frontend, "Build string: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, LOG_INFO(Frontend, "Eden Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch,
Common::g_scm_desc); Common::g_scm_desc);
Settings::LogSettings(); Settings::LogSettings();
} }