summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
AgeCommit message (Collapse)Author
2025-05-12fix(renderer_vulkan): resolve asynchronous presentation crashes and ↵Zephyron
compilation errors Fix multiple issues in the Vulkan asynchronous presentation implementation: - Convert regular mutexes to timed_mutex for timeout support - Use condition_variable_any for compatibility with timed_mutex - Fix thread synchronization with proper locking and error handling - Add VkResultToString helper to replace missing ToString function - Implement better error recovery with recreation attempt limits - Add comprehensive logging for better troubleshooting These changes make the asynchronous presentation feature more robust and less prone to deadlocks, while keeping it disabled by default since it may still cause instability in some games. Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-12refactor(vulkan): remove depth buffer workarounds and excessive loggingZephyron
- Remove special handling for reversed depth scenarios that were added for Civilization 7 - Remove excessive logging in Vulkan renderer - Update Discord client ID
2025-05-12renderer/friend: Improve reversed depth handling and Friend serviceZephyron
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>
2025-05-12vulkan: Implement AMD driver workaround for logic operationsZephyron
- 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>
2025-05-12build: 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.7.1 - Update vcpkg baseline to ca846b21276c9a3171074ac8d2b4f6516894a7d0
2025-05-11vulkan: 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-05-11video_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-05-11vulkan: 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-05-11video_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-05-11video_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-05-11vulkan: 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-05-11vulkan: 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.
2024-12-20externals: update fmt to 11.0.2 and vcpkg to 2024.09.30 (#68)lui
Updated to fmt 11 with the required source changes for it to work. Also updated vcpkg for this, and as an added benefit it fixes the `Unable to find a valid Visual Studio instance` error, and the VS 2019 build tools are no longer required. Just make sure to delete the existing downloaded vcpkg tool and binaries in `externals/vcpkg` if you have compiled before, or else it will continue to use the old version and give the error. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/68 Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion> Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2024-12-20renderer: add area sampling scaling method (#57)lui
Adds Area Sampling to the list of scaling options. Works well to achieve a high-quality, smooth super-sampling effect. Dolphin has had this for a while, and now Ryujinx has recently added it too, so I decided to port it. Not sure if adding the extra uniform to the OpenGL WindowAdaptPass was a good idea or not, or if using the push constants under Vulkan was either, but I wasn't sure about the best way to get the window size for use in the shader, and other scaling methods still work fine. Implementation seems to work fine under both Vulkan and OpenGL, but might still need some minor tweaks to the shader. Should definitely do some testing before merging, I have tested on an Nvidia RTX 3080 under Windows. Adapted from these two PRs: https://github.com/Ryujinx/Ryujinx/pull/7304 https://github.com/dolphin-emu/dolphin/pull/11999 Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/57 Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion> Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2024-12-20Add option to only optimize SPIRV during load (#13)echosys
Adds a new option "On Load" to the "Optimize SPIRV output" option that turns on optimizations during the loading of the shader cache from disk, but turns it off after that. The previous checkbox states have been named "Never" for unchecked and "Always" for checked. The idea is that once the shader cache has most of the shaders in a game cached they can be optimized during initial game startup (where a performance hit matters less) and the few shaders that get compiled during runtime are not optimized to reduce performance hits. Most of the commit is adding the setting to the Android app, the main logic is in the `gl_shader_cache.cpp` and `vk_pipeline_cache.cpp` files. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/13 Co-authored-by: echosys <echosys@noreply.localhost> Co-committed-by: echosys <echosys@noreply.localhost>
2024-12-20Implemented LogicOp fixJarrod Norwell
2024-12-20Use fmt 11.0.0Mike Lothian
2024-12-20Optionally optimize generated SPIRV with spirv-opt (#10)darktux
Reviewed-on: http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/darktux/torzu/pulls/10 Co-authored-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion> Co-committed-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
2024-12-20Removed telemetry and anonymized SCM (git) stringsdarktux
2024-12-20Vulkan validation error fix.Lucas Clemente Vella
Different image usage flags between image creation and image view creation.
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-26settings: remove global override for smash on amdvlkLiam
2024-02-26video_core: make gpu context aware of rendering programLiam
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-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-09gpu: dependency-inject scaling/antialiasing filter state for capture layersLiam
2024-02-09nvnflinger/gpu: implement applet captureLiam
2024-02-09nvnflinger/gpu: implement blendingLiam
2024-02-09video_core: defensively program around unmapped device pointersLiam
2024-02-05Buffer Cache: Refactor to use Range sets insteadFernando Sahmkow
2024-02-04VideoCore: Move Slot Vector to CommonFernando Sahmkow
2024-02-02Merge pull request #12885 from Moonlacer/eclipse-fixliamwhite
structured_control_flow: Add Samsung Proprietary Driver ID to Reorder Pass
2024-02-01Clang FixMoonlacer
2024-02-01Add Samsung Proprietary Driver ID to Reorder PassMoonlacer
For RDNA-based Samsung Xclipse GPUs
2024-01-31nvnflinger/gpu: implement layer stack compositionLiam
2024-01-31renderer_vulkan: implement layer stack compositionLiam
2024-01-31renderer_opengl: split up blit screen resources into antialias and window ↵Liam
adapt passes
2024-01-31renderer_vulkan: convert FSR to graphics pipelineLiam
2024-01-31renderer_opengl: split out FXAALiam
2024-01-31renderer_vulkan: split up blit screen resources into separate antialias and ↵Liam
window adapt passes
2024-01-31renderer_vulkan: isolate FXAA from blit screenLiam
2024-01-31video_core: consistently account for resolution scaling when renderingLiam
2024-01-31video_core: simplify accelerated surface fetch and crop handling between APIsLiam
2024-01-29Merge pull request #12439 from FireBurn/vkresultliamwhite
Simplify VkResult lookup
2024-01-25Merge pull request #12499 from Kelebek1/timeliamwhite
Rework time services
2024-01-24Rework time service to fix time passing offline.Kelebek1
2024-01-22Merge pull request #12579 from FernandoS27/smmuliamwhite
Core: Implement Device Mapping & GPU SMMU
2024-01-22Simplify VkResult lookupMike Lothian