Commit graph

27142 commits

Author SHA1 Message Date
Zephyron
4c54213853 video_core: Enhance Vulkan shader compilation with async threading system
Implement a robust asynchronous shader compilation system inspired by commit
1fd5fefcb17fe7fe65faed1c991fb41db782ab0f. This enhancement provides:

- True multi-threaded shader compilation with atomic status tracking
- Persistent disk caching for faster shader loading
- Command queue system for background processing
- Integration with Citron's scheduler for better resource management
- Parallel shader loading to reduce startup times
- Improved error handling and recovery mechanisms

These changes significantly reduce shader compilation stuttering and improve
overall performance when using asynchronous shaders. The implementation
maintains compatibility with Citron's existing architecture while adding
more robust threading capabilities.

Co-authored-by: boss.sfc <boss.sfc@citron-emu.org>
Co-committed-by: boss.sfc <boss.sfc@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-04-12 23:39:24 -03:00
Zephyron
c6b1f5e5d5 feat(vulkan): implement enhanced texture and shader management
This commit adds improved Vulkan functionality to the Citron emulator:

- Add thread-safe texture management with automatic error recovery
- Implement shader caching with validation support
- Add robust error handling for Vulkan operations
- Implement platform-specific initialization for Windows, Linux, and Android

These enhancements improve stability when handling texture loading errors
and provide better recovery mechanisms for Vulkan failures.

Co-authored-by: boss.sfc <boss.sfc@citron-emu.org>
Co-committed-by: boss.sfc <boss.sfc@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-04-12 23:39:19 -03:00
Zephyron
065d79019f build: fix linux compilation
- Removes unnecessary \ from Copyright Line Causing Linux Builds To Fail

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-04-12 23:37:27 -03:00
Zephyron
6c193596a7 WIP: Enhance shader compilation performance and control
This commit adds new settings and optimizations for shader compilation:

- Add new settings:
  - use_enhanced_shader_building: Enable enhanced shader compilation
  - shader_compilation_priority: Control shader compilation priority

- Improve shader compilation performance:
  - Optimize worker thread allocation based on CPU cores
  - Add smarter async shader compilation heuristics
  - Prioritize vertex and fragment shader compilation
  - Add performance tracking and logging

- Add performance monitoring:
  - Track shader compilation times
  - Log slow shader compilations
  - Monitor async shader compilation statistics

This is a work in progress commit. Further optimizations and refinements
will be needed based on testing and feedback.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-04-12 23:37:11 -03:00
JPikachu
39325100b2 Service: Add AliasRegionExtraSize
Thanks to Briar for finding and testing the Service
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-12 22:54:32 -03:00
d1919ceda7 WIP: DO-NOT-MERGE: NCE experiments: Better Pre-Fetch implementation
should make it more performatic as in use with new lru cache implmentation
2025-04-12 22:54:32 -03:00
b86e0dfbc2 WIP: DO-NOT-MERGE: NCE experiments: Better LRU cache implementation
It uses a better lru implementation, since initial as basic functions to LRU, use a modern system to it to make performance better
2025-04-12 22:54:32 -03:00
42b5a02d38 RenderVulkan Experiments: DO-NOT-MERGE: Only recreate when necessary and NEAREST 2025-04-12 22:54:32 -03:00
bfc75c2af7 RenderVulkan Experiments: DO-NOT-MERGE: Introduce functionality to frame interpolation
The functionality acts much more like a real-time downscale since the FSR1 used by Yuzu is not compatible with a real interpolation and is just upscale and downscale.
2025-04-12 22:54:32 -03:00
Pavel Barabanov
8019203db7 Optimize SpiriV output 2025-04-12 22:54:32 -03:00
Pavel Barabanov
b428ffedda delete "enable" in setting.h 2025-04-12 22:54:32 -03:00
Pavel Barabanov
b9fc86c707 FRAME_SKIPPING and FRAME_INTERPOLATION only android and delete "enable" 2025-04-12 22:54:32 -03:00
Pavel Barabanov
79a47bed44 Add sync core speed 2025-04-12 22:54:32 -03:00
Pavel Barabanov
4fb7481fa2 Android: add FRAME_SKIPPING and FRAME_INTERPOLATION 2025-04-12 22:54:32 -03:00
91b3d4aaf1 Revert "Merge branch 'pr-12'"
This reverts commit dfe104bbb96b52f47943462c296ecbcb046dffdf, reversing
changes made to 00121d6812.
2025-04-12 22:54:32 -03:00
JPikachu
e5532bcf0f Implement additions to nvdr services
Fixes log error: "[  41.472933] Debug <Critical> core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp:operator():81: Assertion Failed! Unimplemented ioctl=C0084713"

Credit: Antique - Sudachi dev, for the base Implementation and Citron for slight additions.
2025-04-11 17:48:09 -03:00
Zephyron
00121d6812 video_core/vulkan: Improve texture format conversion handling
Refactors and improves the texture format conversion system in the Vulkan
renderer:

