-
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
[VFX] Crash with subgraph #5104
Conversation
See this conversation : https://unity.slack.com/archives/C47JPNNTZ/p1624277477261600?thread_ts=1623913383.239100&cid=C47JPNNTZ However, some concerns : - No idea about side effects of this solution - It will lead to a double compilation of sanitized files (if there is a sanitize needed, we will have a new reimport) - OnPostprocessAllAssets can't be filtered efficiently on the VisualEffectAsset
Hoping it will prevent this issue : ``` Unhandled log message: '[Exception] UnityException: DestroyImmediate is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'HDWizard'. See "Script Serialization" page in the Unity Manual for further details.'. Use UnityEngine.TestTools.LogAssert.Expect ``` See https://yamato-artifactviewer.prd.cds.internal.unity3d.com/9f8a60fd-d1f9-48b5-9513-e4e535cf5d7c%2Flogs%2FTestProjects%2FVisualEffectGraph_HDRP%2Ftest-results/TestReportV1.html
This reverts commit 99ab5fb.
Use a static cache of already santized object This solution remains a pretty dirty trick :-/ *Before* - Preprocess : Compile (possibly with side effect modifying the graph) - PostProcess : Sanitize, if there is a modification, it should relaunch the import & recompile *After* - Preprocess : Compile only if the sanitize has been done - PosProcess : Sanitize, if it's the first sanitize, relaunch the reimport Locally, it fixes unexpecting missing import of point cache asset (see 09_AttributeMaps).
This instance singleton can be called from HDWizard constructor making this call illegal. See https://unity.slack.com/archives/GHD5LADU7/p1625040944440100?thread_ts=1624547150.387900&cid=GHD5LADU7 (cc @RSlysz) Testing yamato ⏳
This reverts commit 508d713.
It prevents Wizard Popup to be shown while runnning editor test See : https://unity.slack.com/archives/GHD5LADU7/p1625056568458400?thread_ts=1624547150.387900&cid=GHD5LADU7
This reverts commit ff51dcf.
Prevent exception while launching test
- Use m_GraphSanitized instead of an HashSet - ClearRuntimeData when not sanitized (prevent any unexpected call to OnSetupMaterial)
There was an unexpercted custom implementation of MakeTemporaryGraph Use common code : VFXTestCommon.MakeTemporaryGraph()
- Use a more explanotory message for the changelog - Handle exception safely to avoid the import cancellation - Fix issue : #4971 (comment) - Fix issue : #4971 (comment)
…crash-with-subgraph # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md
GetOrCreateGraph is also assigning the visualEffectResource to the current graph https://github.com/Unity-Technologies/Graphics/blob/d6a59150d20762251cc5fcb8515fee494a142ccc/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs#L231 It's needed to correctly update child dependencies This behavior is counterintuitive
…crash-with-subgraph
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. VFX 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. |
# Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md # com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs
* Fix case 1346650 where OnGUI draws were overwritten (#5107) * Fix case 1346650 where OnGUI draws were overwritten * update changelog * change conditional check * Revert "Color field keeps updating when using eye dropper and Esc key is pressed (#4950)" (#5122) This reverts commit 587dc15. * [VFX] Fix Sanitize behavior (#4971) * Add regression test on basic sanitize See https://unity.slack.com/archives/G1BTWN88Z/p1623825854027500 * Move SanitizeForImport See this conversation : https://unity.slack.com/archives/C47JPNNTZ/p1624277477261600?thread_ts=1623913383.239100&cid=C47JPNNTZ However, some concerns : - No idea about side effects of this solution - It will lead to a double compilation of sanitized files (if there is a sanitize needed, we will have a new reimport) - OnPostprocessAllAssets can't be filtered efficiently on the VisualEffectAsset * *Minor : Missing InvariantCultureIgnoreCase flag in EndsWith * *Update changelog.md * *Fix HDRP warning Hoping it will prevent this issue : ``` Unhandled log message: '[Exception] UnityException: DestroyImmediate is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'HDWizard'. See "Script Serialization" page in the Unity Manual for further details.'. Use UnityEngine.TestTools.LogAssert.Expect ``` See https://yamato-artifactviewer.prd.cds.internal.unity3d.com/9f8a60fd-d1f9-48b5-9513-e4e535cf5d7c%2Flogs%2FTestProjects%2FVisualEffectGraph_HDRP%2Ftest-results/TestReportV1.html * Revert "*Fix HDRP warning" This reverts commit 99ab5fb. * More conservative way of workaround Preprocess issue Use a static cache of already santized object This solution remains a pretty dirty trick :-/ *Before* - Preprocess : Compile (possibly with side effect modifying the graph) - PostProcess : Sanitize, if there is a modification, it should relaunch the import & recompile *After* - Preprocess : Compile only if the sanitize has been done - PosProcess : Sanitize, if it's the first sanitize, relaunch the reimport Locally, it fixes unexpecting missing import of point cache asset (see 09_AttributeMaps). * Remove DestroyImmediate This instance singleton can be called from HDWizard constructor making this call illegal. See https://unity.slack.com/archives/GHD5LADU7/p1625040944440100?thread_ts=1624547150.387900&cid=GHD5LADU7 (cc @RSlysz) Testing yamato ⏳ * Revert "Remove DestroyImmediate " This reverts commit 508d713. * Add HDRPUserSettings It prevents Wizard Popup to be shown while runnning editor test See : https://unity.slack.com/archives/GHD5LADU7/p1625056568458400?thread_ts=1624547150.387900&cid=GHD5LADU7 * Revert "Add HDRPUserSettings" This reverts commit ff51dcf. * Force m_WizardPopupAtStart to false Prevent exception while launching test * Improvement of this workaround after discussion with @julienf - Use m_GraphSanitized instead of an HashSet - ClearRuntimeData when not sanitized (prevent any unexpected call to OnSetupMaterial) * Minor : Editor Test cleanup There was an unexpercted custom implementation of MakeTemporaryGraph Use common code : VFXTestCommon.MakeTemporaryGraph() * Gather all ImportAsset after all Sanitize from the same batch Fix this issue : #4971 (comment) See : See : https://unity.slack.com/archives/C47JPNNTZ/p1625218128286700?thread_ts=1623913383.239100&cid=C47JPNNTZ * Minor changes : Change log & Safe execption handling - Use a more explanotory message for the changelog - Handle exception safely to avoid the import cancellation - Fix issue : #4971 (comment) - Fix issue : #4971 (comment) * Fix sanitize issue during the very first loading GetOrCreateGraph is also assigning the visualEffectResource to the current graph https://github.com/Unity-Technologies/Graphics/blob/d6a59150d20762251cc5fcb8515fee494a142ccc/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs#L231 It's needed to correctly update child dependencies This behavior is counterintuitive * *Minor* Replace `return` by `continue` I noticed this issue working on this PR : #5104 Co-authored-by: Kenny Tan <82013253+kennytann@users.noreply.github.com> Co-authored-by: Paul Demeulenaere <pauld@unity3d.com>
It has side effect which are caught by any editor test
This reverts commit 2421bc5.
And verify expected output slot in VFXControllerTest
@Unity-Technologies/gfx-qa-vfx This PR has to be tested extensively (not just the actual crash fix steps) like the previous one, because it modifies the importer and has therefore potential implications in any vfx import |
Hi @PaulDemeulenaere , thanks for the fix! |
graph.CollectDependencies(dependencies); | ||
var backup = VFXMemorySerializer.StoreObjectsToByteArray(dependencies.ToArray(), CompressionLevel.None); | ||
|
||
graph.CompileForImport(); |
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.
But still this means that CompileForImport can still trigger a SetDirty during compilation, which can potentially trigger, another useless import, or worse an infinite compile?
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.
The dirty flag (which isn't serialized) about compilation is cleared at the end of compilation. See in CompileForImport
:
m_ExpressionGraphDirty = false;
m_ExpressionValuesDirty = false;
The issue is due to preprocess we are doing before the actual compilation.
The backup doesn't restore these dirty flags.
Then, the SetDirty which can occurs (maybe ?) isn't detected/triggered, otherwise, I would have a infinite compilation in the editor test I introduced.
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.
No issues found pertaining to the PR (test doc)
Thanks for the fix!
….OnValidate (#5112) * [HDRP] Fix AxF debug output in certain configurations (#4641) * Fix AxF debug output in certain configurations. * Update comment * Fix SSR accumulation white flash (#4648) * Fix white flash * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Display Info Box when MSAA + ray tracing is onr (#4627) * Show info box when ray tracing is enabled. * Changelog * Move below MSAA Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix distortion when resizing the window in player builds with the Graphics Compositor enabled (#4593) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Add support for the camera bridge in the graphics compositor (#4599) * Fix Jittered Project Matrix Infinite Far Clip Plane (#4638) * Reconstruct jittered projection matrix far plane (for Infinite ) * Changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed a memory leak related to not disposing of the RTAS at the end HDRP's lifecycle. (#4688) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix custom pass utils Blur + Copy overdraw. (#4623) * Fix overdraw in custom pass utils blur function * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix draw procedural invalid pass idx 1 on first template load (#4632) * Fix * changelog * Force sync compilation for TAA Co-authored-by: CifaCia <f.cifariellociardi@gmail.com> Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Changed light reset to preserve type (#4624) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert "Add support for the camera bridge in the graphics compositor (#4599)" This reverts commit 2325e3f. * AxF carpaint: Fix a compilation issue on Vulkan until the cpp HLSLcc side is updated. (case 1335737, related to 1314040) (#4691) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert "Revert "Add support for the camera bridge in the graphics compositor (#4599)"" This reverts commit 30fffd5. * revert: Fix distortion when resizing the window in player builds with the Graphi * Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904). (#4626) * Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904). * Add test scene Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com> Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com> * Fix for discrepancies in saturation and intensity between screen space refraction and probe refraction (#4653) * Delete the second transmittance mul * Changelog Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com> * Fix a Divide-by-Zero Warning for some Anisotropic Models (Fabric, Lit) (#4636) * Initialize the shading normal to a non-zero value for anisotropy * Changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix VfX lit particle AOV output color space (#4646) * Fix VfX lit particle aov output color space * Update comment Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP][Path Tracing] Fixed transparent unlit (#4605) * Fixed issue with transparent unlit. * Updated changelog. * Reverted accidental change to default mtl. Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix distortion with MSAA (#4711) * Fix contact shadow debug views (#4720) * Fix * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Update Decal-Projector.md (#4695) * [HDRP] Fixed nullref when deleting the texture asset assigned in a local volumetric fog volume (#4728) * Fixed nullref when deleting the 3D mask of a density volume (case 1339330) * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix decal layer enum (#4753) * Fix typo * Fixed reflection probes being injected into the ray tracing light cluster even if not baked (case 1329083). (#4640) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Ignore hybrid duplicated reflection probes during light baking (#4663) * Ignore hybrid duplicated reflection probes during light baking * test path instead of scene Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix double sided option moving when toggling it in the material UI (#4725) * Fix double sided option moving when toggling it in the material UI (case 1328877) * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix formatting * Fix volumetric fog in planar reflections (#4736) * Fix planar reflection * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix motion blur compute dispatch size (#4737) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * - Updated the recursive rendering documentation (case 1338639). (#4759) * - Updated the recursive rendering documentation (case 1338639). * review fixes Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix issue with OnDemand directional shadow map being corrupted when reflection probe are updated same frame (#4812) * Don't mark as rendered for reflection probes as we want the cached version to be from main view * Do the thing just for directional * Doc update * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix cropping issue with the compositor camera bridge (#4802) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix for unused resources in depth of field (#4796) * Removing the word Radii from exposure settings (#4854) * Rename in UX * Update docs * [HDRP][Path Tracing] Support for shadow mattes (#4745) * Shadow matte support. * Updated changelog. * Only take occluders into account, closer match to raster mode. * Added test scene. Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert "[HDRP][Path Tracing] Support for shadow mattes (#4745)" This reverts commit 85ebbc2. * Fixed the transparent cutoff not working properly in semi-transparent and color shadows (case 1340234). (#4756) * Fixed the transparent cutoff not working properly in semi-transparent and color shadows (case 1340234). * Update test ref image Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com> Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Use non jittered projection in outline pass (#4836) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP][Path Tracing] Sky settings now properly taken into account when using recorder (#4856) * Make sure sky settings are correctly set when recording. * Updated changelog. Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix Resolution Issues for Physically Based Depth of Field (#4848) * Add the necesarry texture coordinate clamping for RTHandle for color pyramid sampling * Add some resolution independence, fitted for 1920x1080 * Changelog * Switch back to point sampling from trilinear, with commentary * Update test reference images * Small correction to the point sampling, always sample mip 0. * Re-update the test images, for mip 0 color sampling * Use a simpler UV scaling/clamping since we are now point sampling. Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed bug introduced by sky-for-recorder support. (#4906) * [Fogbugz 1341576] Memory leaks when the player is paused, and the user changes pipeline… (#4845) * Memory leaks when the player is paused, and the user changes pipeline settings * changelog * [HDRP] Fixed shadergraph double save (#4916) * Don't need to save twice shadergraph the first time we create a graph * Updated changelog * Write 0 instead of micro sized motion vectors + fix extremely fast velocities (#4820) * Kill micromovements. * Do same for camera * Debug view update * Changelog * Remove unnecessary comment * Fix excessive velocity end up marked as no velocity Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix material upgrader (#4821) * Fix HDRP material upgrade failing when there is a texture inside the builtin resources assigned in the material * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix custom pass volume not executed in scene view (#4860) * Fix custom pass volume not executed in scene view because of the volume culling mask * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix reflection probe tootltip (#4890) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Updated the Physically Based Sky documentation for baked lights (#4891) * Updated the Physically Based Sky documentation for baked lights * Rewrite Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed remapping of depth pyramid debug (#4893) * Fixed remapping of depth pyramid debug * Removed debug pragma * Update changelog * Updated tooltip * Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled. (#4895) * Fix AO perceived wobble * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix Asymmetric Projection Matrices and Fog / Pathtracing (#4926) * Check for asymmetric projections and choose the generic path if so. * Fix asymmetric projections for the pathtracer ray generation. * Changelog * Simplify the matrix multiplication for computing the generic matrix. Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert: Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection… * Fix GBuffer depth debug mode (#5054) * Fixed Volume Gizmo size when rescaling parent GameObject (#4915) * Fix Vertex Color Mode documentation (#4976) * Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled. (#4986) * Fix AO perceived wobble * changelog * Update screenshots Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix formatting in NestedOverrideCameraRendering * [HDRP] Fix white flash with SSR when resetting camera history (#5089) * Fix white flash with SSR when resetting camera history * Move branch login inside GetPreviousExposureTexture * Fix for fixed exposure * [Fobguz # 1348357] VFX Particle templates missing stencil flags (#5080) * Adding missing macro for stencil flags in particle forward shaders. This will let flags like TAA Reject be useful * Changelog * Moved the range validation logic into HDAdditionalLightData.OnValidate (Case 1345264) * Update CHANGELOG.md * Merge master (#5127) * Fix case 1346650 where OnGUI draws were overwritten (#5107) * Fix case 1346650 where OnGUI draws were overwritten * update changelog * change conditional check * Revert "Color field keeps updating when using eye dropper and Esc key is pressed (#4950)" (#5122) This reverts commit 587dc15. * [VFX] Fix Sanitize behavior (#4971) * Add regression test on basic sanitize See https://unity.slack.com/archives/G1BTWN88Z/p1623825854027500 * Move SanitizeForImport See this conversation : https://unity.slack.com/archives/C47JPNNTZ/p1624277477261600?thread_ts=1623913383.239100&cid=C47JPNNTZ However, some concerns : - No idea about side effects of this solution - It will lead to a double compilation of sanitized files (if there is a sanitize needed, we will have a new reimport) - OnPostprocessAllAssets can't be filtered efficiently on the VisualEffectAsset * *Minor : Missing InvariantCultureIgnoreCase flag in EndsWith * *Update changelog.md * *Fix HDRP warning Hoping it will prevent this issue : ``` Unhandled log message: '[Exception] UnityException: DestroyImmediate is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'HDWizard'. See "Script Serialization" page in the Unity Manual for further details.'. Use UnityEngine.TestTools.LogAssert.Expect ``` See https://yamato-artifactviewer.prd.cds.internal.unity3d.com/9f8a60fd-d1f9-48b5-9513-e4e535cf5d7c%2Flogs%2FTestProjects%2FVisualEffectGraph_HDRP%2Ftest-results/TestReportV1.html * Revert "*Fix HDRP warning" This reverts commit 99ab5fb. * More conservative way of workaround Preprocess issue Use a static cache of already santized object This solution remains a pretty dirty trick :-/ *Before* - Preprocess : Compile (possibly with side effect modifying the graph) - PostProcess : Sanitize, if there is a modification, it should relaunch the import & recompile *After* - Preprocess : Compile only if the sanitize has been done - PosProcess : Sanitize, if it's the first sanitize, relaunch the reimport Locally, it fixes unexpecting missing import of point cache asset (see 09_AttributeMaps). * Remove DestroyImmediate This instance singleton can be called from HDWizard constructor making this call illegal. See https://unity.slack.com/archives/GHD5LADU7/p1625040944440100?thread_ts=1624547150.387900&cid=GHD5LADU7 (cc @RSlysz) Testing yamato ⏳ * Revert "Remove DestroyImmediate " This reverts commit 508d713. * Add HDRPUserSettings It prevents Wizard Popup to be shown while runnning editor test See : https://unity.slack.com/archives/GHD5LADU7/p1625056568458400?thread_ts=1624547150.387900&cid=GHD5LADU7 * Revert "Add HDRPUserSettings" This reverts commit ff51dcf. * Force m_WizardPopupAtStart to false Prevent exception while launching test * Improvement of this workaround after discussion with @julienf - Use m_GraphSanitized instead of an HashSet - ClearRuntimeData when not sanitized (prevent any unexpected call to OnSetupMaterial) * Minor : Editor Test cleanup There was an unexpercted custom implementation of MakeTemporaryGraph Use common code : VFXTestCommon.MakeTemporaryGraph() * Gather all ImportAsset after all Sanitize from the same batch Fix this issue : #4971 (comment) See : See : https://unity.slack.com/archives/C47JPNNTZ/p1625218128286700?thread_ts=1623913383.239100&cid=C47JPNNTZ * Minor changes : Change log & Safe execption handling - Use a more explanotory message for the changelog - Handle exception safely to avoid the import cancellation - Fix issue : #4971 (comment) - Fix issue : #4971 (comment) * Fix sanitize issue during the very first loading GetOrCreateGraph is also assigning the visualEffectResource to the current graph https://github.com/Unity-Technologies/Graphics/blob/d6a59150d20762251cc5fcb8515fee494a142ccc/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs#L231 It's needed to correctly update child dependencies This behavior is counterintuitive * *Minor* Replace `return` by `continue` I noticed this issue working on this PR : #5104 Co-authored-by: Kenny Tan <82013253+kennytann@users.noreply.github.com> Co-authored-by: Paul Demeulenaere <pauld@unity3d.com> Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: sebastienlagarde <sebastien@unity3d.com> Co-authored-by: John Parsaie <johnpa@unity3d.com> Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: Antoine Lelievre <antoinel@unity3d.com> Co-authored-by: CifaCia <f.cifariellociardi@gmail.com> Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com> Co-authored-by: slunity <37302815+slunity@users.noreply.github.com> Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com> Co-authored-by: Emmanuel Turquin <emmanuel@turquin.org> Co-authored-by: Adrian1066 <44636759+Adrian1066@users.noreply.github.com> Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com> Co-authored-by: Julien Ignace <julien@unity3d.com> Co-authored-by: Kenny Tan <82013253+kennytann@users.noreply.github.com> Co-authored-by: Paul Demeulenaere <pauld@unity3d.com>
There are probably two new fogbugz related to the same issue :
|
Purpose of this PR
Fix regression https://fogbugz.unity3d.com/f/cases/1345426/
What happens :
Solutions :
Force always double import: It's really heavy, and since the importAsset from PostProcessAsset it forces us to use adelayCall
which have some side effect...Testing status
Adding two editor test
ConvertToSubgraphOperator which does what has been reported as step to reproduce : New VFX, add a couple of add operators, plug them in set lifetime, select both add operators and convert them to a subgraph and 💥
ConvertToSubGraphOperator_And_ModifySubgraph : This test follows up the previous one, trying to add an output in subgraph and changing the state of the subgraph like a VCS could do.
https://user-images.githubusercontent.com/22494706/125446308-aa4579dd-a0f6-4caa-acd9-fc676b64fb2f.mp4
N.B.: The newly introduced editor test is the reason for the addition of "path" in this ConvertToSubgraphOperator
Performances
Compared with master at 42cfbe4 (it includes the sanitize)
Testing on small graph :
000_MultiOutput
Before
After
Testing on big graph
014_PositionBlock
Before
After
This is actually the
VFXGraph.Reimport
which is impacted in this test : +20% for the small +7% for the big.About the compression
Using compression.None, the Fastest mode isn't revelant for an immediate backup/restore :
Comments to reviewers
I'm not fully satisfied of this solution but this workaround is the best answer we have before a more global refactor of subgraph and import processes.
The reason of this change : 29c18b7
Before
After
When there isn't any compilation :
We could potentially use a direct call during SanitizeForImport like I tried here : 2421bc5 but in that case, we are assuming the creation of a subgraph from a VFXGraph will always trigger the reimport of the source graph.