jamienicol / glsl-optimizer

GLSL optimizer based on Mesa's GLSL compiler. Used in Unity for mobile shader optimization.
Other
9 stars 8 forks source link

Linking fails on ARM64 MSVC: "unresolved external symbol ffs" #12

Closed saschanaz closed 2 months ago

saschanaz commented 2 months ago

https://github.com/jamienicol/glsl-optimizer/blob/cbd7d1a0f71f3226f90cce75ffadf95bd60636c8/src/util/bitscan.h#L52-L71

The condition #elif defined(_MSC_VER) && (_M_IX86 || _M_ARM || _M_AMD64 || _M_IA64) is not fulfilled on ARM64 MSVC because of the lack of _M_ARM64.

Per https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64?view=msvc-170 _BitScanForward exists for ARM64, but not sure whether it can just be added or something else should be done.

saschanaz commented 2 months ago

Cross linking: https://bugzilla.mozilla.org/show_bug.cgi?id=1913645