Commit Graph

44 Commits

Author SHA1 Message Date
tiago costa
32c29a6efa Use FMath::RoundUpToPowerOfTwo64 in FRDGScatterUploadBuffer::Init
- the 32 bit version could return 0 when inputs caused an overflow which caused a bad result due to the usage of FMath::Min afterwards.

#jira UE-185981
#rb Ola.Olsson
#preflight 646f6feac34463d6e84723b2

[CL 25621463 by tiago costa in ue5-main branch]
2023-05-25 10:57:33 -04:00
jamie hayes
30df0b799f More GPU Scene data code clean-up:
- Move primitive data stride to SceneDefinitions header so we don't have to change it in 3 places in code.
- Move FPrimitiveSceneShaderData to its own header to (eventually) eliminate dependencies that adversely affect compile time.
- Deprecate scatter upload buffer support for texture targets and prepare to clean up hacks that were previously done for the sake of GPU Scene that are no longer needed.

#rb ola.olsson
#preflight 644fe4750e33f2d51d787e71

[CL 25285293 by jamie hayes in ue5-main branch]
2023-05-01 12:39:32 -04:00
Ola Olsson
d2ca54a061 Extend support for persistent buffer management to structured buffers of element size other than float4 & add utilities to manage typed persistent structured buffers.
- also added a hook to provide a execute-time callback for indirect compute shader passes (similar to what the group count callback facilitates for direct dispatches).

#rb rune.stubbe
#preflight 643fa5fa8d0bcde49c3810ef

[CL 25102066 by Ola Olsson in ue5-main branch]
2023-04-19 04:53:37 -04:00
zhikang shao
1a09ceb080 ResizeStructuredBufferSOAIfNeeded() - Fixed string formatting, previously tried to print uints using %s
#preflight 643e7059db681113a4e2e2ce

[CL 25083700 by zhikang shao in ue5-main branch]
2023-04-18 07:14:47 -04:00
Wei Liu
298d3ebdbe Fix GPUScene uploader size limit check.
#jira none

#rb Dmitriy.Dyomin
#preflight 64225cd9973e609670d68857

[CL 24814549 by Wei Liu in ue5-main branch]
2023-03-27 23:25:48 -04:00
christopher waters
1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00
christopher waters
6e30ddb01e Dependency cleanup around DataDrivenShaderPlatformInfo and a few other headers.
#preflight 63921e6a67018b14b5925197

[CL 23454104 by christopher waters in ue5-main branch]
2022-12-08 15:35:35 -05:00
zach bethel
f1e1522f88 Offload GPU scene uploads to an async task.
#preflight 6320e00e8838676d100595ed

[CL 21997767 by zach bethel in ue5-main branch]
2022-09-13 21:47:56 -04:00
brian white
3c09ace274 Deprecate RHISupportsComputeShaders()
#jira UE-107293
#rb Stu.Mckenna Chris.Waters
#preflight https://horde.devtools.epicgames.com/job/6318a06e967ffc68fb919bae

[CL 21850273 by brian white in ue5-main branch]
2022-09-07 10:18:52 -04:00
zach bethel
1a6dbc061d Deprecated FRDGBufferDesc::EUnderlyingType
#preflight 62756de8d8373707f22a6144
#rb christopher.waters

[CL 20082899 by zach bethel in ue5-main branch]
2022-05-06 15:44:23 -04:00
zach bethel
2c9665b07f Added ResizeStructuredBufferSAOIfNeeded for GPU scene buffer refactor.
#preflight 627065c8592316675c2dc132

[CL 20018209 by zach bethel in ue5-main branch]
2022-05-02 19:28:19 -04:00
zach bethel
8016d5890e Added RDG versions of UnifiedBuffer utilities.
- TRefCountPtr<FRDGPooledBuffer> replaces FRW{Structured, ByteAddress}Buffer.
 - Resize{Structured, ByteAddress}BufferIfNeeded replaces ResizeResourceIfNeeded.
 - FRDGScatterUploadBuffer replaces FScatterUploadBuffer.

#preflight 6266c0d3e73e2573160aac00

[CL 19904054 by zach bethel in ue5-main branch]
2022-04-25 12:25:24 -04:00
dmitriy dyomin
6cb305181f Fixed: Enabling auto-instancing crashes on Mali devices with more than 2000 mesh instances in the scene
#jira UE-146619
#rb wei.liu
#preflight 623811eb791d231e02315237
#lockdown Jack.Porter

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19845790 in //UE5/Release-5.0/... via CL 19846123
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19846532 by dmitriy dyomin in ue5-main branch]
2022-04-21 06:46:12 -04:00
christopher waters
f12afe6c73 Deprecating RHICreateTexture2DArray, RHICreateTexture3D, RHICreateTextureCube, RHICreateTextureCubeArray.
Converted a few additional RHICreateTexture2D calls to RHICreateTexture.
Adding a few more FRHITextureCreateDesc::CreateXXX variants to quickly specify extents and formats.
Merging FTextureRWBuffer2D and FTextureRWBuffer3D into a single class FTextureRWBuffer and deprecated the old ones.

#jira none
#rb luke.thatcher
#preflight 62448deb927e60e3415508e5