- Adds proper sRGB to linear conversion for depth formats
- Improves shader accuracy for ABGR8 SRGB to D24S8 conversion
- Adds gamma correction and proper depth range clamping
- Moves GetSupportedFormat implementation to header
- Cleans up format conversion switch statement
- Removes redundant format conversion paths

The changes improve accuracy when converting between color and depth
formats, particularly for sRGB sources. The shader improvements ensure
proper gamma correction and depth range handling.

Technical changes:
- Improves sRGB to linear conversion in fragment shader
- Adds proper depth value clamping
- Consolidates format conversion logic
- Removes duplicate GetSupportedFormat implementation
2025-04-11 17:05:41 -03:00
Zephyron
4d72791752 video_core: Add new shader format conversion pipelines
Adds several new shader-based format conversion pipelines to support additional
texture formats and operations:

- RGBA8 to BGRA8 conversion
- YUV420/RGB conversions
- BC7 to RGBA8 decompression
- ASTC HDR to RGBA16F decompression
- RGBA16F to RGBA8 conversion
- Temporal dithering
- Dynamic resolution scaling

Updates the texture cache runtime to handle these new conversion paths and adds
helper functions to check format compatibility for dithering and scaling
operations.

The changes include:
- New shader files and CMake entries
- Additional conversion pipeline setup in BlitImageHelper
- Extended format conversion logic in TextureCacheRuntime
- New format compatibility check helpers
2025-04-11 17:05:30 -03:00
Zephyron
6ac75a59bc video_core: Add sRGB to D24S8 depth-stencil conversion support
Implements conversion from sRGB color formats to D24S8 depth-stencil format
in the Vulkan renderer. This change includes:

- New fragment shader convert_abgr8_srgb_to_d24s8.frag that handles proper
  sRGB to linear conversion before depth calculation
- Added shader to CMake build system
- Extended BlitImageHelper with new conversion pipeline and methods
- Updated texture cache to handle sRGB to D24S8 format conversion paths

The conversion properly handles sRGB color space by first converting to
linear space before calculating luminance values for the depth component,
while preserving alpha channel data for the stencil component.
2025-04-11 17:05:20 -03:00
1f98e3e5a6 WIP: DO-NOT-MERGE: NCE experiments: Initial LRU 2025-04-11 17:05:06 -03:00
18925139a7 WIP: DO-NOT-MERGE: NCE experiments: Fix build errors 2025-04-11 17:04:55 -03:00
3cca503f7a WIP: DO-NOT-MERGE: NCE experiments: Some optimizations on pre-fetch and cache 2025-04-11 17:04:45 -03:00
6e6fae364f WIP: DO-NOT-MERGE: NCE experiments: Ensure guest context reflects thread state during unlock 2025-04-11 17:04:34 -03:00
a15ab954c3 WIP: DO-NOT-MERGE: NCE experiments
botw boots but with poor performance
2025-04-11 17:04:24 -03:00
180375673a revert 528c09ae72
This needs to be put aside for now, but may be implemented again later
2025-04-10 03:45:51 +00:00
aeaa9dc2b5
Fix controls config dialog
Signed-off-by: swurl <swurl@swurl.xyz>
2025-04-10 02:38:34 +02:00
c3a5f5930f
Update fmt to allow for v11
Signed-off-by: swurl <swurl@swurl.xyz>
2025-04-10 01:11:22 +02:00
Briar
848fd4b34c
android: Improve network gateway handling 2025-04-10 00:40:07 +02:00
PabloMK7
d9c0ec8f83 Pre alpha watermark
* android: Add pre-alpha warning dialog and banner

