-
Notifications
You must be signed in to change notification settings - Fork 855
[HDRP] Merge FSR RCAS Logic into FinalPass #6207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
This change merges the FSR RCAS logic into the FinalPost shader to avoid an unnecessary round trip through memory.
022ad0f
to
bae6038
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, please add a changelog
@kecho btw we haven't re-enable the dynamic res graphic test right? so we don't have test allowing to check the change? |
@sebastienlagarde we have only disabled the DRS vulkan tests from what I see We were waiting on trunk to fix this. I think the fix landed. Otherwise, dx12, dx11 and metal should be tested properly. |
#ifdef CATMULL_ROM_4 | ||
CTYPE outColor = UpscaledResult(positionNDC.xy); | ||
#elif defined(RCAS) | ||
CTYPE outColor = ApplyRCAS(scaledPositionSS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ApplyRCAS returns a float3, yet you have a CTYPE. This means that you could potentially be setting alpha 0 and causing a shader compiler warning (float3 casted into float4).
Notice how the other passes use the CTYPE_SWIZZE to address this. Can you dig in a bit into support for alpha? I think this might break this pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a new commit that adds some comments explaining how this is handled:
Graphics/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader
Lines 41 to 48 in d2d3143
#define FSR_INPUT_TEXTURE _InputTexture | |
#define FSR_INPUT_SAMPLER s_linear_clamp_sampler | |
#if ENABLE_ALPHA | |
// When alpha is in use, activate the alpha-passthrough mode in the RCAS implementation. | |
// When this mode is active, ApplyRCAS returns a four component vector (rgba) instead of a three component vector (rgb). | |
#define FSR_ENABLE_ALPHA 1 | |
#endif | |
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/FSRCommon.hlsl" |
Any idea if this functionality is tested in the DRS tests?
Purpose of this PR
This change merges the FSR RCAS logic into the FinalPost shader to avoid
an unnecessary round trip through memory.
This saves about 200us of frame time (compared to the prior implementation) at 4k on PS5 (Spaceship Demo) with scaling forced to 77%.
Testing status
Manual testing locally on PC DX12 & DX11, HDRP DRS tests on DX12 & DX11, PS5 Spaceship Demo with scaling