Repository navigation
Front end: reactive-mask generation reaches AMD's context when one exists - #83
Merged
Merged
Conversation
…ists A dispatch of type GENERATEREACTIVEMASK on a WrongGPU context returned OK and recorded nothing. Some frames of such a context still go to AMD's upscaler with the game's reactive resource (frames WrongGPU cannot take, the player's comparison), and those frames read a mask that was not written this frame. With an AMD context at hand (the comparison context while comparing, else the context made for an earlier frame) the call is now sent to it. Without one it stays OK with nothing recorded; the first frame of a run needs no change. Fixes #59 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #59
What was wrong
While a context belongs to WrongGPU, a dispatch of type
FFX_API_DISPATCH_DESC_TYPE_UPSCALE_GENERATEREACTIVEMASKreturned OK and recorded nothing (clean/fsr/src/frontend.cpp,FrontEnd::Dispatch). The public description namesoutReactiveas the surface the mask is generated into. Some frames of a WrongGPU context are still sent to AMD's upscaler with the game's original description, which includes that reactive resource: the "bad frame" path (frames flagged sRGB or PQ, and frames the mapping refuses when the stand-in cannot take them) and the comparison with AMD. Those frames read a mask that was not written this frame (the last mask AMD wrote, zeros, or leftover data). The effect is extra ghosting on translucent and particle areas for a short time, and a biased comparison. It does not crash.The fix
In the generate-mask branch of
FrontEnd::Dispatch(Own mode), the call is now sent to an AMD context when one exists:u->amd, the AMD context made for an earlier bad frame or for the comparison.The descriptor is passed on unchanged and AMD's return code is the call's result (logged when it is not OK or when the call would be logged anyway). Without an AMD context there is nothing to send it to: it still returns OK with nothing recorded, as before. The first frame of a run needs no change (it is sent to AMD with
reset = true). No AMD context is created for this call. A forwarded call from a host that routes back into WrongGPU is stopped by the existing re-entry guard.The test
TestReactiveMaskForwardedinclean/fsr/tests/test_frontend.cpp(ctestfsr_frontend_unit, in the CI set), with the fake AMD DLL that records every call and its descriptor type:Before / after (MSVC, Release,
cmake -S clean/fsr -B <out> -G Ninja -DWG_MODEL_K=OFF -DWG_BUILD_ID=ci -DWG_BUILD_ASI=ON,cmake --build <out> --target test_frontend,<out>\test_frontend.exe):1141 checks, 4 failures(all four are the "AMD recorded a mask dispatch" checks; the count today is 0).1140 checks, 0 failures(the total varies by a check or two between runs: a polling loop in an earlier test checks once per iteration).Tested
test_frontendbefore and after, as above.ctest -R "unit|hosted|diagnostic|support" -E "overlay|split|d3d12") plusfsr_custom_slot(WARP): 16 tests, all passed (fsr_asi_scan_unitskipped, as usual).Not tested