-
Notifications
You must be signed in to change notification settings - Fork 792
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
[HDRP] Fix Invalid Texture Handle Issue in Shadow Atlas #6390
Conversation
This change fixes an issue where the shadow atlas could end up with an invalid texture handle after the render pipeline asset is modified and reloaded. The previous code was invalidating the output texture handle in some particular cases, but a new handle was recently added to the atlas code without updating the invalidation logic. This change simply adds the new handle to the existing invalidation logic. The new handle was added as part of #6030 and merged into master as: c83cb31 This fix may need to be backported to other branches.
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. |
@FrancescoC-unity Could you review this please? The new handle was added during one of your recent changes so you might be able to tell if this fix is appropriate or not? |
Is this supposed to fix the issue that happens randomly after a while in the editor? |
Took a look at the bug related to that PR and yes this seems to be the same or a similar issue. In my case though, I've been able to reproduce the problem by scrubbing the "Max Local Fog on Screen" slider quickly while Spaceship is running rather than leaving the editor open for a long time: I tested out the branch (hd/fix-rg-error) and my issue no longer reproduces with that so it looks like my fix isn't necessary/correct. :) I can discard this PR and wait for #6329 to be merged instead as long as we understand why m_ShadowMapOutput doesn't need to be invalidated like m_Output in the shadow atlas code? |
Given the current logic m_ShadowMapOutput should always be updated every frame before being used so it should never become invalid and therefore should not need to be reset. |
Oh ok, that makes perfect sense! Thanks for the explanation. :) I'll close this PR. |
Purpose of this PR
This change fixes an issue where the shadow atlas could end up with an
invalid texture handle after the render pipeline asset is modified and
reloaded.
The previous code was invalidating the output texture handle in some
particular cases, but a new handle was recently added to the atlas
code without updating the invalidation logic. This change simply adds
the new handle to the existing invalidation logic.
The new handle was added as part of #6030 and merged into master as:
c83cb31
This fix may need to be backported to other branches.
Testing status
Tested locally on Spaceship by dragging the "Max Local Fog on Screen" slider on the pipeline asset around. Before this change, errors would be written to the console. After the change, there's no errors.
Comments to reviewers
Some feedback on the correctness of this change would be appreciated since I'm not 100% sure that fixing this issue is as simple as adding the new handle to the invalidation logic. I ran into this issue when working on another change so fixing this is technically a prerequisite for me.
Items to address