Skip to content

Commit

Permalink
Worked around dotnet/runtime#95043.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossNordby committed Nov 21, 2023
1 parent 13f7f8d commit aca6370
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BepuPhysics/Trees/Tree_RayCast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace BepuPhysics.Trees
{
partial struct Tree
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
//Working around https://github.com/dotnet/runtime/issues/95043:
//Under x86 with optimizations, forcing inlining seems to cause problems for sweeps. It also harms performance.
//Under x64, though, there's not really any cost to letting the JIT decide. TODO: Probably should look into ARM eventually.
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static bool Intersects(Vector3 min, Vector3 max, TreeRay* ray, out float t)
{
var t0 = min * ray->InverseDirection - ray->OriginOverDirection;
Expand Down

0 comments on commit aca6370

Please sign in to comment.