Commit Graph

245 Commits

Author SHA1 Message Date
JeanFrancois Dube
e3c08e960c Data Layer: fix old data layer assets debug color when loading.
#rb richard.malo
#preflight 629fe378f73a9b013ddf953a
#rnx

[CL 20554448 by JeanFrancois Dube in ue5-main branch]
2022-06-08 07:11:02 -04:00
Jason Adcock
dccca1fb87 Fix Fortnite Networking Versioning between FN and UE branches
#jira UE-147571, UE-149373, UE-146854
#rb ryan.gerleve
#preflight

[CL 20053774 by Jason Adcock in ue5-main branch]
2022-05-04 20:56:28 -04:00
Zak Middleton
bd47021f04 #ue5 - Added VectorMod360(), for specific use by Rotator normalization where speed is more important than the stability of stock fmod() under extreme ranges. 30% - 75% faster depending on the intrinsics available to the alternate VectorMod().
Given that the second argument is always 360, we can remove some tests for bad ranges of input and use simple truncation/multiplication to compute the result, while retaining good accuracy within reasonable FRotator input value ranges.

#jira UE-129730
#preflight 62699851f97c319beba69337
#rb Dmytro.Vovk

[CL 19947858 by Zak Middleton in ue5-main branch]
2022-04-27 17:44:04 -04:00
Zak Middleton
f2e6ac0f2d #ue5 - Make UnrealMathFPU usable again when vector intrinsics are disabled or when explicitly swapped in within VectorRegister.h. Fixed some related deprecated UE constants usage. Fixed NaN handling for comparisons in UnrealMathFPU to pass the UnrealMathTest startup tests.
#jira UE-129730
#rb none
#preflight 62687fe6430b9997eb013593

[CL 19941685 by Zak Middleton in ue5-main branch]
2022-04-27 12:27:40 -04:00
Steve Robb
f4d1564ffe New BitCast<>() function which works like C++20's std::bit_cast<>().
Deprecation of FPlatformMath::IsNegative*() functions.
New FPlatformMath::IsNegativeOrNegativeZero().
Fix up of existing usage to either use < 0 or IsNegativeOrNegativeZero where appropriate.
Fixes for aliasing problems in various FMath functions, including IsNegative*().

Resubmission of CL# 19833778 with fixes for problematic Mac and Android toolchains, causing spurious errors while building PCHs.

#rb devin.doucette, charles.bloom, will.damon, chris.babcock
#jira UE-148435
#preflight 6260764d91376845adf9893f

[CL 19840896 by Steve Robb in ue5-main branch]
2022-04-20 19:05:47 -04:00
Steve Robb
5c1f45e9a8 Undo //UE5/Main/Engine/... changelist 19833778 due to Mac and Android compilation failure.
#rb none
#jira none
#preflight none
#fyi will.damon

[CL 19835840 by Steve Robb in ue5-main branch]
2022-04-20 15:09:51 -04:00
Steve Robb
a9e89c3ed6 New BitCast<>() function which works like C++20's std::bit_cast<>().
Deprecation of FPlatformMath::IsNegative*() functions.
New FPlatformMath::IsNegativeOrNegativeZero().
Fix up of existing usage to either use < 0 or IsNegativeOrNegativeZero where appropriate.
Fixes for aliasing problems in various FMath functions, including IsNegative*().

#rb devin.doucette, charles.bloom
#jira UE-148435
#preflight 625ece48f16e0d2accab15d9

[CL 19833778 by Steve Robb in ue5-main branch]
2022-04-20 13:38:10 -04:00
sebastian nordgren
b6b10ed4e1 KiB/MiB/GiB/TiB are now accepted spellings for the units in the details view.
#review-19625751 @lauren.barnes
#preflight 624d5688683a7dd323bde009

[CL 19644364 by sebastian nordgren in ue5-main branch]
2022-04-06 05:05:32 -04:00
Steve Robb
4bc29be92b Re-enable the removal of the legacy math macros from Core, removed in CL# 19494088.
A couple of other macro fixes in Core.

#rb none
#jira UE-140139
#preflight 6244bbb9f73c316f68e76bf3

[CL 19564411 by Steve Robb in ue5-main branch]
2022-03-30 16:57:01 -04:00
Steve Robb
51802de52f UE_ prefix added to math macros, with switches for turning on deprecation and removal for the old macros.
Fixes for all the macro use in Core.

#rb robert.manuszewski
#jira UE-140139
#preflight 623c54628900c14eecdea9c6

[CL 19493359 by Steve Robb in ue5-main branch]
2022-03-24 07:49:46 -04:00
Steve Robb
897dd170ab Replacement of DEPRECATED_MACRO with UE_DEPRECATED_MACRO.
#rb devin.doucette
#jira none
#preflight 623b225a7b69b01ec16118a7

