Commit Graph

93 Commits

Author SHA1 Message Date
Martin Mittring
6f0237bc2a minor optimizations
[CL 2609953 by Martin Mittring in Main branch]
2015-07-02 19:28:56 -04:00
Rolando Caloca
daef6ebed2 UE4 - hlslcc - Common header reader
[CL 2609224 by Rolando Caloca in Main branch]
2015-07-02 11:52:03 -04:00
Marcus Wassmer
8a49574735 Vertex and Index buffer write locks on PS4 no longer require memcopies.
RHi now provides CreateAndLock functions for Vertex and Index buffers which are more efficient on certain platforms.
Use r.PS4StandardWriteLocks=1 to enable the old default functionality for testing if necessary.
#codereview Gil.Grib,Lee.Clark

[CL 2606146 by Marcus Wassmer in Main branch]
2015-06-30 14:18:55 -04:00
Daniel Lamb
62c9d5a665 Fix for inconsistent crash when requesting shader recompilation via cook on the fly.
UE-16572

[CL 2579114 by Daniel Lamb in Main branch]
2015-06-05 17:58:38 -04:00
Robert Manuszewski
e274d53736 [INTEGRATE] Change 2527228 by Robert.Manuszewski@Robert_Manuszewski_Raptor1 on 2015-04-27 14:09
Fix for FShader crash while streaming a level.

- Made FShader ref counting more thread safe
- Added extra locks when unregistering the shader so that released shaders can't be found in the shader id map while a shader is being released
- Made sure FShaderType::FindShaderById adds a reference to existing shaders while serializaing inline shader maps.

[INTEGRATE] Change 2532254 by Robert.Manuszewski@Robert_Manuszewski_Raptor1 on 2015-04-30 14:18

Better fix for crashes when streaming. Making FShader AND FShaderResource handling thread safe

[CL 2538774 by Robert Manuszewski in Main branch]
2015-05-06 04:18:05 -04:00
Bob Tellez
513d14136f [AUTOMERGE]
#UE4 Added a Canary for FShaderResource that mimics the behavior of the one in FShader to help track down the cause of https://jira.ol.epicgames.net/browse/UE-14017

--------
Integrated using branch Ue4-To-UE4-Fortnite-Simple (reversed) of change#2529461 by Bob.Tellez on 2015/04/28 19:38:07.

[CL 2530497 by Bob Tellez in Main branch]
2015-04-29 13:42:47 -04:00
Bob Tellez
770638f7dd [AUTOMERGE]
#UE4 Added an extra canary check

--------
Integrated using branch Ue4-To-UE4-Fortnite-Simple (reversed) of change#2527111 by Bob.Tellez on 2015/04/27 12:42:15.

[CL 2527113 by Bob Tellez in Main branch]
2015-04-27 12:42:48 -04:00
Bob Tellez
63d256d14c [AUTOMERGE]
#UE4 Added ShaderMagic_CleaningUp to the Canary checks in FShader. This will help track down the cause of UE-14017

--------
Integrated using branch Ue4-To-UE4-Fortnite-Simple (reversed) of change#2524950 by Bob.Tellez on 2015/04/24 16:48:53.

[CL 2527112 by Bob Tellez in Main branch]
2015-04-27 12:42:32 -04:00
Mark Satterthwaite
30a1d8bd53 Correct incomplete sentence in FShaderCache comment.
[CL 2514771 by Mark Satterthwaite in Main branch]
2015-04-16 15:09:16 -04:00
Mark Satterthwaite
2e96d8bc09 More explanatory code documentation for FShaderCache.
#codereview michael.trepka

[CL 2514751 by Mark Satterthwaite in Main branch]
2015-04-16 15:01:56 -04:00
Rolando Caloca
e81581f205 UE4 - Fix for ES3.1 emulation on PC
[CL 2514748 by Rolando Caloca in Main branch]
2015-04-16 15:01:16 -04:00
Mark Satterthwaite
03314a3e3f In the shader-cache associate logged draw states with a 'streaming key' so that they may be batched and predrawn only when that 'streaming key' is active. This limits predrawing to only those states that are currently relevant. Added comments as to the purpose and operation of the shader-cache for posterity.
#codereview michael.trepka

