Commit 3af6e09
[VFX] Fix editor crash when deleting textures that are used for rendering in VFX
In some scenarios, it was possible to crash the editor if textures, models or graphics buffers were deleted when an active VFX was using them.
Not all the ways to destroy these objects will cause a crash, it depends on the path taken. For instance, deleting texture using "Del" key would work fine, but deleting it using right click + "Delete" would crash.
This was due to a cached pointer, used for optimization, that was not invalidated. In VFX there are 3 different command lists, 1 running during update (safe, because it is when the pointers are cached). And 2 running during the rendering. If some object is deleted between VFX manager update and rendering, it would cause the crash.
The solution was to keep track of which effects need to reload the objects cache and do that during the first rendering command list (PerCamera).
On top of that, we removed some unused values from output update that made the crash more likely to happen with 6 way lighting.1 parent aeb0eaf commit 3af6e09
File tree
1 file changed
+2
-4
lines changed- Packages/com.unity.visualeffectgraph/Editor/Models/Contexts
1 file changed
+2
-4
lines changedLines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 129 | + | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| |||
0 commit comments