[CL 19480377 by Steve Robb in ue5-main branch]
2022-03-23 12:07:25 -04:00
zach bethel
50274e3050 Converted FIntPoint / FIntVector / FIntRect to a template type and added unsigned variants.
#rb luke.thatcher, andrew.davidson, steve.robb
#preflight 6239e9d204769ab49354a30f

[CL 19468937 by zach bethel in ue5-main branch]
2022-03-22 13:40:58 -04:00
fabian giesen
44b81d0e43 FLinearColor conversion optimizations and some fixes.
FLinearColor ctor from FColor is mainly three table lookups, make it inline and move to the header.
Quantize, QuantizeFloor, QuantizeRound are similarly trivial, now inline.
Move Clamp01 to FColor as static method so it's namespaced; rename to Clamp01NansTo0 to explain why it's not just FMath::Clamp to [0,1]
SSE2-ified FLinearColor::ToFColorSRGB for x86 targets, bitwise exact same results as before for all input floats (tested exhaustively, test included)
Don't want to make ToFColorSRGB inline, it's a bit large for that, but make an array version that does multiple at once. Mainly try to avoid doing a cross-DLL call per pixel for large batches.
Switch ImageCore Linear->sRGB conv to use array version.
FLinearColor R,G,B,A members union'd with "deprecated" RGBA[] array, Component() updated to use it (matching recent fix for FVector)
ImageCore vector loads from FLinearColors updated to use &Component(0) which gives &RGBA[0], pointer to a 4-elem array
Add tests to UnrealMathTest.cpp to verify that sRGB<->Linear and UNORM<->Linear conversions behave as expected, plus the separate ColorConversionHeavy test that does the exhaustive equivalence check between the SSE2 ToFColorSRGB() and reference (warning: takes a while)

#rb danny.couture, martins.mozeiko
#preflight 6238c86f04769ab493469a3f

[CL 19456245 by fabian giesen in ue5-main branch]
2022-03-21 15:07:04 -04:00
fabian giesen
d0472685e2 Fix FLinearColor::ToFColorSRGB handling of large A, Quantize handling of large R/G/B/A.
For large enough floats x (e.g. 1e+7f), x*255 is too large to convert to int. On x86 this turns into INT_MIN which then gets clamped to 0, on ARM it gets saturated and turns into INT_MAX which gets clamped to 255.

Fix it so that over-large values result in 255 (which is the more natural behavior) everywhere and note the conversion rules used for both the sRGB and the linear channels while I'm here. Also update ImageCore optimized kernels to include the QuantizeRound fix.

Confirmed to produce bitwise identical results for textures on AncientGame (i.e. nop on typical content).

#jira  UE-146294
#preflight 6234ffcc48746817f14025dc
#rb martins.mozeiko

[CL 19442181 by fabian giesen in ue5-main branch]
2022-03-18 18:24:46 -04:00
Tim Smith
2bf67af6e7 UHT in UBT initial version. Currently disabled.
Tested against UnrealEditor, ShooterGame, QAGame, FortniteGame, Lyra, CitySample, and a local project

Ciode review was a preliminary review for a coding style.

#rnx
#rb jonathan.adamczewski, joe.kirchoff
#preflight 6220cfb76f26901529b6514e

[CL 19243710 by Tim Smith in ue5-main branch]
2022-03-03 09:59:05 -05:00
zak middleton
77f452fb9b #ue5 - LWC: Added *ToInt32() versions to Trunc/Round/Floor/Ceil to make those able to be explicit and cleaner to replace where needed. Added missing TruncToInt64(double), RoundToInt(double), RoundToInt64(double).
Added overloads for *ToFloat(double) methods to TUnrealPlatformMathSSE4Base to avoid ambiguous overloads (and make it easier for us to update later when do another pass at int64 versions).

Resolved ambiguous Max() and Min() calls when mixing int32/int64, float/double, etc by using macro to promote to the largest precision type.

#jira UE-124808
#rb Andrew.Davidson
#lockdown Julien.Marchand
#preflight 6206fa3af7376af79b56ea83

