Skip to content
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

Fixed references to probes not cleared when unloading a scene #5945

Merged
merged 7 commits into from Nov 22, 2021

Conversation

adrien-de-tocqueville
Copy link
Contributor

@adrien-de-tocqueville adrien-de-tocqueville commented Oct 6, 2021

Purpose of this PR

https://fogbugz.unity3d.com/f/cases/1357459/

HDRP stores probes in a global array, but when a probe is removed, the reference is not removed from the array.
Also the probe was added to a lightmapper callback at OnEnable but not removed during OnDisable


Testing status

tested the repro steps, the probes don't appear anymore in the memory profiler

For QA: HDRP also has a global array for planar probes and lights. So I cleared references for planar probes, I suppose they have the same issue but didn't try to test. I didn't manage to repro anything similar for lights though, so didn't change anything for them

@github-actions
Copy link

github-actions bot commented Oct 6, 2021

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.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/jobDefinition/.yamato%2Fall-hdrp.yml%23HDRP_trunk
With changes to HDRP packages, you should also run
/jobDefinition/.yamato%252Fall-lightmapper.yml%2523PR_LightMapper_trunk

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.

@github-actions github-actions bot added the HDRP label Oct 6, 2021
@github-actions
Copy link

github-actions bot commented Oct 6, 2021

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

@sebastienlagarde
Copy link
Collaborator

all good, waiting for QA

@sebastienlagarde sebastienlagarde requested review from a team and removed request for a team November 4, 2021 18:51
Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick check to validate lights, reflection probes and planar probes, no repro indeed with lights and cube reflection probes anymore, but planar probes fill up Scene Memory -> Render Texture section when switching scenes.

2021-11-08.17-22-07.mp4

Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Not encountering any leaks anymore shuffling through the test project with additional lights and planar probes

sebastienlagarde added a commit that referenced this pull request Dec 8, 2021
* Fixed references to probes not cleared when unloading a scene #5945

* [Fogbugz # 1365368] Fixing debug views for drs #5948

* [HDRP] Stacklit RTR: Fix issues with RTR reflections from stacklit materials #6103

* [HDRP] Lit coat ssr-rtr: Fix various issues with using SSR lighting with IBL fallback (case 1380351) #6106

* [HDRP] StackLit coat ssr-rtr light hierarchy and IBL fallback fixes. #6107

* AxF ssr-rtr: Implement refined light reflection hierarchy with separate weight for coat and base lobe to correctly fallback from SSR light to light reflection probes and also implement the same coat-traced light "reuse" as Lit for bottom lobe when roughnesses are similar. (#6108)

This also cleans up the overlapping contributing reflection probes / dual normal setup problem in EvaluateBSDF_Env().
Based on previously discussed #4968.

* Fix issue with reflection probe normalization via APV (#6140)

* fix issue

* -

* [not ready] HDRP Scene Template: Bumped up IET framework version to 2.1 and better default layout for 1080p monitors (#6153)

* bumped up iet framework to 2.1, created new 1080p and 4k friendly layout

* Merge branch 'master' into hdrp-template-bumpup-iet-framework-version

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix custom pass utils in XR #6271

* Update reference screenshots

Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com>
Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com>
Co-authored-by: slunity <37302815+slunity@users.noreply.github.com>
Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com>
Co-authored-by: pierre-unity <39901544+pierre-unity@users.noreply.github.com>
Co-authored-by: Antoine Lelievre <antoinel@unity3d.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants