Commit Graph

906 Commits

Author SHA1 Message Date
zach bethel
058bdd7d2f Implemented support for parallel buffer creation and lock / unlock.
- Refactored relevant FDynamicRHI APIs to take an FRHICommandListBase reference. Platforms which require operations deferred to the RHI thread will enqueue commands into the command list.
 - Hardened platform implementations to use locks where needed.
 - Added unit tests to stress test creating and locking many buffers in parallel.

#preflight 62a2855c54169bd8aa114d29
#rb christopher.waters, jeannoe.morissette, luke.thatcher, will.damon, kenzo.terelst

[CL 20659113 by zach bethel in ue5-main branch]
2022-06-14 17:59:07 -04:00
zach bethel
fdddd4608a Fix for non-pooled uniform buffers being added to the pool on destruction.
#jira UE-156240
#preflight 62a3a84c70680d6143e750a5
#rb christopher.waters

[CL 20602245 by zach bethel in ue5-main branch]
2022-06-10 16:50:30 -04:00
jimmy smith
1ce2fc371e Fix for rare assert seen only in the wild
#jira UE-155860
#rb aaron.mcleran
#preflight 62a279d22e1cc34f11b17e95

[CL 20586726 by jimmy smith in ue5-main branch]
2022-06-09 19:02:05 -04:00
zach harris
20aea75af3 Fixing incorrect DirectX adapter code that assumes only an Intel GPU can be integrated and cleaning up related dead code.
#ROBOMERGE-AUTHOR: zach.harris
#ROBOMERGE-SOURCE: CL 20582248 via CL 20582809 via CL 20583000
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20585546 by zach harris in ue5-main branch]
2022-06-09 17:59:20 -04:00
zach bethel
7e09c4f029 Make RHICreateUniformBuffer thread safe.
#preflight 6296def1ed7762ca42d44c7b
#rb yuriy.odonnell, jeannoe.morissette

[CL 20487525 by zach bethel in ue5-main branch]
2022-06-03 11:53:52 -04:00
zach bethel
537e37ab88 Minor clean up of static uniform buffer handling.
#preflight 6298e9e05143e4aacd861a48

[CL 20471649 by zach bethel in ue5-main branch]
2022-06-02 13:02:11 -04:00
James Studdart
320b5e409d Fix a texture array size comparison error that caused GPU crashes and/or corrupt textures.
#preflight 62944a3f48086c40b74b719d
#jira UE-151491
#fyi zach.bethel, andrew.firth
#rb trivial

[CL 20428626 by James Studdart in ue5-main branch]
2022-05-30 01:13:50 -04:00
zach bethel
92d58d2338 Restored FTextureRenderTargetCubeResource to use a staging 2D texture as its render target. Replaced the render target clears with copies from the staging texture which mirrors the old implementation with CopyToResolveTarget. Also fixed another regression in CopyTexture that wasn't part of the unit test.
#rb mihnea.balta, jason.hoerner
#preflight 628f96ab74630984fd3f45d5
#jira UE-151491

[CL 20379819 by zach bethel in ue5-main branch]
2022-05-26 11:24:29 -04:00
benjamin rouveyrol
7a21ea463f hdr multi window/display support
This improves how the editor deals with displays that have different capabilities (some with HDR, others without).
Centralize where the CVars are accessed
Have the swapchain created in SDR when shown on a SDR display
Make sure color gamut matches the one supported by the platform/swapchain.
Allow Movie scene capture to override the gamut/output format to keep existing behaviour (MovieSceneCapture relies on swapchain data)

#preflight 628baef5183c1e13462a504d
#jira UE-150952
#rb luke.thatcher

[CL 20347067 by benjamin rouveyrol in ue5-main branch]
2022-05-24 09:04:39 -04:00
zach bethel
29d075c4c8 Deprecated GRHISupportsResolveCubemapFaces.
#preflight 62880985192a338d864ba496

[CL 20304268 by zach bethel in ue5-main branch]
2022-05-20 18:14:00 -04:00
Sebastien Hillaire
ff9a2e30f6 Strata - PDO now relies on in shader depth test to avoid UAV write or material data when the depth buffer does not match.
(we cannot rely on LateZ to cull UAV writes)

#rb luke.thatcher
#preflight 628797c78828ea88c85302dc
#fyi charles.derousiers

[CL 20301945 by Sebastien Hillaire in ue5-main branch]
2022-05-20 16:08:18 -04:00
zach bethel
acc746696b Implemented dedicated MSAA resolve code path for platforms, bypassing RHICopyToResolveTarget.
#preflight 6286ba2015019f64776e4b3e
#rb christopher.waters

[CL 20298040 by zach bethel in ue5-main branch]
2022-05-20 13:24:58 -04:00
zach bethel
f6311d1011 Cleaned up FRHIRenderPassInfo cruft and forwarded resolve operations through a common RHI core method.
#preflight 62842b5982530182724612f6

[CL 20262457 by zach bethel in ue5-main branch]
2022-05-18 12:29:26 -04:00
David Harvey
9cc4146fbc move HoloLens runtime source to platform extension folder.
#jira UE-149794
#rnx
#rb Jeff.Fisher
#preflight 6284cd49614041edb76395dc

