Commit Graph

57 Commits

Author SHA1 Message Date
Ben Marsh
885ebb1ed2 Fix deprecation warnings in CIS on Mac.
[CL 2501038 by Ben Marsh in Main branch]
2015-04-03 08:31:34 -04:00
Robert Manuszewski
2858c3acbc Fixing errors and warnings in async loading:
- Fixed PostLoad order on loaded packages
- Fixed imports not being properly streamed due to bad FAsyncPackage setup

[CL 2500049 by Robert Manuszewski in Main branch]
2015-04-02 13:36:57 -04:00
Robert Manuszewski
73c3b39f0e When creating linker for async package, don't attempt to load packages with an empty name. Removes warning spam when trying to convert NAME_None to a package name.
[CL 2499895 by Robert Manuszewski in Main branch]
2015-04-02 10:57:59 -04:00
Robert Manuszewski
8fe5db30e3 Merging UE4-Streaming to UE4
- Linkers are no longer UObjects. Renamed ULinker, ULinkerLoad and ULinkerSave to FLinker, FLinkerLoad, FLinkerSave respectively
- Linkers are now associated with their UPackages
- Linker version is now stored in UPackages
- Async loading is now performed on a separate thread (if platform supports it and only in cooked builds), with the exception of PostLoad which is still done on the game thread
- Added UObject::IsPostLoadThreadSafe() function to determine if PostLoad is thread safe and can be executed on the async loading thread (defaults to false)
- UObject creation is now thread safe and can be performed on any thread
- Move many of the linker/UObject globals into FUObjectThreadContext (TLS)
- GetAsyncLoadPercentage() now takes PostLoad into account
- More async loading stats
- Added AtomicallySetFlags/ClearFlags to UObject
- Made FModuleManager thread safe.
- Added FGCScopeGuard as means of preventing GC from executing from non-game thread
- It's possible to disable async loading thread through ini settings.
- Cancelling async loading will now also trigger GC
- Implemented a basic version of async streaming priorities.

Change 2410813 by Mikolaj Sieluzycki:
	Change Sleep in while loop to ConditionalSleep in FMultiReaderSingleWriterGT
Change 2410734 by Mikolaj Sieluzycki:
	Make FModuleManager thread safe.
Change 2399879 by Mikolaj Sieluzycki:
	Basic version of async streaming priorities.
Change 2410707 by Mikolaj Sieluzycki:
	Implement conditional and no stat versions of sleep.
Change 2371939 by Robert Manuszewski:
	Async Loading Improvements: adding more stats (accumulators)
Change 2372403 by Robert Manuszewski:
	Fixing compile errors when STATs are not enabled
Change 2371526 by Robert Manuszewski:
	AsyncLoading Improvements (WIP)
Change 2407198 by Robert Manuszewski:
	Re-implementing delegate fixes for Async Loading
Change 2407425 by Robert Manuszewski:
	Re-implementing cancelling async loading in the async loading branch.
Change 2484362 by Robert Manuszewski:
	Making it possible to disable async loading thread through ini settings.
Change 2484744 by Robert Manuszewski:
	Minimizing locks in GC and other threads when handling UObjects
Change 2480190 by Robert Manuszewski:
	Fixing infinite stall after canceling async loading in non-cooked builds
Change 2484268 by Robert Manuszewski:
	Fixing crash when allocating permanent object pool.
Change 2489761 by Robert Manuszewski:
	Fixing BulkData using linker archive on the main thread even if the linker was created on the async loading thread.
Change 2493624 by Robert Manuszewski:
	Cancelling async loading will now also trigger GC
Change 2487881 by Robert Manuszewski:
	Making ShaderIdMap operations thread safe.
Change 2488067 by Robert Manuszewski:
	Fixing GetAsyncLoadPercentage. It will now also respect PostLoad.
Change 2458640 by Robert Manuszewski:
	Fixing crash in PIE
Change 2458825 by Robert Manuszewski:
	Fixing a few crashes when streaming and the package is missing.
Change 2476935 by Robert Manuszewski:
	Fixing crash while async loading ANavigationData
Change 2477361 by Robert Manuszewski:
	Fixing crashes in cooked game
Change 2480095 by Robert Manuszewski:
	Making FUObjectArray more thread safe
Change 2475443 by Robert Manuszewski:
	Re-enabling single-threaded async loading path for the editor and platforms that don't support multithreading.
Change 2475458 by Robert Manuszewski:
	Making sure bulk data is only loaded on a separate thread if it's not being loaded on the async loading thread.
Change 2476661 by Robert Manuszewski:
	Fixing FlushAsyncLoading not flushing everything
Change 2401089 by Jaroslaw Surowiec:
	Core - Added AtomicallySetFlags/ClearFlags to UObject, added a comment to ThisThreadAtomicallyClearedRFUnreachable

[CL 2498249 by Robert Manuszewski in Main branch]
2015-04-01 03:03:18 -04:00
PaulEremeeff
3d878d5a79 PR #996: Fixing PVS-Studio warnings (Contributed by PaulEremeeff)
I have reviewed each change carefully, but it is a large change and I could have missed something! Here is a summary of the types of changes in this CL:
 * Made nullptr checks consistent (the plurality of the changes are of this type)
 * Completed switch statements (IE, switch did not explicitly handle default case, but had unhandled enum entries - this is the second most popular type of fix)
 * Removed unused variables
 * Removed redundant initializations
 * WidgetNavigationCustomization.cpp was fixed by the owner
 * integers converted to floats where result was stored in a float
 * Removed redundent null checks (e.g. before delete statements)
 * Renamed variables to prevent non-obvious shadowing
 * Fixed use of bitwise & when checking for equality to an enum entry (which is often 0)
 * Fixes for some copy paste errors (e.g. FoliageEdMode.cpp)

