Skip to content

Commit

Permalink
Temp: Add profiler markers
Browse files Browse the repository at this point in the history
  • Loading branch information
daleeidd committed Apr 8, 2024
1 parent d56698e commit e7f88f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crest/Assets/Crest/Crest/Scripts/Collision/QueryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static class QueryHelper
/// not be computed on the GPU and are instead computed on the CPU by retaining last frames' query results and computing finite diffs.
/// </summary>
#if CREST_BURST_QUERY
[BurstCompile]
[BurstCompile(CompileSynchronously = true)]
#endif
public abstract class QueryBase
{
Expand Down Expand Up @@ -362,7 +362,7 @@ struct UQPArgs
public NativeArray<Vector3> _queryPosXZ_minGridSize;
}

[BurstCompile]
[BurstCompile(CompileSynchronously = true)]
protected static unsafe bool UpdateQueryPoints(void* args)
{
ref var realargs = ref UnsafeUtility.AsRef<UQPArgs>(args);
Expand Down Expand Up @@ -701,7 +701,7 @@ struct CVArgs
public NativeArray<Vector3> _queryResultsLast;
}

[BurstCompile]
[BurstCompile(CompileSynchronously = true)]
protected static unsafe int CalculateVelocities(void* args)
{
ref var realargs = ref UnsafeUtility.AsRef<CVArgs>(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Crest
/// but is a fairly common case.
/// </summary>
#if CREST_BURST_QUERY
[BurstCompile]
[BurstCompile(CompileSynchronously = true)]
#endif
public class SampleHeightHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void Update()
return;
}

UnityEngine.Profiling.Profiler.BeginSample("Crest.VCA.Update");

var isNull = false;

Expand Down Expand Up @@ -198,6 +199,8 @@ void Update()
}
}
}

UnityEngine.Profiling.Profiler.EndSample();
}

public static void DebugDrawCross(Vector3 pos, float r, Color col, float duration = 0f)
Expand Down
2 changes: 2 additions & 0 deletions crest/Assets/Crest/Crest/Scripts/OceanRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,10 @@ void RunUpdate()
if (_heightQueries || EditorApplication.isPlaying)
#endif
{
UnityEngine.Profiling.Profiler.BeginSample("Crest.VCA.UpdateQueries");
CollisionProvider?.UpdateQueries();
FlowProvider?.UpdateQueries();
UnityEngine.Profiling.Profiler.EndSample();
}

_isFirstFrameSinceEnabled = false;
Expand Down

0 comments on commit e7f88f1

Please sign in to comment.