Commit Graph

103 Commits

Author SHA1 Message Date
rob krajcarski
b281028c38 Additional support for new experimental VM
-moves optimization pass to the async compilation pipeline (including moving it to it's own file, out of NiagaraSystem)
-splits up the NIAGARA_VM_EXP preprocessor define into VECTORVM_SUPPORTS_LEGACY & VECTORVM_SUPPORTS_EXPERIMENTAL allowing support of one, the other or both (the default)
#rb shawn.mcgrath
#jira none
#preflight 623c85cd1302f69e9aa0b1d7

[CL 19496739 by rob krajcarski in ue5-main branch]
2022-03-24 11:52:03 -04:00
shawn mcgrath
61cf03bac1 VectorVM bug fixes & half float support. Experimental VM on by default. #rb Rob.Krajcarski #preflight 6230b204421403c1553829fc
[CL 19388907 by shawn mcgrath in ue5-main branch]
2022-03-15 13:46:08 -04:00
shawn mcgrath
cb83612158 - New Vector VM with optimizer and serialization.
- curve sampling DIs changed to 4-wide
- Off by default
#rb stu.mckenna #preflight 620bba0e4353dc61c7f60f39

[CL 18996550 by shawn mcgrath in ue5-main branch]
2022-02-15 11:01:00 -05:00
rob krajcarski
6d21460c89 Moved VM functions over to use their accurate vectorized version (still uses approximations but uses newton-raphson iteraions to improve the estimate at some cost). Brings individual op costs of rcp(), rsqrt() and, by association, sqrt() up by a factor of ~4 but nearly doubles the precision. Also updated a few of the core modules (FindQuatBetween/DirectionAndLength/DirectionAndLengthSafe) to better take advantage of the fast/precise intrinsics
#rb stu.mckenna
#preflight 61dddf9df33c0754172a88e6

#ROBOMERGE-OWNER: rob.krajcarski
#ROBOMERGE-AUTHOR: rob.krajcarski
#ROBOMERGE-SOURCE: CL 18578280 via CL 18578407 via CL 18578421 via CL 18578819 via CL 18578843 via CL 18578847
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18578854 by rob krajcarski in ue5-main branch]
2022-01-11 18:41:23 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
johan torp
d8b1cf4d6b Math constant constexprification and outlining to reduce massive code bloat
#ROBOMERGE-AUTHOR: johan.torp
#ROBOMERGE-SOURCE: CL 17679918 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v875-17642767)

[CL 17679955 by johan torp in ue5-release-engine-test branch]
2021-09-30 13:03:15 -04:00
shawn mcgrath
cc848ed446 Wrapped FVectorVMContext in NiagaraDataInterfaceFunctionContext for external functions to facilitate running an experimental VM in parallel.
External functions should no longer access FVectorVMContext directly and instead use the helper member functions in the NiagaraDataInterfaceFunctionContext class... this should have zero effect without NIAGARA_EXP_VM defined... if it is defined then it'll use the experimental VM functions, which are not included in this CL.
#rb shaun.kime #jira none #okforgithub public

#ROBOMERGE-SOURCE: CL 16908052 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16908059 by shawn mcgrath in ue5-release-engine-test branch]
2021-07-21 07:43:14 -04:00
andrew davidson
fe7fa28e90 LWC: Niagara uses large world coordinate float types only.
Submitted on behalf of shaun.kime.
#rb chris.conway, frank.fella, michael.galetzka, simon.tovey, stu.mckenna, andy.davidson
#preflight 60cb5af49f1237000128cbe8

#ROBOMERGE-SOURCE: CL 16706154 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16706156 by andrew davidson in ue5-release-engine-test branch]
2021-06-17 12:39:31 -04:00
Marc Audy
e80ea6b959 Merge from Release-Engine-Staging @ 16444985
This represents UE4/Main @ 16445039 and Dev-PerfTest @ 16444526

[CL 16445122 by Marc Audy in ue5-release-engine-test branch]
2021-05-25 02:43:26 -04:00
rob krajcarski
9f80a46795 Standardize step() implementation between CPU and GPU scripts making the existing step(x) implement step(0, x)
#rb simon.tovey
#jira UE-115365


#ROBOMERGE-OWNER: rob.krajcarski
#ROBOMERGE-AUTHOR: rob.krajcarski
#ROBOMERGE-SOURCE: CL 16376696 via CL 16376755 via CL 16376824
#ROBOMERGE-BOT: (v804-16311228)
#ROBOMERGE-CONFLICT from-shelf

[CL 16376990 by rob krajcarski in ue5-release-engine-staging branch]
2021-05-18 17:46:08 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
Marc Audy
ada7c144fa Merge //UE5/Release-Engine-Staging @14903491 to //UE5/Main
[CL 14906022 by Marc Audy in ue5-main branch]
2020-12-11 14:21:20 -04:00
Marc Audy
a7f9391231 Merge UE5/Release-Engine-Staging @ 14811410 to UE5/Main
This represents UE4/Main @ 14768117

For ReleaseObjectVersion.h
#lockdown Marcus.Wassmer