* qt: android: Add pre-alpha warning banner
2025-04-10 00:18:18 +02:00
Briar
b7a3146c2f
core: Add support for game settings overrides (#6)
* core: Add support for game settings overrides
---------

Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com>
Co-authored-by: zhang wei <zwdreams@gmail.com>
2025-04-09 23:44:33 +02:00
Briar
2dd8d09c7b
Refactor Android Game Screen UI
* Port SearchFragment functionality to GameFragment @kleidis

Co-authored-by: Briar <205427297+icybriarr@users.noreply.github.com>

* Remove the bottom navigation bar and SearchFragment remaining code @ishan09811

* Add 2 new game view types `Grid & `List` to GameAdapter @kleidis

* Fix padding on header

* Change app name to uppercase

---------

Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com>
Co-authored-by: Briar <205427297+icybriarr@users.noreply.github.com>
Co-authored-by: Ishan09811 <156402647+Ishan09811@users.noreply.github.com>
2025-04-09 00:01:32 +02:00
JPikachu
08ac410558
Implement LogicOP Workaround for Vulkan on AMD GPUs
This fixes black sewers in Paper Mario: TTYD
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-08 19:17:28 +02:00
Briar
e59f7922a1 Revert "Disabled MCO_USE_VMEM_ALLOCATOR because standard stack size seems to suffice"
This reverts commit 05646e6000.
2025-04-06 22:52:55 -03:00
10a3a9d748 Use u32 instead of int
fix windows build error
2025-04-04 03:40:50 +02:00
bb3971767e Unified torzu and sudachi friend.cpp + fix android build on dma_pusher 2025-04-04 03:40:49 +02:00
ab89fdb426 add boost-headers (again) 2025-04-04 03:40:49 +02:00
Pavel Barabanov
2f469fa9c2 Added the GetKeyCodeMapByPort service, thanks JPikachu for the tip. 2025-04-04 03:40:49 +02:00
Pavel Barabanov
dfbdf448eb Slightly changed the overlay design 2025-04-04 03:40:49 +02:00
pavelbarabanov
875a0d7e4a Обновить src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
- Add MEM overlay
- Add thermal overlay to show temperature in C/F with color indication
2025-04-04 03:40:49 +02:00
JPikachu
8e6707da5e Update freind, nifm and nim stubs
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-04 03:40:49 +02:00
Zephyron
17e68e6d70 video_core: Enforce safe memory reads for compute dispatch
- Modify DmaPusher to use safe memory reads when handling compute
  operations at High GPU accuracy
- Prevent potential memory corruption issues that could lead to
  invalid dispatch parameters
- Previously, unsafe reads could result in corrupted launch_description
  data in KeplerCompute::ProcessLaunch, causing invalid vkCmdDispatch
  calls
- By enforcing safe reads specifically for compute operations, we
  maintain performance for other GPU tasks while ensuring compute
  dispatch stability

This change requires >= High GPU accuracy level to take effect.
2025-04-04 03:40:49 +02:00
EmulationEnjoyer
5a3be92a5f Implement HID function stub "SetGestureOutputRanges" (#105)
Add function stub for "SetGestureOutputRanges" in HID service

Fixes userspace panic when booting Donkey Kong Country Returns HD:

> Debug <Critical> core\hle\service\service.cpp:operator ():78: Assertion Failed!
Unknown / unimplemented function '92(<unknown>)': port='hid' cmd_buf={[0]=0x6, [1]=0x8000000C, [2]=0x1, [3]=0x0, [4]=0x4F434653, [5]=0x0, [6]=0x0, [7]=0x0, [8]=0x49434653}
> Service.AM <Info> core\hle\service\am\service\application_functions.cpp:SetTerminateResult:187: (STUBBED) called, result=0x1a80a (2010-0212)
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:52: Userspace PANIC! info1=0x0000001086D02C4C, info2=0x0000000000000004
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:operator ():33: debug_buffer_err_code=1A80A
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:102: Emulated program broke execution! reason=0x0000000000000000, info1=0x0000001086D02C4C, info2=0x0000000000000004

ref: 132077e18f

![](https://i.imgur.com/hbBnlYs.png)

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/105
Co-authored-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
Co-committed-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
2025-04-04 03:40:49 +02:00
EmulationEnjoyer
8a5a52f546 Update src/audio_core/common/feature_support.h
Updated AudioCore Revision from 11 -> 13
2025-04-04 03:40:49 +02:00
Zephyron
528c09ae72 kernel: Implement SystemResourceSize info type for VAMM initialization
Adds support for InfoType::SystemResourceSize (0x1C) which is required for
proper initialization of the Virtual Address Memory Manager (VAMM). This
implementation:

1. Adds SystemResourceSize to the InfoType enum in svc_types.h
2. Implements the GetInfo handler for SystemResourceSize in svc_info.cpp
3. Returns 512MB (0x20000000 bytes) as the system resource size
4. Adds debug logging for the SVC call

The 512MB value is chosen based on typical system resource allocations
needed for VAMM initialization on the Nintendo Switch.

This fixes crashes in games that rely on VAMM functionality, particularly
during nn::os::detail::VammManager::InitializeIfEnabled().
2025-04-04 03:40:49 +02:00
MrPurple666
eee726ca81 Add the rest of the necessary code for ssl:s
Credit: Antique - (Sudachi) Dev [https://sudachi.emuplace.app/]

Signed-off-by: MrPurple666 <antoniosacramento666@gmail.com>
2025-04-04 03:40:49 +02:00
JPikachu
0c6a8f4808 Update ssl stubs
Updated the ssl stubs to implement ssl:s for Firmware 19
This should make Xenoblade X: Definitive Edition bootable
Credit: Antique - (Sudachi) Dev [https://sudachi.emuplace.app/]
2025-04-04 03:40:48 +02:00
JPikachu
4f54b8076c Rewrote mm:u to follow switchbrew.org documentation and update them
Credit: Antique - [Sudachi Dev] (https://sudachi.emuplace.app/)
2025-04-04 03:40:48 +02:00
darktux
05646e6000 Disabled MCO_USE_VMEM_ALLOCATOR because standard stack size seems to suffice 2025-04-04 03:40:48 +02:00
darktux
9e3c2d56d6 Add SR_WScaleFactorXY/SR_WScaleFactorZ stubs for Prince of Persia (#5)
Pulled in and cleaned up from Sudachi

Reviewed-on: http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/darktux/torzu/pulls/5
Co-authored-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
Co-committed-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
2025-04-04 03:40:48 +02:00
darktux
e2486f1217 Remove accidental use of standard format instead of libfmt format 2025-04-04 03:40:48 +02:00