#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18984296 in //UE5/Release-5.0/... via CL 18985501 via CL 18987604
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18987966 by zak middleton in ue5-main branch]
2022-02-14 18:29:44 -05:00
shawn mcgrath
c4bd825d8b Moving third party lib into ThirdParty and corresponding simd fixups and addtional simd functionality #rb stu.mckenna #preflight 620a651d6e5d06a54291e1ce
[CL 18983019 by shawn mcgrath in ue5-main branch]
2022-02-14 13:49:00 -05:00
andrew davidson
c08177950b LWC: Double NetSerialize support for FVector/FVector2D.
Backwards compatibility with replays from float based builds.
#rb ryan.gerleve
#preflight 61f3ed956b5aea38e5b68e9c

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18770363 in //UE5/Release-5.0/... via CL 18770369 via CL 18770589
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18770595 by andrew davidson in ue5-main branch]
2022-01-28 09:06:33 -05:00
marc audy
f58e74d6f4 Final(?) fix for -nopch linker issues but also not breaking other platforms
#rb Aurel.Cordonnier
[CODEREVIEW] Zak.Middleton, Andrew.Davidson
#rnx
#jira

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 18726718 via CL 18726727 via CL 18726743 via CL 18727559 via CL 18727890
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18727913 by marc audy in ue5-main branch]
2022-01-25 16:02:57 -05:00
ben woodhouse
3337972c23 Non-SSE platforms compile fix
[CODEREVIEW] Andrew.Davidson, Zak.Middleton
#rb Aurel.Cordonnier, Ben.Woodhouse
#jira
#rnx

#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 18721153 via CL 18721173 via CL 18721177 via CL 18724669 via CL 18725098
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18725122 by ben woodhouse in ue5-main branch]
2022-01-25 13:02:17 -05:00
marc audy
24c7f7c62d Fix VectorMatrixMultiply not existing if -nopch is used
[CODEREVIEW] Andrew.Davidson, Zak.Middleton
#rb Aurel.Cordonnier, Ben.Woodhouse
#jira
#rnx

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 18720641 via CL 18720643 via CL 18720644 via CL 18720812 via CL 18720886
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18720889 by marc audy in ue5-main branch]
2022-01-25 04:42:27 -05:00
zak middleton
aabb01f97f #ue5 - LWC: fix #if check in case symbol is not defined.
#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18614616 via CL 18616142 via CL 18616256 via CL 18619470 via CL 18619727 via CL 18620065
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18620586 by zak middleton in ue5-main branch]
2022-01-14 13:39:56 -05:00
zak middleton
868758e75a #ue5 - LWC: build fix on non-SSE platforms
#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18605321 via CL 18616140 via CL 18616250 via CL 18619448 via CL 18619695 via CL 18620025
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18620573 by zak middleton in ue5-main branch]
2022-01-14 13:39:22 -05:00
zak middleton
1b6e91e152 #ue5 - LWC: changes for Chaos propagating incorrect or NaN rotations caused by a few issues, mainly MSVC generating bad code with /arch:AVX enabled, but also due to API holes in PMatrix.
Main compiler bug workaround was in FRotation3::Conjugate() used by CalculateAngularVelocity1 (and unused CalculateAngularVelocity2). MSVC generated incorrect optimized code when complied with /arch:AVX, which breaks down on negating the individual elements and reassembling them. Workaround is to use the vectorized formulation already in the base TQuat (or disabling optimizations around the original code). Without this change, BodySolver::SetW() would assign (but now asserts) NaN values generated from CalculateAngularVelocity with 2 valid input rotations.

Includes various fixes for PMatrix<FReal, 3, 3> causing last element to take a value not equal to 1, which caused scaling of results. Due to missing operator*= and operator+= overrides (which also fixed bad Determinant() as well as bad transformations).

Also fixed missing definitions for Zero and Identity for recently refactored PMatrix, since only the FMatrix one was defined in Utilities.cpp

Refactored some massive inlined Matrix and Quat functions to separate cpp files, because the inlined assembly would go to sometimes over 400 lines per matrix mutliply. This made debugging difficult and was providing minimum value (and there are outstanding MSVC bug as well with code gen issues in overly large functions so best to avoid those).

Re-enabled AVX intrinsics on previously disabled platforms (from CL 18456125).
Note that for testing on PC, you can set VCToolChain.cs to enable /arch:AVX (which is the build flag that surfaces the issue). With that flag off but other avx/sse remaining on, bug does not occur. Toggling these will cause a full rebuild.

#jira UE-134215, UE-138959
#rb David.Harvey, Max.Whitehead, Cedric.Caillaud
#preflight

#ROBOMERGE-OWNER: zak.middleton
#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18598858 via CL 18616128 via CL 18616245 via CL 18619403 via CL 18619668 via CL 18619988
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18620555 by zak middleton in ue5-main branch]
2022-01-14 13:38:35 -05:00
zak middleton
e3b6aee190 #ue5 - LWC: fix compile errors when using non-vectorized FTransform.
Some code was using the wrong #define to toggle (PLATFORM_ENABLE_VECTORINTRINSICS instead of ENABLE_VECTORIZED_TRANSFORM).

#rb Andrew.Davidson

#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18587119 via CL 18587132 via CL 18587135 via CL 18587389 via CL 18587410 via CL 18587426
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18587431 by zak middleton in ue5-main branch]
2022-01-12 13:54:54 -05:00