Skip to content

Commit

Permalink
[MetalPerformanceShaders] Stop excluding ARM64-specific code paths fr…
Browse files Browse the repository at this point in the history
…om macOS. (#11489)
  • Loading branch information
rolfbjarne authored May 10, 2021
1 parent 3958940 commit 4b2ee6c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/MetalPerformanceShaders/MPSStateResourceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ public static MPSStateResourceList Create (params MTLTextureDescriptor [] descri
}

MPSStateResourceList ret;
#if !MONOMAC
// Learned the hard way about arm64's variadic arguments calling conventions are different...
if (IntPtr.Size == 8 && Runtime.Arch == Arch.DEVICE)
if (Runtime.IsARM64CallingConvention)
ret = Runtime.GetNSObject<MPSStateResourceList> (IntPtr_objc_msgSend_IntPtrx3_FakeIntPtrx5_IntPtrx10 (class_ptr, Selector.GetHandle ("resourceListWithTextureDescriptors:"), arr [0], IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero));
else
#endif
ret = Runtime.GetNSObject<MPSStateResourceList> (IntPtr_objc_msgSend_IntPtrx13 (class_ptr, Selector.GetHandle ("resourceListWithTextureDescriptors:"), arr [0], arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero));

return ret;
Expand All @@ -55,21 +53,19 @@ public static MPSStateResourceList Create (params nuint [] bufferSizes)
}

MPSStateResourceList ret;
#if !MONOMAC
// Learned the hard way about arm64's variadic arguments calling conventions are different...
if (IntPtr.Size == 8 && Runtime.Arch == Arch.DEVICE)
if (Runtime.IsARM64CallingConvention)
ret = Runtime.GetNSObject<MPSStateResourceList> (IntPtr_objc_msgSend_IntPtrx3_FakeIntPtrx5_IntPtrx10 (class_ptr, Selector.GetHandle ("resourceListWithBufferSizes:"), arr [0], IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero));
else
#endif
ret = Runtime.GetNSObject<MPSStateResourceList> (IntPtr_objc_msgSend_IntPtrx13 (class_ptr, Selector.GetHandle ("resourceListWithBufferSizes:"), arr [0], arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero));

return ret;
}

#if !MONOMAC

[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
static extern IntPtr IntPtr_objc_msgSend_IntPtrx3_FakeIntPtrx5_IntPtrx10 (IntPtr receiver, IntPtr selector, IntPtr arg0, IntPtr argFake1, IntPtr argFake2, IntPtr argFake3, IntPtr argFake4, IntPtr argFake5, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9, IntPtr arg10);
#endif

[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
static extern IntPtr IntPtr_objc_msgSend_IntPtrx13 (IntPtr receiver, IntPtr selector, IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9, IntPtr arg10);
}
Expand Down

1 comment on commit 4b2ee6c

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

Path D:\a\1\s\artifacts\pkg-info\artifacts.json was not found!

Test results

2 tests failed, 191 tests passed.

Failed tests

  • [NUnit] Mono Mac OS X BCL tests group 3/Mac Full/Debug: Failed (Test run failed.
    Tests run: 11328 Passed: 10552 Inconclusive: 0 Failed: 1 Ignored: 98)
  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed

Pipeline on Agent XAMBOT-1017'
[MetalPerformanceShaders] Stop excluding ARM64-specific code paths from macOS. (#11489)

Please sign in to comment.