Skip to content

Commit

Permalink
[VFX][Fix 1414185] Reset needsComputeBounds on switching boundsMode
Browse files Browse the repository at this point in the history
This PR fixes an issue where the `needsComputeBounds` setting was not reset to false when switching `boundsMode `from Automatic to Recorded or Manual, leading to unused computations.
It also adds a warning about the cullings flags being changed to 
Fogbugz : https://fogbugz.unity3d.com/f/cases/1414185/
  • Loading branch information
ludovic-theobald committed May 31, 2022
1 parent d77a4aa commit 360e734
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ public override void OnSettingModified(VFXSetting setting)
var graph = GetGraph();
graph.visualEffectResource.cullingFlags = VFXCullingFlags.CullNone;
}
else
needsComputeBounds = false;
}
if (hasStrip)
{
Expand Down Expand Up @@ -1382,5 +1384,17 @@ public void GenerateSystemUniformMapper(VFXExpressionGraph graph)
m_GraphValuesLayout.SetUniformBlocks(orderedUniforms);
m_GraphValuesLayout.SetPaddedSize(m_SystemUniformMapper);
}

protected override void GenerateErrors(VFXInvalidateErrorReporter manager)
{
base.GenerateErrors(manager);

if (boundsMode == BoundsSettingMode.Automatic)
{
if (CanBeCompiled())
manager.RegisterError("WarningAutomaticBoundsFlagChange", VFXErrorType.Warning,
$"Changing the bounds mode to Automatic modifies the Culling Flags on the Visual Effect Asset to Always recompute bounds and simulate.");
}
}
}
}

0 comments on commit 360e734

Please sign in to comment.