summaryrefslogtreecommitdiff
path: root/src/video_core
AgeCommit message (Collapse)Author
2025-03-06revert 031c635095622a35982f7f6faef894df9583e888Zephyron
revert arm: corrected declarations
2025-03-05arm: corrected declarationsCamilleLaVey
2025-03-03revert cbb9a35166f18f8eebe31e9976e66094388fb8abCamilleLaVey
revert Re-Enabled Vulkan Functions disabled on Adreno to improve compatibility and performance and check further issues within the current changes.
2025-03-02Re-Enabled Vulkan Functions disabled on Adreno to improve compatibility and ↵CamilleLaVey
performance and check further issues within the current changes.
2025-02-22vulkan: Improve memory allocation robustnessZephyron
Enhances the Vulkan memory allocator with better OOM handling and memory alignment: * Add memory recovery by cleaning up empty allocations before failing * Implement proper fallback to non-device-local memory * Simplify memory alignment handling for different vendors * Add better error logging for allocation failures * Add IsEmpty() helper to track unused allocations * Fix alignment requirements for Adreno (4KB) vs other vendors These changes improve the robustness of memory allocation, particularly in low-memory situations, and streamline vendor-specific alignment requirements.
2025-02-16texture_cache: Add equality operators for ImageInfo and ImageViewInfoZephyron
- Add operator== to ImageInfo and ImageViewInfo classes to enable direct equality comparisons. The implementations use std::tie to perform member-wise comparisons of all relevant fields in a safe and efficient manner. This allows for easier comparison of texture cache entries and view information, which can be useful for cache management and debugging.
2025-02-16build: upgrade fmt and SDL2Zephyron
Update fmt library to version 11.0.2 and make necessary adjustments: - Replace fmt/format.h includes with fmt/ranges.h - Add const qualifiers to formatter::format functions - Update CMake to require fmt version 11 Additional dependency updates: - Update SDL2 bundled version from 2.28.2 to 2.32.0 - Update catch2 to version 3.8.0 - Update vcpkg baseline to c82f74667287d3dc386bce81e44964370c91a289
2025-02-09vulkan: Rename resolve_image to resolve_image_holderZephyron
Fix Android compilation with latest NDK (28.0.13004108) and Java JDK 21 by renaming the resolve_image variable to resolve_image_holder to avoid potential naming conflicts. This change helps maintain compatibility with the updated build toolchain while keeping the core functionality intact. The change affects the MSAA image copy operation in the Vulkan texture cache implementation.
2025-02-09Revert "Replace yuzu identifiers with citron"Zephyron
This reverts commit d4ad55ed21047747698618e97dfa727d454c3c96.
2025-02-09Replace yuzu identifiers with citronZephyron
Update magic numbers and default identifiers across codebase: - UUID default value - Thread magic number - Amiibo name - Vulkan cache magic number - Shader cache magic number
2025-02-04vulkan: Add Samsung driver workaroundsZephyron
Add workarounds for Samsung Xclipse GPUs: - Disable extendedDynamicState3ColorBlendEquation as it is broken in Samsung drivers, similar to AMD drivers - Add Samsung's proprietary driver to the validated driver list for clock boosting - Fix log message to indicate both AMD and Samsung drivers have broken color blend equation support Remove stray logical OR operator from validated_driver condition.
2025-02-03video_core/vulkan: Improve texture format conversion handlingZephyron
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-02-02vulkan: Implement native MSAA resolve in texture cacheZephyron
Implements hardware-accelerated MSAA resolve functionality in the Vulkan texture cache instead of relying on compute shaders. This change: - Adds proper MSAA to non-MSAA image copy support using VkResolveImage - Creates temporary resolve images with appropriate memory allocation - Handles format compatibility checks with proper fallback to compute - Manages image layout transitions and memory barriers - Preserves existing compute shader fallback for unsupported formats The implementation follows Vulkan best practices for MSAA resolve operations and should provide better performance for supported formats.
2025-02-02vulkan: Add 4KB memory alignment for AMD and Qualcomm driversZephyron
Adds special handling for memory allocation size on AMD and Qualcomm (Adreno) drivers by aligning allocations to 4KB boundaries. This fixes potential memory allocation issues on these drivers where unaligned allocations may fail or cause undefined behavior. Affected drivers: - AMD Proprietary (AMDVLK) - AMD Open Source (RADV) - Qualcomm Proprietary (Adreno)
2025-02-01video_core: Add new shader format conversion pipelinesZephyron
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-02-01video_core: Add sRGB to D24S8 depth-stencil conversion supportZephyron
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-01-27vulkan: Relax VRAM allocation limits for better stabilityZephyron
Adjusts VRAM allocation strategy to be more conservative while maintaining performance: - Increases reserve memory from 1/8th to 1/4th (max 2GB) for discrete GPUs - Increases base memory limit from 6GB to 8GB - Doubles resolution scaling memory from 1GB to 2GB per scale factor - Reduces system memory reservation from 8GB to 4GB for integrated GPUs - Increases maximum memory limit from 4GB to 6GB for integrated GPUs These changes help prevent memory leaks while still providing adequate VRAM for optimal performance.
2025-01-27android: Fix compilation by adding missing log.h includeZephyron
Adds missing include for common/logging/log.h in gpu.h which was causing compilation failures on Android. This header is needed for logging functionality used in GPU-related operations. The include was previously indirectly available through other headers, but making it explicit improves code clarity and prevents potential future compilation issues.
2025-01-26buffer_cache: Simplify storage buffer binding logicZephyron
Reverts overly restrictive storage buffer validation and size calculation that was causing rendering issues in The Legend of Zelda: Tears of the Kingdom, particularly in underground/depth areas. The simplified approach: - Uses GetMemoryLayoutSize() instead of manual page probing - Removes unnecessary 4GB memory bounds validation - Streamlines address translation and alignment handling This fixes numerous reported cases of missing or corrupted rendering in TOTK's underground areas where storage buffer operations are heavily used for depth-related effects.
2025-01-21service/nvdrv: Relax GPU validation and improve error handlingZephyron
Relaxes validation checks in the NVDRV GPU service and improves error notifier handling to prevent potential hangs. Key changes: - Remove strict size validation in SetErrorNotifier - Relax GPFIFO entry count validation to only check for non-zero values - Add proper error notifier state tracking in GPU class - Improve debug logging messages The previous strict validation was causing issues with some games like ACNH. These changes maintain necessary checks while being more permissive with edge cases that don't impact functionality. Technical changes: - Store error notifier state in GPU class for future implementation - Remove upper bound check on GPFIFO entries - Simplify error notifier setup flow This should resolve hanging issues while maintaining core functionality.
2025-01-20service/nvdrv: Implement stubbed GPU functionsZephyron
Implements several previously stubbed functions in the NVDRV service: - Initialize proper transfer memory handling - Add error notifier configuration - Implement channel timeout and timeslice management - Add object context allocation and tracking - Add GPU interface stubs for new functionality The changes improve the accuracy of GPU-related operations while maintaining compatibility with the existing codebase. All functions now properly validate parameters and handle endianness correctly using _le types.
2025-01-18arm/video: Fix shader extension and exception handlingZephyron
Two main changes in this commit: 1. Replace NVIDIA-specific GL_NV_gpu_shader5 extension with the more widely supported GL_EXT_shader_explicit_arithmetic_types_float16 in the scaleforce shader. This improves compatibility across different GPU vendors. 2. Refactor ARM32 exception handling: - Restructure exception cases for better readability - Update exception handling to match current Dynarmic API - Fix indentation in switch statement - Remove AccessViolation case as it's no longer supported in current API These changes improve shader compatibility and align the exception handling with the current Dynarmic implementation.
2025-01-14Revert incorrect copyright attribution for non-contributed filesZephyron
- In commit b3facaa6bb30cdc39f2b7d632fef1e3bfeee7785, the copyright header was updated to include "Citron Homebrew Project" across multiple files, regardless of whether any contributions were made. - This commit removes the incorrect attribution and reverts the copyright header to its previous state. - Copyright attribution should only be added when meaningful contributions have been made to the file. - This commit ensures proper compliance with copyright standards and maintains correct attribution to the respective contributors. - Special thanks to Tachi for pointing out the need for these corrections and ensuring that proper attribution practices are followed.
2025-01-13Android: Update build system and dependenciesZephyron
- Update Gradle from 8.1 to 8.10.2 - Update Android Gradle Plugin from 8.1.2 to 8.8.0 - Update Kotlin from 1.9.20 to 2.1.20-Beta1 - Update various AndroidX dependencies to latest versions - Update NDK from 26.1 to 27.2 (with RC1/RC2 options commented) - Update Java target from 17 to 21 - Update Android target SDK from 34 to 35 - Enable additional optimizations in release builds: - Enable shrinkResources - Use proguard-android-optimize.txt - Disable JNI debugging - Replace vector drawables with PNG for ic_citron - Comment out unused ComputeInline constant in dma_pusher.cpp - Update Gradle wrapper and configuration files This updates the Android build system and dependencies to their latest versions while enabling additional optimizations for release builds. The ic_citron icon was converted from vector to PNG format for better compatibility.
2025-01-09vulkan: Fix crashes with bindless texture constant buffer handlingZephyron
Previously, the code would unconditionally add a constant buffer descriptor at index 0 whenever storage buffers were present, which could cause conflicts and crashes. This change: - Adds validation to check if constant buffer 0 already exists - Only adds the descriptor if it's not already present - Prevents potential descriptor conflicts in shaders This should resolve crashes in Vulkan games related to invalid descriptor layouts and resource binding conflicts.
2025-01-08vulkan: Add bindless texture constant buffer support in compute pipelineZephyron
Add support for bindless texture constant buffers in the compute pipeline creation process. When storage buffer descriptors are present, create a constant buffer descriptor to handle bindless textures. This fixes the "Failed to track bindless texture constant buffer" error. Changes: - Add constant buffer descriptor with index 0 and count 1 when storage buffers are present - Place descriptor creation before SPIR-V code generation to ensure proper shader compilation This resolves issues with bindless texture access in compute shaders.
2025-01-02buffer_cache: Fix storage buffer memory validation and size detectionZephyron
Fixes the StorageBufferBinding function to properly handle memory validation and size detection. Key changes include: - Fix ReadBlock usage to properly handle void return values - Implement safer memory validation using byte-level reads - Improve size detection logic for storage buffers - Fix NVN buffer size reading - Add proper bounds checking for device memory addresses - Add better error logging for invalid conditions This addresses the "Failed to find storage buffer for cbuf index 0" errors by implementing more robust memory validation and size detection. The changes ensure proper handling of invalid memory addresses and prevent crashes from accessing out-of-bounds memory.
2025-01-02video_core: Enforce safe memory reads for compute dispatchZephyron
- 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.
2024-12-31core: Update copyright headersZephyron
- Update copyright headers to include Citron Homebrew Project - Add 2025 to copyright years
2024-12-31chore: update project references and add Citron copyrightZephyron
- Replaced all references to the old project name with Citron. - Added Citron copyright information alongside existing notices in all files.
2024-03-04"Merge Tagged PR 13178"yuzubot
2024-02-27Merge pull request #13171 from liamwhite/fake-addressliamwhite
texture_cache: do not track invalid addresses
2024-02-27general: workarounds for SMMU syncing issues (#12749)liamwhite
2024-02-27vk_rasterizer: flip scissor y on lower left origin mode (#13122)liamwhite
2024-02-27buffer_cache: avoid overflow in usage tracker (#13166)liamwhite
2024-02-27texture_cache: use two-pass collection for costly load resources (#13096)liamwhite
2024-02-26Merge pull request #13172 from liamwhite/gl-streamsNarr the Reg
renderer_opengl: declare geometry stream support in profile
2024-02-26renderer_opengl: declare geometry stream support in profileLiam
2024-02-26settings: remove global override for smash on amdvlkLiam
2024-02-26video_core: make gpu context aware of rendering programLiam
2024-02-26texture_cache: do not track invalid addressesLiam
2024-02-22Merge pull request #13001 from liamwhite/scaled-availabilityNarr the Reg
vulkan_device: don't use fixed cap for memory limits
2024-02-22Merge pull request #13075 from liamwhite/mali-having-a-bad-timeNarr the Reg
shader_recompiler: throw on missing geometry streams in geometry shaders
2024-02-20Merge pull request #10529 from liamwhite/critical-spacingMatías Locatti
caches: make critical reclamation less eager and possible in more cases
2024-02-19scope_exit: Make constexprFearlessTobi
Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
2024-02-19shader_recompiler: throw on missing geometry streams in geometry shadersLiam
2024-02-18vulkan_device: don't use fixed cap for memory limitsLiam
2024-02-13buffer_cache: use mapped range with large vertex buffer sizeLiam
2024-02-13Merge pull request #12975 from FernandoS27/keep-your-own-vodoo-doll-away-from-gfliamwhite
Texture Cache: Fix untracking on GPU remap
2024-02-11Merge pull request #12756 from liamwhite/applet-multiprocess-hwcNarr the Reg
general: applet multiprocess