#jira UE-228298
#rn Fixed Substrate crash on MAC when opening material editor.
#tests Tested PC editor, dx11, dx12 and ps4, with and without Substrate. And on MAC by Carl Lloyd.
#rb carl.lloyd, Kevin.Ortegren
#fyi charles.derousiers
[CL 38210001 by Sebastien Hillaire in 5.5 branch]
RDG async tasks reference GPU profiler queries. These queries are deleted in EndFrameRenderThread, but async tasks can run after that, resulting in use-after-free crashes.
#jira UE-228852 FORT-812395
#rnx
#rb Luke.Thatcher
[CL 37610608 by mihnea balta in 5.5 branch]
- Some resource destructors were calling FRHICommandListImmediate::Get(), which will break since RHI resources are destroyed by the RHI thread.
- Acquire the GL context on the game thread when the rendering thread is stopped. The render thread is destroyed before RHIExit is called, which can lead to the game thread attempting to destroy GL resources while not owning the context.
- Add some extra cleanup to the legacy GPU profiler. Some resources were still alive.
#jira UE-226165
#rb Allan.Bentham, mihnea.balta
[CL 37116288 by luke thatcher in 5.5 branch]
24937677 introduced a regression, the UYVY to RGBA conversion used to be done by the UYVYConvertPS shader, which interpolates the chroma values using a bilinear sampler.
The change moved the UYVY conversion code to use YUVv216ConvertPS, which uses a point sampler by default.
This fix introduces an option (UseBilinearSampler) that dictates whether to use a bilinear sampler for the chroma values of the converter.
#jira UE-212498
#rb eric.renaudhoude
[CL 36905604 by jeremie roy in 5.5 branch]
The (optional) display mastering color space (usually used as a hints for the display devices) was incorrectly used as the sample source color space. Since we are linearizing to the working color space by default, display HDR metadata can be ignored. We also take this opportunity to cleanup the media sample color space interface, especially now that FColorSpace is in engine core. Furthermore, tonemapping is applied by on Electra HDR videos so that their (unlit or composited) default appearance resembles other media players.
This change also introduces two news console variables:
* Electra.HDR.WhiteLevel
* Electra.HDR.ToneMapMethod
#jira UE-221519
#rb dietmar.hauser, Jens.Petersam, Ruslan.Idrisov
[CL 36765643 by eric renaudhoude in 5.5 branch]
The glints code causes unrolling issue. Glints are normally disabled throught the platform settings, but when running with -featureleveles31, these settings are not taken into account. This CL disabled explicitely glints on platform lower than SM5.
#rb Sebastien.Hillaire
#jira UE-226153
[CL 36765472 by charles derousiers in 5.5 branch]
- Only the additional RHI thread fences are inserted by FFrameEndSync::Sync.
- Since we are still fencing the game and render threads to be no more than 1 frame apart, the original FPendingCleanupObjects mechanism should still work.
Original CL desc:
Fix frame sync issues
- The engine still uses legacy syncing behaviour where the game thread syncs with the render thread. Renderer refactors have removed most of the RHI thread flushes that happened per frame, which were the only thing synchronizing the game/render threads with the RHI thread. Without these flushes, and when occlusion queries are disabled, the game thread can run ahead of the RHI thread by several hundred frames, since it is now entirely unsynchronized.
- This fix changes mode 0 of "r.GTSyncType" to sync with the N-2 RHI thread frame when the RHI thread is active, rather than the N-1 render thread frame. The game thread is now always synchronized with the RHI thread to prevent it running ahead.
- Mode 1 of "r.GTSyncType" now works even when vsync is disabled, and syncs the game thread with the N-1 RHI thread frame (same behaviour as before).
#jira UE-223692
#rb zach.bethel
[CL 36762632 by luke thatcher in 5.5 branch]
- This will reintroduce UE-223692 but will prevent FORT-796488.
- A proper fix for UE-223692 needs further investigation.
#rb zach.bethel
[CL 36761792 by luke thatcher in 5.5 branch]
Force SM6 for preview VK SM5, Mac SM5
Enable Lumen Support for Preview VK SM5, Mac SM5
Modifying FeatureLevelSwitch to respect the parent ShaderPlatform FeatureLevel and not the one set by preview in order to have consistent material logic with the Shader Platform we are trying to preview
#rb Jack.Porter, jeannoe.morissette
[CL 36758806 by florin pascu in 5.5 branch]
- Various legacy game thread code assumes the render thread will never be more than one frame behind. The original change in 36468180 switched from syncing the GT with the RT, to syncing the GT with the RHIT. That left the render thread "floating" in the center of the pipeline, and led to cases where resources are deleted too soon.
- New approach is to always sync with the GT with the N-1 RT frame, so the GT is never too far ahead of the RT. This maintains compatibility with the legacy GT code paths. In addition to the GT->RT sync, we also sync with the RHIT to prevent the engine running ahead, which was the original bug that 36468180 was fixing.
- "r.GTSyncType" mode 0 now allows for 1 frame of GT->RT overlap, and 2 frames of GT->RHIT overlap.
- For debugging purposes, "r.GTSyncType" can also be made negative, which increases the number of GT->RHIT overlap frames, e.g. "r.GTSyncType -3" gives 5 frames of GT->RHIT overlap. While this is not overly useful in a shipped title, it can be used to prove the correctness of the rendering pipeline.
- Merged the FDeferredCleanupInterface / FPendingCleanupObjects processing into the FFrameEndSync code path, plus made FFrameEndSync a static singleton. This allows us to manage the N frames of overlap between the GT and RHIT in a central place, and correctly cleanup deferred resources when the RT fences have passed.
In future, we will need to revisit this as part of the frame pacing initiative. Game thread code should be written to not require render thread fences for correctness / threadsafety.
#jira UE-223692
#rb zach.bethel
[CL 36758377 by luke thatcher in 5.5 branch]
resubmit with following fixes:
- static analysis error which caught an >=0 check on a uint64 which should have been >0
- fix for an inverted guard on multiprocess cook sending bytecode to director (was only sending code across if empty instead of non-empty)
- fix for uninitialized padding in the FShaderCodeResource::FHeader struct causing nondeterministic puts
- fix for incorrect size passed to job cache hashing on receiving buffers from DDC
#rb Devin.Doucette, Laura.Hermanns, Zousar.Shaker
#lockdown Marc.Audy
[CL 36754792 by dan elksnitis in 5.5 branch]
Save up to 16MB on some platforms.
#rb daniele.vettorel, danny.couture, Kenzo.Terelst
#tests 66d8b4154a47dde1dd226334
#ushell-cherrypick of 36036431 by serge.bernier (first of 2 submits)
[CL 36747837 by serge bernier in 5.5 branch]