-
Notifications
You must be signed in to change notification settings - Fork 36
Fix UE 4.27 Compatibility #38
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
base: master
Are you sure you want to change the base?
Fix UE 4.27 Compatibility #38
Conversation
…at16 conversion - _mm_div_epi16 doesn't exist in any SSE/AVX instruction set - Original code incorrectly performed integer division on float16 encoded bits - Use UE4's FFloat16 for portable float16->float32 conversion - Removes mandatory F16C CPU requirement - Fixes depth unit conversion (cm to m) to work correctly
|
Hi @khalidbourr Thanks for the PR! |
|
Dear @Sanic, I haven’t evaluated it from that perspective yet. However, I did encounter build errors in Unreal Engine 4.27 on Linux, and this is the error message I received.” FStaticMeshLODResources &LODModel = StaticMesh->RenderData->LODResources[PaintingMeshLODIndex]; |
|
Alright. |
|
Once I do that I'll inform you. |
|
This is the current implementation of convertdepth I am using, not pushed yet! void UVisionComponent::convertDepth(const uint16_t *in, __m128 *out) const } |


The original convertDepth function had two issues:
_mm_div_epi16 doesn't exist - there is no SSE/AVX integer division intrinsic
Logic was incorrect - dividing float16 encoded bits as integers corrupts the values
This PR uses UE4's built-in FFloat16 class for portable float16→float32 conversion, then scales by 0.01 to convert cm→m.
Now no compilation errors,
Produces correct depth values
No longer requires F16C CPU support or manual UE4 recompilation