[CL 2514492 by Mark Satterthwaite in Main branch]
2015-04-16 12:46:30 -04:00
Marc Audy
4562acb429 Fix shadow variables
[CL 2507160 by Marc Audy in Main branch]
2015-04-09 15:23:52 -04:00
Dan Oconnor
76e1440d85 Further changes from PVS-Studio, submitted without modification, reviewed with owners where I was unsure of the change
[CL 2500334 by Dan Oconnor in Main branch]
2015-04-02 16:31:18 -04:00
Mike Fricker
114458bf0f Clang warning fixes: Fixed missing 'override' specifiers
- Also removed some unreferenced functions that adding 'override' revealed

PR #1002 -- Thank you, Omar007!

[CL 2498415 by Mike Fricker in Main branch]
2015-04-01 07:20:55 -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
Mark Satterthwaite
608acb6e7c Fix non-unity builds.
#codereview michael.trepka

[CL 2493613 by Mark Satterthwaite in Main branch]
2015-03-27 08:10:31 -04:00
Mark Satterthwaite
9d690116a6 Further optimisations for ShaderCache.
- Several GetTypeHash would produce only very narrow hash distributions, so these have been modified.
- FShaderDrawKey::GetTypeHash was particularly slow (around 4% of sampled time in Mac UT in Instruments) almost all in MemCrc32, so this has been replaced with a much simpler hash routine to bring it down to ~1% sampled time.
- FShaderDrawKey::operator== comparison order changed to try and fail earlier by testing from most-to-least varying attributes.
- Changed the way sampler-state & texture look-up works to avoid unnecessary map lookup.
#codereview michael.trepka

[CL 2493570 by Mark Satterthwaite in Main branch]
2015-03-27 07:20:23 -04:00
Mark Satterthwaite
9fe63a4308 In the shader-cache precompute the object hashes wherever possible to reduce the time spent searching maps, serialising the hashes to boot. Increments the current cache format version.
#codereview michael.trepka

[CL 2493555 by Mark Satterthwaite in Main branch]
2015-03-27 07:00:56 -04:00
Mark Satterthwaite
1f39e8f541 Fix a bug in early submission of compute shaders in the ShaderCache not using the correct hash.
#codereview michael.trepka, dmitry.rekman

[CL 2493544 by Mark Satterthwaite in Main branch]
2015-03-27 06:52:22 -04:00
Mark Satterthwaite
1e3b08f7f7 Disable the ShaderCache's draw-state logging by default in all circumstances since it is currently a significant performance impact and not all project use Shipping builds for release.
#codereview michael.trepka, dmitry.rekman

[CL 2493527 by Mark Satterthwaite in Main branch]
2015-03-27 06:31:34 -04:00
Mark Satterthwaite
835e8be727 Prevent the shader-cache from instantiating incompatible shader resources & crashing the RHI, requires exposing the existing ArePlatformsCompatible function from FShaderResource.
#codereview michael.trepka, dmitry.rekman

[CL 2493508 by Mark Satterthwaite in Main branch]
2015-03-27 06:12:37 -04:00
Rolando Caloca
cac9644426 UE4 - Get more info out of not reproducible crash (UE-11434)
[CL 2486684 by Rolando Caloca in Main branch]
2015-03-20 16:11:01 -04:00
Rolando Caloca
5063a906c8 UE4 - UE-12059 - Improve editor startup time
#codereview milo.yip

[CL 2485451 by Rolando Caloca in Main branch]
2015-03-19 19:11:09 -04:00
Daniel Lamb
e8558c8a9d Fixed sorting issue with vertex factory when serializing. Previously did not consider strings with different lengths different.
#codereview Peter.Sauerbrei, Josh.Adams

[CL 2471387 by Daniel Lamb in Main branch]
2015-03-06 13:31:04 -05:00