Skip to content

Commit

Permalink
fix: more problems with TargetSet invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Aug 21, 2024
1 parent 39a7dee commit a9b5c25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 8 additions & 1 deletion Editor/PreviewSystem/ComputeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Threading.Tasks;
using JetBrains.Annotations;
using UnityEngine;

#endregion

Expand Down Expand Up @@ -39,7 +40,13 @@ static ComputeContext()

internal ComputeContext(string description)
{
Invalidate = () => _invalidater.TrySetResult(null);
Invalidate = () =>
{
#if NDMF_TRACE
Debug.Log("Invalidating " + Description);
#endif
_invalidater.TrySetResult(null);
};
OnInvalidate = _invalidater.Task;
Description = description;
}
Expand Down
7 changes: 2 additions & 5 deletions Editor/PreviewSystem/Rendering/TargetSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ public TargetSet(ImmutableList<IRenderFilter> filters)
foreach (var filter in _filters)
{
if (!filter.IsEnabled(_targetSetContext)) continue;

var ctx = new ComputeContext("StageDescriptor for " + filter);
ctx.Invalidates(_targetSetContext);


Profiler.BeginSample("TargetSet.GetTargetGroups[" + filter + "]");
var groups = filter.GetTargetGroups(ctx);
var groups = filter.GetTargetGroups(_targetSetContext);
if (groups.IsEmpty) continue;

builder.Add(new Stage
Expand Down

0 comments on commit a9b5c25

Please sign in to comment.