[CL 19560161 by christopher waters in ue5-main branch]
2022-03-30 13:36:17 -04:00
jason hoerner
5f20bd8872 MGPU: Fix for light map artifacts when reloading lighting following a bake. Need to unbind SRVs used for scatter upload buffers, as we sometimes reuse the scatter upload buffers multiple times in a frame, and modifying them when they were bound can cause them to fail to update in the driver. Strangely, this was only occurring on the second GPU... I also added GPU mask blocks in a couple GPU scene update functions, for good measure.
The bound SRV issue could cause artifacts elsewhere in similar situations, but I didn't want to add perf overhead or complexity checking for this case everywhere, and decided to do a spot fix.  I didn't notice any other obvious cases where we have persistent buffers written to multiple times in a frame, like is done for the scatter upload buffers.  Still, it remains something to be alert for in case there are future rendering bugs.

#jira UE-143952
#rnx
#rb kenzo.terelst christopher.waters
#lockdown mihnea.balta
#preflight 6227ef770d5a90e98ea5f87d

#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 19322316 in //UE5/Release-5.0/... via CL 19324110
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19348075 by jason hoerner in ue5-main branch]
2022-03-10 21:53:39 -05:00
andrew davidson
0715ebc996 Type truncation fixes - Renderer
#rb arne.schober
#preflight 61d85ab0932a02483ce13e7d

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18544411 in //UE5/Release-5.0/... via CL 18544434
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18544466 by andrew davidson in ue5-release-engine-test branch]
2022-01-07 10:39:08 -05:00
jon nabozny
5fd91e8942 Working around D3D11 hitches caused by unpaged memory returned from Map. The workaround is to have UnifiedBuffer create brand new resources instead of updating existing ones.
#rb ola.olsson, kenzo.terelst, chris.bunner, ben.woodhouse
#preflight 619d019e47752856c967e8e9

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18272226 via CL 18272299 via CL 18272307 via CL 18272369 via CL 18272376 via CL 18273256 via CL 18277581 via CL 18373265 via CL 18373289
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18373442 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 16:21:10 -05:00
jon nabozny
a082ab7c7f Refactor GPU-Scene upload to be parallel, results in about 3x speed improvement (e.g., ~15ms -> ~3ms for bad cases).
#rb brian.karis,kenzo.terelst
#preflight 616960bb88abaf0001180785
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 17828369 via CL 18002863 via CL 18368827 via CL 18368831
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18368832 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 10:44:54 -05:00
christopher waters
39461bb256 Working around D3D11 hitches caused by unpaged memory returned from Map. The workaround is to have UnifiedBuffer create brand new resources instead of updating existing ones.
#rb ola.olsson, kenzo.terelst, chris.bunner, ben.woodhouse
#preflight 619d019e47752856c967e8e9

#ROBOMERGE-OWNER: christopher.waters
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18272226 via CL 18272299 via CL 18272307 via CL 18272369 via CL 18272376 via CL 18273256 via CL 18273336
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18273379 by christopher waters in ue5-release-engine-test branch]
2021-11-23 14:18:14 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
rune stubbe
f92ae9ba98 FScatterUploadBuffer::Init now respects GetMaxBufferDimension()
Power of two rounding to mitigate fragmentation now happens in bytes, instead of elements, so we get fewer unique buffer sizes.
#rb ola.olsson
#preflight 613f61e53bbb4800011187f1

#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 17493448 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17493511 by rune stubbe in ue5-release-engine-test branch]
2021-09-13 12:57:44 -04:00
tiago costa
f106c46dd2 Support FRWBuffer scattered updates.
- Modified MemsetResource and MemcpyResource to take number of elements instead of number of bytes as input, since FRWBuffer can use different formats.

#rb Yuriy.ODonnell
#jira UE-120168
#preflight 612f98feb6b29c00013fbb13

#ROBOMERGE-SOURCE: CL 17394373 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17394380 by tiago costa in ue5-release-engine-test branch]
2021-09-01 19:20:47 -04:00
tiago costa
3a4ada8f0f Cleanup UnifiedBuffer/ByteBuffer:
- Unified FMemcpyCS and FScatterCopyCS to handle both buffers and textures.
- Simplified FByteBufferShader::FPermutationDomain.

#preflight 610916165938f90001f6af12
#rb Florin.Pascu

#ROBOMERGE-SOURCE: CL 17028922 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v845-17028103)

[CL 17028926 by tiago costa in ue5-release-engine-test branch]
2021-08-03 07:56:47 -04:00
christopher waters
e474599a48 EBufferUsageFlags as enum class.
#rb will.damon, rolando.caloca
#preflight 610179041e63730001feb1eb
#preflight 6101b0d5b4288d0001b61c32

#ROBOMERGE-OWNER: christopher.waters
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 16986666 via CL 16987824
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16987849 by christopher waters in ue5-release-engine-test branch]
2021-07-28 17:19:36 -04:00
graham wihlidal
f602dcf242 Big cleanup/refactor of InstanceData* (renamed to InstanceSceneData* to match many other places already calling it that, and to disambiguate upcoming changes that add another instance data buffer to GPU Scene for arbitrary data payloads). This change also removes the virtuals on FPrimitiveSceneProxy for the instance list along with lots of copy paste code for all the derived types, and instead makes it a built-in feature of the base proxy (since nearly everything supports GPU Scene instancing now).
#rb ola.olsson
[FYI] brian.karis
#preflight 60c4d5c586ce760001377f2a

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16660135 via CL 16660883
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v834-16658389)

[CL 16660909 by graham wihlidal in ue5-release-engine-test branch]
2021-06-14 13:43:26 -04:00