-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VmaCountBitsSet crashes on CPUs without support for MSVC __popcnt
(ARM, older x86)
#245
Comments
Thank you for reporting this issue. I removed usage of I hope that functions like |
Thanks! That works, but if that optimization is important, I think you should be able to improve things to actually check CPU capabilities. The MSDN docs provide some guidance on how to check for Advanced Bit Manipulation support: https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64?view=msvc-170 So far I didn't find information that would indicate that the GCC/Clang
Based on https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64?view=msvc-170 I think it might be fine, it seems supported without specific requirements on all architectures supported by MSVC: |
Reading https://stackoverflow.com/questions/60165922/stdbitsetncount-vs-builtin-popcount it sounds like |
There is a nice header So I am going to leave it as-is for now. |
__popcnt
is used here unconditionally for MSVC without checking that it's actually supported by the CPU:VulkanMemoryAllocator/include/vk_mem_alloc.h
Lines 3080 to 3081 in dc3f6bb
This has been reported to triggering a crash in Godot: godotengine/godot#58463
I don't know much about this instruction myself but Stackoverflow seems to have decent advice on checking capability with
cpuid
here:https://stackoverflow.com/a/42913358
The text was updated successfully, but these errors were encountered: