GS/HW: Tweak AF shader#14465
Conversation
You replied with a rather cryptic |
Because there is nothing concrete right now that I can tell you other than yes it is being worked on. |
And how am I supposed to know that this wasn't the PR you were talking about? |
Because if it was what's being worked on it would be very obvious it was about reducing shader stutter :P |
Well the PR doesn't say anything about shader stutters, but it is only logical to test it anyway, because this shader is what regressed the performance in the first place. |
fa1a3df to
4b42bb8
Compare
0eb834b to
3347360
Compare
ab6a0b2 to
7ff8b00
Compare
lightningterror
left a comment
There was a problem hiding this comment.
Needs rebase due to shader cache conflict.
|
Rebased |
lightningterror
left a comment
There was a problem hiding this comment.
Smoke tested and aniso still works. Jordan reported around 7-12% fps increase.
…oggles, AF + 8x upscale - GS: port PCSX2 PCSX2#14555 ROV revisions + PCSX2#14465 anisotropic-filter shader optimization (early isotropic fallback, cheaper math); bump ShaderCacheVersion - Renderer: add Vulkan framebuffer-fetch (ROAA) accurate-blending fast path on Adreno via EnableAdrenoFramebufferFetch (default off, experimental) - the mobile-native equivalent of ROV, restart to apply, no effect on Mali/OpenGL - Renderer: add ROV, Accurate Alpha Test, and HW AA1 toggles; raise internal upscale range to 8x - GameDB: surface an on-screen notice when a game recommends Accurate Alpha Test or AA1 - TextureCache: port upstream Move correctness fix for destination-target match - Controllers: fall back to the device's own vibration motor when the gamepad exposes no usable rumble actuator (#241; e.g. Odin 3) - Skins: read newer per-side analog filenames (analog_stick_left/right); older single analog_stick + analog_base packs still import - Settings: rename "Game Fixes" to "GameDB Fixes" for clarity
Add the PCSX2 PR PCSX2#14465 sample_c_af anisotropic-filter function to the Vulkan tfx.glsl and wire it into sample_c, gated on PS_ANISOTROPIC_FILTERING > 1. This fixes a silent no-op on the Vulkan backend: GSRendererHW already sets PS_ANISOTROPIC_FILTERING from GSConfig.MaxAnisotropy for triangles and hardware sampler anisotropy is disabled, so the shader path is the active AF implementation — but the iOS Vulkan shader had no handler for the macro, so anisotropic filtering did nothing. With sample_c_af in place the setting takes effect, using the optimized early-isotropic- fallback / cheaper-math form from PR PCSX2#14465. Bumps SHADER_CACHE_VERSION 103 -> 104 so the Vulkan disk cache invalidates and the new shader compiles. Metal is unaffected (it loads a build-time metallib with no disk shader cache); the Metal AF path remains a future item since upstream never produced a validated MSL transcription of this shader.
Port a batch of graphics, DEV9, and GameDB correctness and stability fixes from the shared core. Texture replacement packs no longer crash when a pack declares an off-by-one mip count (the DDS loader now clamps the level count to the actual texture size). Vulkan pipeline-cache writes are atomic (temp file plus rename), so a mid-write crash cannot leave a half-written cache that some drivers then render garbage from. The OpenGL program selector now compares shader keys instead of a padding-inclusive memcmp, so identical selectors no longer recompile every frame. TextureCache::Move refreshes the destination target's buffer width when the incoming data exceeds it, fixing texture corruption in titles that do move-based framebuffer expansion. Add the software anisotropic filter to the Vulkan shader (PCSX2 PR PCSX2#14465). The Max Anisotropy setting previously had no effect on Vulkan because the shader had no handler for it; anisotropic filtering now actually applies. The shader cache version is bumped (103 -> 104), so the Vulkan disk cache is rebuilt on first launch after updating. Add a DEV9 DNS fallback for iOS. The app sandbox has no /etc/resolv.conf, so hostname lookup returned an empty list and every DEV9 hostname failed; it now falls back to public resolvers and is still overrideable via Network settings, so online and HDD games that resolve hostnames can connect. Cap the on-screen overlay scale at 2x so high-resolution screens do not balloon the OSD, and show (ROV) / (Debug & ROV) in the GPU status line when rasterizer-ordered rendering is active. Re-initialize the focused window's navigation rect on resize so ImGui controller and keyboard navigation keep working after a surface resize or orientation change. Sync GameIndex.yaml with the upstream refresh-experimental database and add targeted title fixes: Jackie Chan Adventures EE/VU clamp modes (stops Jackie falling through the floor after door transitions), Ace Combat 5 / Zero partial texture preloading (avoids FMV hash-cache stalls), Gran Turismo lens-flare / autoFlush / VU-clamp tuning, and Burnout 3 memory-card cross-save filters. Add recommended AAT and AA1 GameDB hint fields. This is an upstream sync plus targeted title fixes, not a large set of newly supported games. Expose the global graphics and CPU round/clamp mode pickers in settings to match the per-game options.
Description of Changes
Applies various optimisations to shader based anisotropic filtering, such as;
Early fall back to isotropic filtering if the sample covers less than a pixel.
Use more intrinsics.
Simplify some calculations by using equations from the GL spec.
Rationale behind Changes
The shader based approach is noticeably slower then HW (depending on the GPU this difference can be significant).
Suggested Testing Steps
Test performance.
Did you use AI to help find, test, or implement this issue or feature?
Google Gemini regarding refreshing my memory on vector operations.
Copilot for optimising the calculations of
new_dx,new_dyby splitting it apart.Copilot also caught a few mistakes.