[CL 2498053 by Dan Oconnor in Main branch]
2015-03-31 20:12:31 -04:00
Jaroslaw Surowiec
faf52e099f Stats - Fixed stats metadata issue
[CL 2495047 by Jaroslaw Surowiec in Main branch]
2015-03-28 14:47:41 -04:00
Dan Oconnor
195086b1a5 Changes from PVS-Studio, these could introduce small behavior change.
Consistent null checks, fixes for copy/pasted conditions, copy pasted LOCTEXT identifiers, comparisons against literals of the wrong type, missing return statements, dead code, and some system calls that were ignoring their return value

[CL 2494390 by Dan Oconnor in Main branch]
2015-03-27 16:11:50 -04:00
Robert Manuszewski
9ac96bec76 When cancelling async loading, only kill objects created during async loading if they haven't finished loading yet.
Due to recent changes, some of the objects inside FAsyncObjectsReferencer can come from packages that have previously been loaded.

[CL 2487918 by Robert Manuszewski in Main branch]
2015-03-23 12:17:55 -04:00
Robert Manuszewski
92a07b505c Fix for crashes when GC is triggered while streaming.
[CL 2482878 by Robert Manuszewski in Main branch]
2015-03-18 06:53:36 -04:00
Robert Manuszewski
1c87c43387 Fixed a small bug in FinalizeLinker error checking code
[CL 2470107 by Robert Manuszewski in Main branch]
2015-03-05 10:00:38 -05:00
Robert Manuszewski
74a8f93227 Fixing async loading code not handling FinalizeLinker failures properly resulting in infinite load times.
[CL 2470101 by Robert Manuszewski in Main branch]
2015-03-05 09:57:38 -05:00
Robert Manuszewski
29ad5099d9 Disabling async bulk data loading when multithreading is not supported
[CL 2469896 by Robert Manuszewski in Main branch]
2015-03-05 04:15:28 -05:00
Gil Gribb
35cf42566a UE4 - merge GDC branch, code @2465640 to main
[CL 2468685 by Gil Gribb in Main branch]
2015-03-04 08:31:40 -05:00
Marc Audy
daf220d485 Fix shadowed variables
[CL 2466748 by Marc Audy in Main branch]
2015-03-02 15:12:31 -05:00
Robert Manuszewski
fbc5d56aa0 BulkData improvements:
- Added the ability to force stream bulk data
- Added SerializeElements to avoid the cost of SerializeElement for each element.

[CL 2466143 by Robert Manuszewski in Main branch]
2015-03-02 06:14:30 -05:00
Robert Manuszewski
403a31743e [INTEGRATE] Change 2462246 by Robert.Manuszewski@Robert_Manuszewski_EGP1 on 2015-02-26 11:21
Fixing bigger mem usage due to bulk data loading changes

[CL 2466140 by Robert Manuszewski in Main branch]
2015-03-02 06:06:02 -05:00
Robert Manuszewski
46070e5437 [INTEGRATE] Change 2462119 by Robert.Manuszewski@Robert_Manuszewski_EGP1 on 2015-02-26 09:42
Disabling async bulk data in non-cooked builds

[CL 2466139 by Robert Manuszewski in Main branch]
2015-03-02 06:04:49 -05:00
Robert Manuszewski
f491f78f35 [INTEGRATE] Change 2462032 by Robert.Manuszewski@Robert_Manuszewski_EGP1 on 2015-02-26 07:38
Async BulkData loading

[CL 2466138 by Robert Manuszewski in Main branch]
2015-03-02 06:03:06 -05:00
Ben Marsh
873e5dbf4f [INTEGRATE] Change 2451443 by Jack.Porter@JPORTER-I7Q_UE4 on 2015/02/19 05:46:10
Fix for RC blocker UE-10050 - crash loading a BulkData inside a transaction, seen when pasting an actor that references an object in a map with an AtmosphericFogComponent

	#lockdown: James.Golding

[CL 2460083 by Ben Marsh in Main branch]
2015-02-25 07:57:10 -05:00
Jaroslaw Surowiec
47019ea38f Core - Replaces expensive Sleep with ConditionalSleep
[CL 2453212 by Jaroslaw Surowiec in Main branch]
2015-02-20 10:10:47 -05:00
Jaroslaw Surowiec
d6aa55f408 Core - Replaces expensive Sleep with ConditionalSleep and added a few more stats
[CL 2453131 by Jaroslaw Surowiec in Main branch]
2015-02-20 09:18:36 -05:00
Robert Manuszewski
76c9d1ee9d Fix for crash on exit after async loading of a package failed
[CL 2451352 by Robert Manuszewski in Main branch]
2015-02-19 02:34:14 -05:00
Robert Manuszewski
6801bb09f8 Merging Ms fixes to PostLoad spikes
[CL 2440201 by Robert Manuszewski in Main branch]
2015-02-10 14:45:12 -05:00
Mikolaj Sieluzycki
52c71176ab Rename StaticConstructObject to StaticConstructObject_Internal and use it only in CoreUObject module. Change rest of usages to NewObject.
#codereview Robert.Manuszewski

[CL 2437731 by Mikolaj Sieluzycki in Main branch]
2015-02-09 05:43:45 -05:00
Graeme Thornton
bbdd94813a Slightly more useful loading percentage reporting for async packages.
[CL 2425850 by Graeme Thornton in Main branch]
2015-01-30 10:55:53 -05:00