Search Issue Tracker
Fixed in 13.1.2
Votes
0
Found in [Package]
12.0.0
Issue ID
1371353
Regression
Yes
[HDRP] Debugger windows throws exception on every undo after domain reload if window was open but not in front during reload
The HDRP debugger window starts throwing exceptions on every undo after any domain reload that happens while the debugger window is open but not in front. Not uncommonly this leads to inconsistent state in the project, either breaking HDRP rendering itself, or some other random tool relying on Undo. It would be great if we could get this fixed. (details in thread)
I had a quick look in the code (2021.2/staging from ~5 days ago) and it looks like there's a couple of inconsistencies between the logic in editor window, assumptions about serialization and HDRP init for this case of enabled but hidden debugger window.
The first thing that happens after a domain reload is that DebugWindow's m_WidgetStates is restored from its flattened serialized form. At this point, any state of type DebugStateFlags has lost its boxed enum value because it's not a type Unity knows how to serializable. This widget state null value, in turn, is what breaks the state hash computation in OnUndoRedoPerformed throwing a NullReferenceException when trying to get its hash code.
A bit later, DebugWindow.OnEnable runs. Among other things it reads DebugManager.instance.panels in several locations to see if various state needs refreshing, however this collection is always empty because the SRP has not yet been instantiated. (This probably makes sense for the case of opening the window when you already have HDRP running, but for the domain reload case it seems to skip a lot of stuff)
Later on, when panels _are_ added in HDRP DebugWindow.MarkDirty is called and refreshEditorRequested is set. However, these dirty bits are only acted upon in DebugWindow.Update - which only runs for windows that are in front. Since we did register the OnUndoRedoPerformed callback in DebugWindow.OnEnable, though, it will happily do its thing anyway, running on incomplete state and failing on this now missing enum value.
(It's hard to know exactly which breakages this is responsible for and not.. I have a feeling there's a second undo related bug that's responsible for a fairly frequently occurring bug that breaks volumetric lighting in scene view, but getting this one fixed would allow for digging deeper)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Prefab override popup is cropped/positioned incorrectly when more than one display is used and a higher display Scale is set
- Opening a dropdown on a small screen results in its instant closing when mouse cursor is pressed where the dropdown is going to be opened
- Only "ArgumentNullException: Value cannot be null" is displayed instead of all the actual errors when opening a project with numerous compilation errors
- MultiColumnListView and MultiColumnTreeView do not change selection on first input when focus is set by code
- SerializedProperty.DataEquals is returning false when SerializedProperty.EqualContents return true
Resolution Note (fix version 13.1.2):
Fixed in: High Definition RP 13.1.2 (2022.1.0a1)