[CL 20258963 by David Harvey in ue5-main branch]
2022-05-18 06:59:59 -04:00
christopher waters
1e01768e33 Bindless shader parameters
- Adding support for bindless resources/samplers. The loose resources have to be wrapped in a macro that generates an index and proxy resource when bindless is enabled. Reflection has to parse these differently from other resources since they're parsed as uint parameters. The runtime also has to bind these differently since they end up needing to find their real resource in the binding data and then update a constant buffer.
- To assist in conversions, the shader compiler will detect if a shader is compiled with both bindless and non-bindless resources/samplers and will emit errors if that is the case.
- Adding support for bindless Uniform Buffer resources/samplers. Because Uniform Buffers aren't per-shader, they'll always update their constants with the bindless indices of their resources.
- Adding more flags to FShaderCodePackedResourceCounts required changing all the array initializations to individual parameters since not all the new flags are used everywhere.
- No shaders have been configured to support bindless resources/samplers. Yet.

#jira UE-139616
#rb zach.bethel, arciel.rekman
#preflight 6282b8ec44349a6581a21a39

[CL 20250348 by christopher waters in ue5-main branch]
2022-05-17 16:30:48 -04:00
zach bethel
379ccdd136 Added RHICopyTexture unit tests and fixed up inconsistencies / bugs.
- A zero size now uses the source texture size adjusted to the source mip.
 - Source / dest offsets and size now properly scale with each successive mip level.
 - Fixed bug in reflection capture GPU copy due to inconsistent behavior.
 - Deprecated GRHISupportsCopyToTextureMultipleMips which is now always true.

#rb brian.white
#preflight 627fc1af3339713c4a9800da

[CL 20224824 by zach bethel in ue5-main branch]
2022-05-16 11:11:35 -04:00
christopher waters
3b18bce7f0 Fixing initial state issues after changing the FRHITextureCreateDesc creation.
#jira UE-151907
#rb mihnea.balta
#preflight 627e751b7c26e2477354c142

[CL 20182229 by christopher waters in ue5-main branch]
2022-05-13 11:45:30 -04:00
christopher waters
9ef9e2bf50 Removing the long-form create functions and constructors from FRHITextureCreateDesc in favor of the shorter versions.
#jira none
#rb luke.thatcher
#preflight 627d7c70a82f3adab8b3524e

[CL 20172685 by christopher waters in ue5-main branch]
2022-05-12 17:59:39 -04:00
benjamin rouveyrol
cef7b815be d3d11 editor HDR support
Converge the way we do HDR in editor for both d3d11 and d3d12. This assumes that IDXGIOutput6 is available, but AFAICT, Editor.HDRSupport / FD3D11Viewport::CheckHDRMonitorStatus was requiring it anyway (https://p4-swarm.epicgames.net/changes/8174116 - WindowsD3D11Viewport.cpp#20 FD3D11Viewport::CheckHDRMonitorStatus).
Notes for future self: Editor was initially done with HDR10 (see FD3D11Viewport constructor where it forces swapchain format to DXGI_FORMAT_R10G10B10A2_UNORM). However, it got de-hardcoded with 17369147 which was a good idea, but unfortunately GRHIHDRDisplayOutputFormat is left to the default value on d3d11, which is PF_FloatRGBA.
CheckColorSpaceSupport would now fail, not returning DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT (PF_FloatRGBA only supports scRGB, not DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020) and we would not setup the swapchain colorspace properly.
Since it looks like DXGI 1.6 was always needed for editor, I'm changing the code to be the same between d3d11 and d3d12. Both editors now use scRGB for HDR, which is consistent with ChooseHDRDeviceAndColorGamut

#jira UE-151184
#preflight 6273eaba03269096abc98cbb
#rb christopher.waters

[CL 20139224 by benjamin rouveyrol in ue5-main branch]
2022-05-11 10:13:28 -04:00
zach bethel
8753b64663 Fixed inconsistencies between RHI's with CopyTexture. Replaced implicit check for equality with an assert at the command list.
#jira UE-139646
#rb luke.thatcher
#preflight 627a99cb68422389764263b5

[CL 20129376 by zach bethel in ue5-main branch]
2022-05-10 16:53:36 -04:00
christopher waters
7f7df46ef9 Changing uses of RHIGetNativeDevice and GetNativeResource to use the per-RHI interfaces. XR Edition.
#jira none
#rb robert.srinivasiah
#preflight 6275775bbf6585e3ee7040c5

[CL 20084067 by christopher waters in ue5-main branch]
2022-05-06 16:25:38 -04:00
benjamin rouveyrol
e096addb75 undo changes to d3d11 viewport that were not supposed to be submitted
#preflight 6273cf965b05fb4f6017c0a2
#rb john.huelin

[CL 20056995 by benjamin rouveyrol in ue5-main branch]
2022-05-05 09:40:57 -04:00
benjamin rouveyrol
731de80428 Have r.HDR.Display.ColorGamut enum values defined in a single place and replaced hardcoded numbers by enum values.
#jira UE-148995
#preflight 62716752e16e280be614c38b
#rb eric.renaudhoude jeff.newquist

[CL 20056544 by benjamin rouveyrol in ue5-main branch]
2022-05-05 08:49:19 -04:00
HSeo
d6b14c30eb PR #9059: Add TexCreate_Shared to FD3D11Texture3D.
(Contributed by HSeo)

#jira UE-148581
#rb none
#preflight 6272db5f365de864c4c0fae8

[CL 20048613 by HSeo in ue5-main branch]
2022-05-04 16:33:09 -04:00
Jon Olick
7ab430f96e Bink: merge from 4.27Plus. Bink now uses RHI backend.
#preflight

[CL 19947421 by Jon Olick in ue5-main branch]
2022-04-27 17:28:31 -04:00