From 0184a5f77219c2fa200c80218fe0fc4fba84785c Mon Sep 17 00:00:00 2001 From: swurl Date: Sat, 10 May 2025 19:22:26 -0400 Subject: [PATCH] fix a large variety of issues - GLASM/SPIR-V issues on Android - potential greenscreen fix (thx suyu) - save memory layout and add 10gb/12gb options - potential samsung gaming hub fix - fix layout of controller UI - fix default settings to sensible defaults. - note to TotK that you should increase memory layout - Error checking for Windows linking - fix an IDE error TODO: fix duplicate edens veil code Signed-off-by: swurl --- src/android/app/src/main/AndroidManifest.xml | 1 + .../app/src/main/res/values-ar/strings.xml | 1 + .../app/src/main/res/values-ckb/strings.xml | 1 + .../app/src/main/res/values-cs/strings.xml | 1 + .../app/src/main/res/values-de/strings.xml | 1 + .../app/src/main/res/values-es/strings.xml | 1 + .../app/src/main/res/values-fa/strings.xml | 1 + .../app/src/main/res/values-fr/strings.xml | 1 + .../app/src/main/res/values-he/strings.xml | 1 + .../app/src/main/res/values-hu/strings.xml | 1 + .../app/src/main/res/values-id/strings.xml | 1 + .../app/src/main/res/values-it/strings.xml | 1 + .../app/src/main/res/values-ja/strings.xml | 1 + .../app/src/main/res/values-ko/strings.xml | 1 + .../app/src/main/res/values-nb/strings.xml | 1 + .../app/src/main/res/values-pl/strings.xml | 1 + .../src/main/res/values-pt-rBR/strings.xml | 1 + .../src/main/res/values-pt-rPT/strings.xml | 1 + .../app/src/main/res/values-ru/strings.xml | 1 + .../app/src/main/res/values-uk/strings.xml | 1 + .../app/src/main/res/values-vi/strings.xml | 1 + .../src/main/res/values-zh-rCN/strings.xml | 1 + .../src/main/res/values-zh-rTW/strings.xml | 1 + .../app/src/main/res/values/arrays.xml | 2 + .../app/src/main/res/values/strings.xml | 1 + src/common/settings.h | 14 +- src/common/settings_enums.h | 2 +- .../board/nintendo/nx/k_system_control.cpp | 20 ++ .../kernel/board/nintendo/nx/secure_monitor.h | 4 + src/video_core/host1x/ffmpeg/ffmpeg.cpp | 175 +++++++++++++++++- .../renderer_vulkan/vk_query_cache.cpp | 2 +- src/yuzu/configuration/configure_debug.ui | 2 +- .../configuration/configure_input_player.ui | 98 +++++----- src/yuzu/main.cpp | 10 +- src/yuzu/user_data_migration.cpp | 53 +++--- 35 files changed, 318 insertions(+), 88 deletions(-) diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 51a4705f52..7e7609e200 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -44,6 +44,7 @@ SPDX-License-Identifier: GPL-3.0-or-later + diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index e8cbd73821..3b97f9959b 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -87,6 +87,7 @@ خلفية Shader اختيار طريقة ترجمة Shaders GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-ckb/strings.xml b/src/android/app/src/main/res/values-ckb/strings.xml index b82b3f56b1..2cedecd768 100644 --- a/src/android/app/src/main/res/values-ckb/strings.xml +++ b/src/android/app/src/main/res/values-ckb/strings.xml @@ -88,6 +88,7 @@ شادەر باکند هەڵبژاردنی ڕێگای پێکهێنانی شادەر GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-cs/strings.xml b/src/android/app/src/main/res/values-cs/strings.xml index 9cdbf53d32..1042ab107e 100644 --- a/src/android/app/src/main/res/values-cs/strings.xml +++ b/src/android/app/src/main/res/values-cs/strings.xml @@ -87,6 +87,7 @@ Backend shaderů Způsob kompilace shaderů GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-de/strings.xml b/src/android/app/src/main/res/values-de/strings.xml index 872df8ad80..0947ed46ca 100644 --- a/src/android/app/src/main/res/values-de/strings.xml +++ b/src/android/app/src/main/res/values-de/strings.xml @@ -88,6 +88,7 @@ Shader-Backend Methode zur Shader-Kompilierung GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 2305234df3..9c01fa1bd2 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -88,6 +88,7 @@ Backend de shaders Elegir cómo se compilan shaders GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-fa/strings.xml b/src/android/app/src/main/res/values-fa/strings.xml index 6cf7b35bf5..6d0fc6bc36 100644 --- a/src/android/app/src/main/res/values-fa/strings.xml +++ b/src/android/app/src/main/res/values-fa/strings.xml @@ -88,6 +88,7 @@ بک‌اند شیدر انتخاب روش کامپایل و ترجمه شیدرها GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-fr/strings.xml b/src/android/app/src/main/res/values-fr/strings.xml index f13945e77a..fe6d2d006b 100644 --- a/src/android/app/src/main/res/values-fr/strings.xml +++ b/src/android/app/src/main/res/values-fr/strings.xml @@ -88,6 +88,7 @@ Backend shader Méthode de compilation GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-he/strings.xml b/src/android/app/src/main/res/values-he/strings.xml index 3b6a09266d..fc4f684a1c 100644 --- a/src/android/app/src/main/res/values-he/strings.xml +++ b/src/android/app/src/main/res/values-he/strings.xml @@ -88,6 +88,7 @@ מנוע שיידרים בחר כיצד לקמפל שיידרים GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-hu/strings.xml b/src/android/app/src/main/res/values-hu/strings.xml index bab82f1fa5..05d7304072 100644 --- a/src/android/app/src/main/res/values-hu/strings.xml +++ b/src/android/app/src/main/res/values-hu/strings.xml @@ -88,6 +88,7 @@ Shader backend Shaderek fordításának módja GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-id/strings.xml b/src/android/app/src/main/res/values-id/strings.xml index b2442010c8..2f9d7b2fed 100644 --- a/src/android/app/src/main/res/values-id/strings.xml +++ b/src/android/app/src/main/res/values-id/strings.xml @@ -88,6 +88,7 @@ Backend Shader Pilih cara shader dikompilasi dan diterjemahkan untuk GPU Anda. GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-it/strings.xml b/src/android/app/src/main/res/values-it/strings.xml index bcd6c3ae4f..b41a3495ba 100644 --- a/src/android/app/src/main/res/values-it/strings.xml +++ b/src/android/app/src/main/res/values-it/strings.xml @@ -88,6 +88,7 @@ Backend shader Scegli come compilare gli shader GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-ja/strings.xml b/src/android/app/src/main/res/values-ja/strings.xml index 3ab0e79c10..c17e13c4da 100644 --- a/src/android/app/src/main/res/values-ja/strings.xml +++ b/src/android/app/src/main/res/values-ja/strings.xml @@ -88,6 +88,7 @@ シェーダーバックエンド シェーダーのコンパイル方法 GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-ko/strings.xml b/src/android/app/src/main/res/values-ko/strings.xml index 54df91f2a7..b60949e24c 100644 --- a/src/android/app/src/main/res/values-ko/strings.xml +++ b/src/android/app/src/main/res/values-ko/strings.xml @@ -88,6 +88,7 @@ 셰이더 백엔드 셰이더 컴파일 방식 선택 GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-nb/strings.xml b/src/android/app/src/main/res/values-nb/strings.xml index 1852e4c55c..b9cceeb384 100644 --- a/src/android/app/src/main/res/values-nb/strings.xml +++ b/src/android/app/src/main/res/values-nb/strings.xml @@ -88,6 +88,7 @@ Shader-backend Velg hvordan shadere kompileres GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-pl/strings.xml b/src/android/app/src/main/res/values-pl/strings.xml index 679ca30114..d6b0ad5390 100644 --- a/src/android/app/src/main/res/values-pl/strings.xml +++ b/src/android/app/src/main/res/values-pl/strings.xml @@ -88,6 +88,7 @@ Backend shaderów Wybierz metodę kompilacji shaderów. GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-pt-rBR/strings.xml b/src/android/app/src/main/res/values-pt-rBR/strings.xml index bf24f1b367..0584f3cfed 100644 --- a/src/android/app/src/main/res/values-pt-rBR/strings.xml +++ b/src/android/app/src/main/res/values-pt-rBR/strings.xml @@ -88,6 +88,7 @@ Backend de shader Define como shaders são compilados GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-pt-rPT/strings.xml b/src/android/app/src/main/res/values-pt-rPT/strings.xml index 3f3f840e0f..81f83d2a97 100644 --- a/src/android/app/src/main/res/values-pt-rPT/strings.xml +++ b/src/android/app/src/main/res/values-pt-rPT/strings.xml @@ -88,6 +88,7 @@ Backend de Shader Método de compilação de shaders. GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index f7e5487e8f..92616d495d 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -88,6 +88,7 @@ Шейдерный бэкенд Метод компиляции шейдеров GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-uk/strings.xml b/src/android/app/src/main/res/values-uk/strings.xml index b536c81e29..06bbb951eb 100644 --- a/src/android/app/src/main/res/values-uk/strings.xml +++ b/src/android/app/src/main/res/values-uk/strings.xml @@ -88,6 +88,7 @@ Вершинний шейдер Спосіб компіляції шейдерів GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-vi/strings.xml b/src/android/app/src/main/res/values-vi/strings.xml index a1d4318d79..dde8f656c1 100644 --- a/src/android/app/src/main/res/values-vi/strings.xml +++ b/src/android/app/src/main/res/values-vi/strings.xml @@ -88,6 +88,7 @@ Backend Shader Chọn cách biên dịch shader GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-zh-rCN/strings.xml b/src/android/app/src/main/res/values-zh-rCN/strings.xml index 0e69ca0c06..9a1386f19f 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -88,6 +88,7 @@ 着色器后端 选择着色器编译方式 GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values-zh-rTW/strings.xml b/src/android/app/src/main/res/values-zh-rTW/strings.xml index 6449d2d554..115096fdcd 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -88,6 +88,7 @@ 著色器後端 選擇著色器的編譯與轉譯方式 GLSL + GLASM SPIR-V diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index adaa67415d..0fd6867632 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -88,11 +88,13 @@ @string/shader_backend_glsl @string/shader_backend_spirv + @string/shader_backend_glasm 0 1 + 2 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 427b2890ad..043f89d3d2 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -65,6 +65,7 @@ Shader Backend Choose how shaders are compiled and translated for your GPU. GLSL + GLASM SPIR-V diff --git a/src/common/settings.h b/src/common/settings.h index 92e02d9887..52c0a199c2 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -196,11 +196,11 @@ struct Values { SwitchableSetting memory_layout_mode{linkage, MemoryLayout::Memory_4Gb, MemoryLayout::Memory_4Gb, - MemoryLayout::Memory_8Gb, + MemoryLayout::Memory_12Gb, "memory_layout_mode", Category::Core, Specialization::Default, - false}; + true}; SwitchableSetting use_speed_limit{ linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, true, true}; SwitchableSetting speed_limit{linkage, @@ -447,9 +447,9 @@ struct Values { SwitchableSetting dyna_state{linkage, #ifdef ANDROID - 0, + 2, #else - 1, + 2, #endif 0, 2, @@ -457,9 +457,9 @@ struct Values { Category::RendererExtensions, Specialization::Scalar}; - SwitchableSetting dyna_state3{linkage, false, "dyna_state3", Category::RendererExtensions}; - SwitchableSetting provoking_vertex{linkage, false, "provoking_vertex", Category::RendererExtensions}; - SwitchableSetting descriptor_indexing{linkage, false, "descriptor_indexing", Category::RendererExtensions}; + SwitchableSetting dyna_state3{linkage, true, "dyna_state3", Category::RendererExtensions}; + SwitchableSetting provoking_vertex{linkage, true, "provoking_vertex", Category::RendererExtensions}; + SwitchableSetting descriptor_indexing{linkage, true, "descriptor_indexing", Category::RendererExtensions}; Setting renderer_debug{linkage, false, "debug", Category::RendererDebug}; Setting renderer_shader_feedback{linkage, false, "shader_feedback", diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 75189e60d7..43abe150f8 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -134,7 +134,7 @@ ENUM(CpuBackend, Dynarmic, Nce); ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid); -ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb); +ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb, Memory_10Gb, Memory_12Gb); ENUM(ConfirmStop, Ask_Always, Ask_Based_On_Game, Ask_Never); diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp index 37fa39a734..f62f3e4767 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp +++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp @@ -48,6 +48,10 @@ u32 GetMemorySizeForInit() { return Smc::MemorySize_6GB; case Settings::MemoryLayout::Memory_8Gb: return Smc::MemorySize_8GB; + case Settings::MemoryLayout::Memory_10Gb: + return Smc::MemorySize_10GB; + case Settings::MemoryLayout::Memory_12Gb: + return Smc::MemorySize_12GB; } return Smc::MemorySize_4GB; } @@ -60,6 +64,10 @@ Smc::MemoryArrangement GetMemoryArrangeForInit() { return Smc::MemoryArrangement_6GB; case Settings::MemoryLayout::Memory_8Gb: return Smc::MemoryArrangement_8GB; + case Settings::MemoryLayout::Memory_10Gb: + return Smc::MemoryArrangement_10GB; + case Settings::MemoryLayout::Memory_12Gb: + return Smc::MemoryArrangement_12GB; } return Smc::MemoryArrangement_4GB; } @@ -79,6 +87,10 @@ size_t KSystemControl::Init::GetIntendedMemorySize() { return 6_GiB; case Smc::MemorySize_8GB: return 8_GiB; + case Smc::MemorySize_10GB: + return 10_GiB; + case Smc::MemorySize_12GB: + return 12_GiB; } } @@ -114,6 +126,10 @@ std::size_t KSystemControl::Init::GetApplicationPoolSize() { case Smc::MemoryArrangement_8GB: // Real kernel sets this to 4916_MiB. We are not debugging applets. return 6547_MiB; + case Smc::MemoryArrangement_10GB: + return 8178_MiB; + case Smc::MemoryArrangement_12GB: + return 9809_MiB; } }(); @@ -139,6 +155,10 @@ size_t KSystemControl::Init::GetAppletPoolSize() { case Smc::MemoryArrangement_8GB: //! Real kernel sets this to 2193_MiB. We are not debugging applets. return 562_MiB; + case Smc::MemoryArrangement_10GB: + return 562_MiB; + case Smc::MemoryArrangement_12GB: + return 562_MiB; } }(); diff --git a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h index b0e4123f08..ffec06f2d5 100644 --- a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h +++ b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h @@ -9,6 +9,8 @@ enum MemorySize { MemorySize_4GB = 0, MemorySize_6GB = 1, MemorySize_8GB = 2, + MemorySize_10GB = 3, + MemorySize_12GB = 4, }; enum MemoryArrangement { @@ -18,6 +20,8 @@ enum MemoryArrangement { MemoryArrangement_6GB = 3, MemoryArrangement_6GBForAppletDev = 4, MemoryArrangement_8GB = 5, + MemoryArrangement_10GB = 6, + MemoryArrangement_12GB = 7, }; } // namespace Kernel::Board::Nintendo::Nx::Smc diff --git a/src/video_core/host1x/ffmpeg/ffmpeg.cpp b/src/video_core/host1x/ffmpeg/ffmpeg.cpp index 7e955223db..60e9f121e2 100644 --- a/src/video_core/host1x/ffmpeg/ffmpeg.cpp +++ b/src/video_core/host1x/ffmpeg/ffmpeg.cpp @@ -1,6 +1,12 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +// SPDX-FileCopyrightText: Copyright 2025 eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "common/assert.h" #include "common/logging/log.h" #include "common/scope_exit.h" @@ -218,6 +224,166 @@ bool DecoderContext::OpenContext(const Decoder& decoder) { return true; } +// Nasty but allows linux builds to pass. +// Requires double checks when FFMPEG gets updated. +// Hopefully a future FFMPEG update will all and expose a solution in the public API. +namespace { + +typedef struct FFCodecDefault { + const char* key; + const char* value; +} FFCodecDefault; + +typedef struct FFCodec { + /** + * The public AVCodec. See codec.h for it. + */ + AVCodec p; + + /** + * Internal codec capabilities FF_CODEC_CAP_*. + */ + unsigned caps_internal : 29; + + /** + * This field determines the type of the codec (decoder/encoder) + * and also the exact callback cb implemented by the codec. + * cb_type uses enum FFCodecType values. + */ + unsigned cb_type : 3; + + int priv_data_size; + /** + * @name Frame-level threading support functions + * @{ + */ + /** + * Copy necessary context variables from a previous thread context to the current one. + * If not defined, the next thread will start automatically; otherwise, the codec + * must call ff_thread_finish_setup(). + * + * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. + */ + int (*update_thread_context)(struct AVCodecContext* dst, const struct AVCodecContext* src); + + /** + * Copy variables back to the user-facing context + */ + int (*update_thread_context_for_user)(struct AVCodecContext* dst, + const struct AVCodecContext* src); + /** @} */ + + /** + * Private codec-specific defaults. + */ + const FFCodecDefault* defaults; + + /** + * Initialize codec static data, called from av_codec_iterate(). + * + * This is not intended for time consuming operations as it is + * run for every codec regardless of that codec being used. + */ + void (*init_static_data)(struct FFCodec* codec); + + int (*init)(struct AVCodecContext*); + + union { + /** + * Decode to an AVFrame. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_DECODE. + * + * @param avctx codec context + * @param[out] frame AVFrame for output + * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that + * a non-empty frame was returned in frame. + * @param[in] avpkt AVPacket containing the data to be decoded + * @return amount of bytes read from the packet on success, + * negative error code on failure + */ + int (*decode)(struct AVCodecContext* avctx, struct AVFrame* frame, int* got_frame_ptr, + struct AVPacket* avpkt); + /** + * Decode subtitle data to an AVSubtitle. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_DECODE_SUB. + * + * Apart from that this is like the decode callback. + */ + int (*decode_sub)(struct AVCodecContext* avctx, struct AVSubtitle* sub, int* got_frame_ptr, + const struct AVPacket* avpkt); + /** + * Decode API with decoupled packet/frame dataflow. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_FRAME. + * + * This function is called to get one output frame. It should call + * ff_decode_get_packet() to obtain input data. + */ + int (*receive_frame)(struct AVCodecContext* avctx, struct AVFrame* frame); + /** + * Encode data to an AVPacket. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_ENCODE + * + * @param avctx codec context + * @param[out] avpkt output AVPacket + * @param[in] frame AVFrame containing the input to be encoded + * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a + * non-empty packet was returned in avpkt. + * @return 0 on success, negative error code on failure + */ + int (*encode)(struct AVCodecContext* avctx, struct AVPacket* avpkt, + const struct AVFrame* frame, int* got_packet_ptr); + /** + * Encode subtitles to a raw buffer. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_ENCODE_SUB. + */ + int (*encode_sub)(struct AVCodecContext* avctx, uint8_t* buf, int buf_size, + const struct AVSubtitle* sub); + /** + * Encode API with decoupled frame/packet dataflow. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_PACKET. + * + * This function is called to get one output packet. + * It should call ff_encode_get_frame() to obtain input data. + */ + int (*receive_packet)(struct AVCodecContext* avctx, struct AVPacket* avpkt); + } cb; + + int (*close)(struct AVCodecContext*); + + /** + * Flush buffers. + * Will be called when seeking + */ + void (*flush)(struct AVCodecContext*); + + /** + * Decoding only, a comma-separated list of bitstream filters to apply to + * packets before decoding. + */ + const char* bsfs; + + /** + * Array of pointers to hardware configurations supported by the codec, + * or NULL if no hardware supported. The array is terminated by a NULL + * pointer. + * + * The user can only access this field via avcodec_get_hw_config(). + */ + const struct AVCodecHWConfigInternal* const* hw_configs; + + /** + * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. + */ + const uint32_t* codec_tags; +} FFCodec; + +static av_always_inline const FFCodec* ffcodec(const AVCodec* codec) { + return (const FFCodec*)codec; +} + +} // namespace + + bool DecoderContext::SendPacket(const Packet& packet) { m_temp_frame = std::make_shared(); m_got_frame = 0; @@ -227,8 +393,10 @@ bool DecoderContext::SendPacket(const Packet& packet) { #ifndef ANDROID if (!m_codec_context->hw_device_ctx && m_codec_context->codec_id == AV_CODEC_ID_H264) { m_decode_order = true; - const int ret = avcodec_send_frame(m_codec_context, m_temp_frame->GetFrame()); - if (ret < 0) { + auto* codec{ffcodec(m_decoder.GetCodec())}; + if (const int ret = codec->cb.decode(m_codec_context, m_temp_frame->GetFrame(), + &m_got_frame, packet.GetPacket()); + ret < 0) { LOG_DEBUG(Service_NVDRV, "avcodec_send_packet error {}", AVError(ret)); return false; } @@ -250,6 +418,7 @@ std::shared_ptr DecoderContext::ReceiveFrame() { #ifndef ANDROID if (!m_codec_context->hw_device_ctx && m_codec_context->codec_id == AV_CODEC_ID_H264) { m_decode_order = true; + auto* codec{ffcodec(m_decoder.GetCodec())}; int ret{0}; if (m_got_frame == 0) { @@ -257,7 +426,7 @@ std::shared_ptr DecoderContext::ReceiveFrame() { auto* pkt = packet.GetPacket(); pkt->data = nullptr; pkt->size = 0; - ret = avcodec_receive_packet(m_codec_context, pkt); + ret = codec->cb.decode(m_codec_context, m_temp_frame->GetFrame(), &m_got_frame, pkt); m_codec_context->has_b_frames = 0; } diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index a28296bdaf..44c06eddf3 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -176,7 +176,7 @@ public: PauseCounter(); } AbandonCurrentQuery(); - std::function func([this, counts = pending_flush_queries.size()] { + std::function func([this] { amend_value = 0; accumulation_value = 0; }); diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index 68c5a67b24..9ebe75aa87 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui @@ -424,7 +424,7 @@ - Enable Auto-Stub** + Enable Auto-Stub diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index 012379a477..b8e0465386 100644 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui @@ -1363,55 +1363,6 @@ - - - - Plus - - - Qt::AlignmentFlag::AlignCenter - - - - 3 - - - 3 - - - 3 - - - 3 - - - 3 - - - - - - 70 - 0 - - - - - 68 - 16777215 - - - - min-width: 68px; - - - Plus - - - - - - @@ -1461,6 +1412,55 @@ + + + + Plus + + + Qt::AlignmentFlag::AlignCenter + + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + 70 + 0 + + + + + 68 + 16777215 + + + + min-width: 68px; + + + Plus + + + + + + diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 8cd20a452d..503891dc22 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1806,11 +1806,11 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa msg->setWindowTitle(tr("Game Updates Warning")); msg->setIcon(QMessageBox::Warning); msg->setText(tr("The game you are trying to launch is known to have performance or booting " - "issues when updates are applied. It's recommended to disable any updates " - "to this game before attempting to launch, or switch to an earlier update. " - "If you don't have any updates installed or enabled, you can safely ignore " - "this message.

Press \"OK\" to continue launching, or \"Cancel\" to " - "cancel the launch.")); + "issues when updates are applied. Please try increasing the memory layout to " + "6GB or 8GB if any issues occur.

Press \"OK\" to continue launching, or " + "\"Cancel\" to cancel the launch.")); + + // TODO: TMP: Recommends more memory for TotK. msg->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); diff --git a/src/yuzu/user_data_migration.cpp b/src/yuzu/user_data_migration.cpp index 1946254fb2..12d780e226 100644 --- a/src/yuzu/user_data_migration.cpp +++ b/src/yuzu/user_data_migration.cpp @@ -21,8 +21,7 @@ namespace fs = std::filesystem; -UserDataMigrator::UserDataMigrator( - QMainWindow *main_window) +UserDataMigrator::UserDataMigrator(QMainWindow *main_window) { // NOTE: Logging is not initialized yet, do not produce logs here. @@ -34,8 +33,7 @@ UserDataMigrator::UserDataMigrator( } } -void UserDataMigrator::ShowMigrationPrompt( - QMainWindow *main_window) +void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window) { namespace fs = std::filesystem; @@ -96,9 +94,9 @@ void UserDataMigrator::ShowMigrationPrompt( #define EMU_MAP(name) \ const bool name##_found = fs::is_directory( \ Common::FS::GetLegacyPath(Common::FS::LegacyPath::name##Dir)); \ - legacyMap[main_window->tr(#name)] = LegacyEmu::name; \ - found[main_window->tr(#name)] = name##_found; \ - if (name##_found) \ + legacyMap[main_window->tr(#name)] = LegacyEmu::name; \ + found[main_window->tr(#name)] = name##_found; \ + if (name##_found) \ any_found = true; EMU_MAP(Citron) @@ -159,8 +157,7 @@ void UserDataMigrator::ShowMigrationPrompt( return; } -void UserDataMigrator::ShowMigrationCancelledMessage( - QMainWindow *main_window) +void UserDataMigrator::ShowMigrationCancelledMessage(QMainWindow *main_window) { QMessageBox::information(main_window, main_window->tr("Migration"), @@ -173,11 +170,10 @@ void UserDataMigrator::ShowMigrationCancelledMessage( QMessageBox::Ok); } -void UserDataMigrator::MigrateUserData( - QMainWindow *main_window, - const LegacyEmu selected_legacy_emu, - const bool clear_shader_cache, - const MigrationStrategy strategy) +void UserDataMigrator::MigrateUserData(QMainWindow *main_window, + const LegacyEmu selected_legacy_emu, + const bool clear_shader_cache, + const MigrationStrategy strategy) { namespace fs = std::filesystem; const auto copy_options = fs::copy_options::update_existing | fs::copy_options::recursive; @@ -189,12 +185,12 @@ void UserDataMigrator::MigrateUserData( std::string legacy_cache_dir; #define LEGACY_EMU(emu) \ -case LegacyEmu::emu: \ + case LegacyEmu::emu: \ legacy_user_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##Dir).string(); \ legacy_config_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##ConfigDir) \ - .string(); \ + .string(); \ legacy_cache_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##CacheDir) \ - .string(); \ + .string(); \ break; switch (selected_legacy_emu) { @@ -216,7 +212,20 @@ case LegacyEmu::emu: \ switch (strategy) { case MigrationStrategy::Link: // Create symlinks/directory junctions if requested - fs::create_directory_symlink(legacy_user_dir, eden_dir); + + // Windows 11 has random permission nonsense to deal with. + try { + fs::create_directory_symlink(legacy_user_dir, eden_dir); + } catch (const fs::filesystem_error &e) { + QMessageBox::critical( + main_window, + main_window->tr("Link Failed"), + main_window + ->tr("Linking the old directory failed. You may need to re-run with " + "administrative privileges on Windows.\nOS gave error: %1") + .arg(main_window->tr(e.what()))); + std::exit(127); + } // Windows doesn't need any more links, because cache and config // are already children of the root directory @@ -260,9 +269,11 @@ case LegacyEmu::emu: \ } success_text.append( - main_window->tr("\n\nIf you wish to clean up the files which were left in the old " - "data location, you can do so by deleting the following directory:\n" - "%1").arg(QString::fromStdString(legacy_user_dir))); + main_window + ->tr("\n\nIf you wish to clean up the files which were left in the old " + "data location, you can do so by deleting the following directory:\n" + "%1") + .arg(QString::fromStdString(legacy_user_dir))); break; }