[CL 14811440 by Marc Audy in ue5-main branch]
2020-11-24 18:42:39 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Lukas Hermanns
f9c36bda0a Remove unused variables in VectorVM that causes compiler error with clang 10 (Merged from CL 14359176).
#rb Brandon.Schaefer
#fyi Michael.Sartain
#jira none
#rnx

[CL 14359212 by Lukas Hermanns in ue5-main branch]
2020-09-21 16:14:08 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
rob krajcarski
a7225d5d7a Fix for member function specialization on android with VectorVM
#rb none


#ROBOMERGE-SOURCE: CL 12310974 via CL 12311084
#ROBOMERGE-BOT: (v670-12295787)

[CL 12311103 by rob krajcarski in Main branch]
2020-03-19 16:30:52 -04:00
rob krajcarski
357a490ebd Add local jump table to VectorVM's optimized byte code to reduce memory footprint (~%30 lower)
#rb stu.mckenna


#ROBOMERGE-SOURCE: CL 12306979 via CL 12306987
#ROBOMERGE-BOT: (v670-12295787)

[CL 12307004 by rob krajcarski in Main branch]
2020-03-19 14:40:42 -04:00
rob krajcarski
5f2b4ebba6 Generates function bindings for external DI functions that don't require user poitners so that we can share them across instances
-changes the function table to be an array of function pointers to allow for the redirection without copies/reallocations
-eliminates 2nd most common allocation in cases with large instance counts in niagara
#rb stu.mckenna


#ROBOMERGE-SOURCE: CL 12146347 via CL 12146348
#ROBOMERGE-BOT: (v659-12123632)

[CL 12146350 by rob krajcarski in Main branch]
2020-03-11 22:27:39 -04:00
arne schober
8ebb9182e7 FNM - Added Compression option for Niagara Systems. Thge Option will try to compress some of the parameters to use half precission, which can be a performance benefit on the GPU and sometimes also on the CPU.
#RB Rob.Krajcarski, Stu.McKenna
#JIRA UE-84463


#ROBOMERGE-OWNER: arne.schober
#ROBOMERGE-AUTHOR: arne.schober
#ROBOMERGE-SOURCE: CL 12105113 via CL 12121713
#ROBOMERGE-BOT: (v657-12064184)

[CL 12121717 by arne schober in Main branch]
2020-03-10 21:00:17 -04:00
mihnea balta
1dacb87178 Fixed particle IDs never being deallocated on CPU (bug introduced in 11290626).
#rb none


#ROBOMERGE-SOURCE: CL 11303717 via CL 11303719
#ROBOMERGE-BOT: (v653-11302973)

[CL 11303721 by mihnea balta in Main branch]
2020-02-10 10:20:18 -05:00
mihnea balta
6c7931e56b Fixed stale entries in the ID to index buffers for CPU emitters.
The code used to update the output ID to index table, but that left stale entries in the input buffer set. When particles died, one of the buffers had -1 for the dead IDs, but the other still had the old execution indexes. This could lead to direct reads returning bogus data, instead of reporting that the ID is no longer in use. The solution is to clear the ID table at the beginning of the tick, and let the UpdateID() function fill in the IDs which are still in use.

This problem didn't occur on GPU, where the tables were already being cleared.

#rb none


#ROBOMERGE-SOURCE: CL 11292467 via CL 11292468
#ROBOMERGE-BOT: (v647-11244347)

[CL 11293007 by mihnea balta in Main branch]
2020-02-07 13:07:57 -05:00
mihnea balta
dd1264d2a4 Fixed incorrect ID to index mapping on CPU when an emitter spawns additional particles.
The UpdateID CPU kernel didn't take into account the instance start offset, so the spawn step mapped new IDs to indices starting at 0. If the emitter already contained particles, this caused the ID to index mapping to be incorrect in the frame when the spawn happened, which caused further problems if another emitter tried to read the particles in that frame.

#rb none


#ROBOMERGE-SOURCE: CL 11290626 via CL 11290627
#ROBOMERGE-BOT: (v647-11244347)

[CL 11290628 by mihnea balta in Main branch]
2020-02-07 06:53:49 -05:00
mihnea balta
ff43248d11 Particle read DI:
* added functions which can retrieve the IDs of the particles spawned in the last tick
* added missing barriers on source buffers when reading from another emitter
* fixed bug when more than one DI function was used in a module (bad alignment on the elements of the array of attribute indices)

Persistent IDs:
* replaced ClearUAV with a custom shader, so we can set sane barriers instead of the stuff that ClearUAV() forces. Dev-Rendering replaced ClearUAV() with a better API, but I didn't want to wait for that merge.
* grouped together all the ID buffer clears before the simulation dispatches, and all the free ID list updates after rendering, so they can overlap and to avoid stalls

Barriers:
* fixed a bogus compute to graphics transition on the ID to index buffer
* when running multiple ticks, only the outputs of the final tick are transitioned to graphics
* automatic CS cache flushes are disabled once before running all the ticks and enabled at the end, instead of doing it for each tick

#jira UE-84717
#rb Stu.McKenna


#ROBOMERGE-OWNER: mihnea.balta
#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 11163241 via CL 11163243
#ROBOMERGE-BOT: (v640-11091645)

[CL 11167081 by mihnea balta in Main branch]
2020-01-29 15:31:45 -05:00