Improve GPU storage buffer detection and memory access patterns:
- Expand NVN bias address range (0x100-0x800 vs 0x110-0x610)
- Increase alignment from 16 to 32 bytes for optimal memory access
- Raise default alignment from 8 to 16 bytes for non-biased addresses
- Refactor bias handling code for better readability
- Add detailed performance-related comments
These changes help identify more storage buffers within shaders and
ensure memory accesses are better aligned, which improves overall
shader compilation and execution performance.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Adds a new cross-platform memory management system with enhanced capabilities:
- Fault-managed memory allocation for Linux/Android platforms
- Memory snapshot and differential snapshot support
- Predictive memory reuse tracking for optimized access patterns
- Vulkan compute buffer integration
- User-configurable settings for enabling features
The system integrates with the existing Vulkan renderer to provide more
efficient memory handling, especially for compute-intensive workloads.
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>
Improve GPU storage buffer detection and memory access patterns:
- Expand NVN bias address range (0x100-0x800 vs 0x110-0x610)
- Increase alignment from 16 to 32 bytes for optimal memory access
- Raise default alignment from 8 to 16 bytes for non-biased addresses
- Refactor bias handling code for better readability
- Add detailed performance-related comments
These changes help identify more storage buffers within shaders and
ensure memory accesses are better aligned, which improves overall
shader compilation and execution performance.
Update Vulkan dependencies to their latest versions.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit makes two significant improvements:
1. Vulkan renderer:
- Detect and properly handle reversed depth buffers (clear_depth < 0.5)
- Force depth write enable when needed with reversed depth
- Use GREATER_OR_EQUAL comparison for reversed depth scenarios
- Fix transparency issues in games like Civilization 7 by adjusting blend factors
- Add detailed logging for depth buffer operations
2. Friend service:
- Implement previously stubbed functions including EnsureFriendListAvailable
and EnsureBlockedUserListAvailable
- Add proper event signaling to prevent games from hanging
- Implement Cancel function for improved compatibility
- Update copyright notice for the Citron project
These changes improve compatibility with modern games using reversed depth
buffers and prevent hangs in titles that rely on Friend service functionality.
Co-authored-by: m33ts4k0z <m33ts4k0z@citron-emu.org>
Co-committed-by: m33ts4k0z <m33ts4k0z@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Implement a robust asynchronous shader compilation system inspired by commit
1fd5fefcb1. 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>
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>
Add a flexible memory region management system that provides:
- Memory region type classification (System, Graphics, IO, Binary)
- Memory region permission management (executable, writable)
- Binary base address randomization for ASLR
- Dynamic memory mapping capabilities
Credit: boss.smc@citron-emu.org
Signed-off-by: Zephyron <zephyron@citron-emu.org>
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>
- Change SDL2 bundled version from 2.32.0 to 2.28.2
- Downgrade clang-format version from 18 to 15
- Replace citron-emu.org URLs with GitHub mirror URLs:
- Update clang-format download URL to use yuzu-mirror repository
- Update package base URL for external dependencies
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Update Vulkan-Headers from cacef303 to 78c35974
- Update VulkanMemoryAllocator from c788c521 to 29b35ea4
- Update vcpkg from e40d24cb to a7d06b3a
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add copyright notice for citron Emulator Project
- Standardize Nintendo vendor ID format to uppercase (057E) in Bluetooth controller rules
- Maintain same permissions and access settings for all controllers
REF: 6ead429195
Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/106
Co-authored-by: deftdawg <deftdawg@noreply.localhost>
Co-committed-by: deftdawg <deftdawg@noreply.localhost>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit disables the "Kiosk (Quest) Mode" checkbox in the debug configuration
UI by setting it to non-interactive and adding a tooltip indicating that the
feature has been disabled.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit disables the "Enable Auto-Stub" checkbox in the debug configuration
UI by setting it to non-interactive and adding a tooltip indicating that the
feature has been disabled.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Modify CMakeLists.txt to detect whether the host system is Windows or Linux
- Set VCPKG_HOST_TRIPLET dynamically to either "x64-windows" or "x64-linux" based on CMAKE_HOST_SYSTEM_NAME
- Previously, the host triplet was hardcoded to "x64-windows", which prevented proper building on Linux hosts
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Added registration for the 'ssl:s' service using the same implementation as
the regular 'ssl' service. This fixes issues with certain titles that hang indefinitely while
waiting for this service to become available.
The issue appears in logs as:
"Server is not registered! service=ssl:s"
"Waiting for service ssl:s to become available"
This is a simple fix that reuses the existing SSL implementation instead of
creating a separate one, as both services share the same functionality.
This commit enhances the Multiplayer Function
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit addresses critical TLB (Translation Lookaside Buffer) issues on Android by implementing several optimizations:
- Add new BufferCacheAccelerator to manage memory range overlap detection
- Implement TLB-aware memory barriers to prevent unnecessary invalidations
- Add a TLB caching system to avoid redundant flushing operations
- Create a counter to limit outstanding memory operations and prevent TLB thrashing
- Implement TLB prefetching for better memory access patterns
- Add targeted memory barriers for more precise synchronization
These changes significantly reduce the likelihood of the "0.0 FPS deadlock" issue on Android devices by maintaining a more stable TLB state and preventing cache thrashing.
TODO: Merge & Adapt Camille LaVey's TLB Method To Further Improve
Signed-off-by: Zephyron <zephyron@citron-emu.org>
The Profile-Guided Optimization configuration was previously placed at the
end of the CMakeLists.txt file, after all targets were already defined.
This was causing the PGO flags to have no effect on the build process.
This commit moves the PGO configuration to immediately after the initial
compiler flags setup and before any targets are defined, ensuring that
all targets will properly receive the PGO instrumentation or optimization
flags when those options are enabled.
This allows both CITRON_ENABLE_PGO_INSTRUMENT and CITRON_ENABLE_PGO_OPTIMIZE
to function correctly for all build targets.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Added conditional check for AMD graphics drivers
- Automatically disable logic operations when float vertex attributes
are present to work around driver quirks
- Maintain original logic op state to preserve emulator behavior
- Prepare dynamic state management infrastructure for future
OpenGL implementation changes
OpenGL implementation will follow in subsequent commits.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- This Commit Accidentally Slipped By In A Previous Commit (dad8859679)
- This Has Caused Many Errors & Networking Issues Particularly On Android
- Now Uses Safe, Default 1.02 GHz
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Update Kotlin from 1.9.20 to 2.1.20-RC2
- Upgrade Java version from 17 to 21
- Update Android Gradle plugin from 8.1.2 to 8.9.0
- Update Gradle wrapper from 8.10.2 to 8.11.1
- Update NDK version to 29.0.13113456 rc1
- Update all Android dependencies to latest versions
- Simplify ARM NCE implementation by removing custom TLB handling
- Improve alignment and access fault handling
- Update hardware BASE_CLOCK_RATE from 1.02GHz to 1.785GHz
- Add citron Emulator Project copyright notices
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Update the following external dependencies:
- Vulkan-Headers: 0f0cfd8 → cacef303
- Vulkan-Utility-Libraries: 50563f4 → bc3a4d9f
- vcpkg: cd1099f4 → e40d24cb
This commit updates the external dependencies to their latest
compatible versions to ensure we're using up-to-date libraries.
- Removed "Open Quickstart Guide" menu item and associated functions
- Replaced ROM loading error popup containing quickstart guide links
with a neutral disclaimer stating the software is provided as-is
without warranty or support
- This change helps minimize legal liability by avoiding
specific instructional content while directing users to community
resources for assistance
Adds support for Profile-Guided Optimization builds on both Windows (MSVC)
and Linux (GCC/Clang) platforms. This allows for performance optimizations
based on real usage patterns.
For MSVC:
- Adds /GL and /LTCG:PGINSTRUMENT flags for instrumentation
- Adds /GL and /LTCG:PGOPTIMIZE flags for optimization
For GCC:
- Adds -fprofile-generate flags for instrumentation
- Adds -fprofile-use flags for optimization
For Clang:
- Adds -fprofile-instr-generate flags for instrumentation
- Adds -fprofile-instr-use flags for optimization
Controlled by two new CMake options:
- CITRON_ENABLE_PGO_INSTRUMENT: Enable instrumentation build
- CITRON_ENABLE_PGO_OPTIMIZE: Enable optimization build
Updated submodules:
- Vulkan-Headers to 0f0cfd8
- Vulkan-Utility-Libraries to 50563f4
- vcpkg to cd1099f