Skip to content

Conversation

julienf-unity
Copy link
Contributor

@julienf-unity julienf-unity commented Aug 17, 2021

Purpose of this PR

Various fixes:


Testing status

Tested locally


Comments to reviewers

This PR is meant to be backported to 20.3 and 21.1 and then to partner branch
PR to 20.3 was created now because it's high priority. PR to 21.1 will be made as a cherry pick once merged (hence the label)

@github-actions github-actions bot added the vfx label Aug 17, 2021
@github-actions
Copy link

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://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

VFX
/.yamato%252Fall-vfx.yml%2523PR_VFX_2021.2

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
Copy link

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!

- Zoom and warning icons were blurry in the "Play Controls" and "Visual Effect Model" scene overlays
- Random crash using subgraph [Case 1345426](https://issuetracker.unity3d.com/product/unity/issues/guid/1345426/)
- Fix potential infinite compilation when using subgraphs [Case 1346576](https://issuetracker.unity3d.com/product/unity/issues/guid/1346576/)
- Prevent out of sync serialization of VFX assets that could cause the asset to be dirtied without reason [Case 1327805](https://issuetracker.unity3d.com/product/unity/issues/guid/1327805/)
Copy link
Contributor

Choose a reason for hiding this comment

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

This URL does not work as bug 1327805 is private (since it has the customer's info and discussions on it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! Thanks, I removed the link from the changelog

Copy link
Contributor

@PaulDemeulenaere PaulDemeulenaere 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 these fix, I've only minor remarks and questions, LGTM !

{
VFXGraph.compileReporter = reporter;
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graphView.controller.model));
graph.SetExpressionGraphDirty(false); // As are implemented subgraph now, compiling dependents chain can reset dirty flag on used subgraphs, which will make an infinite loop, this is bad!
Copy link
Contributor

Choose a reason for hiding this comment

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

I realized we assumed the previous AssetDatabase.ImportAsset was synchronous here. I don't think it's possible to have an asynchronous import of the vfx anyway.

{
if (EditorUtility.IsDirty(graph) || UnityEngine.Object.ReferenceEquals(graph, controller.graph))
{
graph.UpdateSubAssets();
Copy link
Contributor

Choose a reason for hiding this comment

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

The missing UpdateSubAssets reminds me an old debug, see this conversation
At that time, I experimented a C++ workaround
For sure, even this bug : https://fogbugz.unity3d.com/f/cases/1322919/ isn't reproducible anymore, this change will avoid unexpected orphan references saved in VisualEffectAsset.

case BuiltInFlag.WorldToLocal:
return VFXCoordinateSpace.World;
default:
return (VFXCoordinateSpace)int.MaxValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Optionally, if outputSlot.spaceable and you reach the default state, you could throw an invalid operation exception.

m_reentrant = true;
ExpressionGraphDirty = true;
model.GetOrCreateGraph().UpdateSubAssets();
EditorUtility.SetDirty(graph);
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, I observed this behavior locally (without your change) :
_undo_test_missing_dirty
Was there another case where it causes an issue ?

@VladNeykov VladNeykov requested review from VladNeykov and removed request for a team August 18, 2021 15:59
@VladNeykov
Copy link
Contributor

Same as with the 10.x backport, one outstanding change in behavior item that this PR introduces in the FTP project which needs to be looked at. Dropping test doc here as well for visibility

Copy link
Contributor

@VladNeykov VladNeykov left a comment

Choose a reason for hiding this comment

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

Looking good, no outstanding issues pertaining to this PR (test doc). Thanks for the fix!

@julienf-unity julienf-unity merged commit bf527fe into master Sep 9, 2021
@julienf-unity julienf-unity deleted the vfx/fix/importer-and-compil-fixes branch September 9, 2021 20:43
julienf-unity added a commit that referenced this pull request Sep 20, 2021
* Fix sanitize of exposed Camera parameters

* Fix SDF Baker on PS4/5 failing due to explicit binding

* Fixed NRE when starting play mode (#279)

* Fixed NRE when starting play mode

* Save auto-attach lock state and attached VFX in the editor prefs to avoid loosing them when going in play mode

* Better restore attached VFX when leaving play mode (even if it has been removed during play)

* Fix compil error when cubemap array is used in compute (even on platform supporting it) (#5582)

* Update HDRP assets

* Fix failing test

* Fix failing test

* Revert "Fix failing test"

This reverts commit c6fe054.

* [VFX] Importer and compilation various fixes #5371

Co-authored-by: Gabriel de la Cruz <gabriel.delacruz@unity3d.com>
Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com>
Co-authored-by: Julien Amsellem <julien.amsellem@unity3d.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants