NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.11k stars 793 forks source link

macOS arm64 support and various other fixes #569

Open dpogue opened 2 years ago

dpogue commented 2 years ago

By default this will make a macOS universal build (with both x86_64 and arm64 in the same files) but supports per-architecture builds using the CMake PX_OUTPUT_ARCH flag.

CLAassistant commented 2 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: dpogue
:x: Lunanne
You have signed the CLA already but the status is still pending? Let us recheck it.

MissUp109 commented 2 years ago

Thank you for your email, I will reply as soon as possible.我已经收到您的邮件,会尽快回复,谢谢!Leah Lynn林莹莹Computer Science and Technology, Zhejiang University浙江大学计算机科学与技术学院

colincornaby commented 1 year ago

Building this for ARM64/macOS and getting the following error:

/Users/colincornaby/Documents/Plasma/PlasmaSrc/vcpkg/buildtrees/physx/src/be49a99479-d1b16eed08.clean/physx/source/foundation/include/unix/neon/PsUnixNeonInlineAoS.h:3582:10: error: argument value 2 is outside the valid range [0, 1]
                return vdupq_lane_f32(vget_low_f32(a), index);

The code looks like this:

#if PX_UWP
    if(index == 0)
    {
        return vdupq_lane_f32(vget_low_f32(a), 0);
    }
    else if (index == 1)
    {
        return vdupq_lane_f32(vget_low_f32(a), 1);
    }
#else
    if(index < 2)
    {
        return vdupq_lane_f32(vget_low_f32(a), index);
    }
#endif

The issue could probably be resolved by opting in to the UWP behavior. I'm not sure what the source of this issue is - it should be happening for iOS as well. It could be that Apple has added this enforcement in a compiler update at some point.

MissUp109 commented 1 year ago

Thank you for your email, I will reply as soon as possible.我已经收到您的邮件,会尽快回复,谢谢!Leah Lynn林莹莹Computer Science and Technology, Zhejiang University浙江大学计算机科学与技术学院

dpogue commented 1 year ago

I'm not sure what the source of this issue is - it should be happening for iOS as well. It could be that Apple has added this enforcement in a compiler update at some point.

I remember seeing this somewhere, but do not recall how I worked around it and why it didn't block submitting this patch (or the acceptance of this patch into other packaging systems) 😕

rustui commented 1 year ago

This patch fixes compilation error.

MissUp109 commented 1 year ago

Thank you for your email, I will reply as soon as possible.我已经收到您的邮件,会尽快回复,谢谢!Leah Lynn林莹莹Computer Science and Technology, Zhejiang University浙江大学计算机科学与技术学院