Commit Graph

962 Commits

Author SHA1 Message Date
zach bethel
a6c304ffb5 RDG validation fix for RDG_{TEXTURE, BUFFER}_ACCESS_ARRAY.
#rb trivial

[CL 16194686 by zach bethel in ue5-main branch]
2021-05-04 11:53:08 -04:00
Ben Ingram
8037278b3f Make sure we're always able to map the lowest resolution VT mips, otherwise the system will continue to try (and fail) to do this every frame, costing lots of perf
- Need to include LocalMipBias, otherwise may not be any data at AllocatedVT's MaxLevel for sparse UDIMs
- Check for overflow when adding lock requests, keep overflow requests around to try again next frame
#rb none
#jira none

[CL 16194638 by Ben Ingram in ue5-main branch]
2021-05-04 11:48:09 -04:00
zach bethel
654c154bf3 Skip RDG trace work when RDG tracing is disabled.
#rb trivial

[CL 16194551 by zach bethel in ue5-main branch]
2021-05-04 11:41:11 -04:00
Ben Ingram
916aa06a15 Remove VT UDIM page table wrapping
- It's not possible to make wrapping work correctly for lower mip levels, depending on the sizes of the VTs in the stack
- Now UDIMs that are smaller than stack dimensions will just map the lowest resolution mip to out-of-bounds addresses
- Entire stack will continue to wrap, based on the stack dimensions
- End result is UDIM wrapping should no longer by relied on
#rb none
#jira none

[CL 16184868 by Ben Ingram in ue5-main branch]
2021-05-03 12:21:08 -04:00
Charles deRousiers
535d1d95c1 Add render graph support for default textures and default buffers with custom format and custom default value.
#rb zach.bethel, sebastien.hillaire
#jira none

[CL 16183014 by Charles deRousiers in ue5-main branch]
2021-05-03 06:44:33 -04:00
Krzysztof Narkowicz
e14668b6f9 Lumen - create BC surfaces with TexCreate_UAV if UAVAliasing is supported
#fyi Luke Thatcher

[CL 16170274 by Krzysztof Narkowicz in ue5-main branch]
2021-04-30 13:21:16 -04:00
Krzysztof Narkowicz
e005f9cfca RenderGraph - allow to create an aliased UAV into a BC surface
#rb Zachary.Bethel

[CL 16168670 by Krzysztof Narkowicz in ue5-main branch]
2021-04-30 11:28:17 -04:00
Yuriy ODonnell
aa9e6a0c41 Added a basic implementation of assert in shaders for D3D12. Requires SM6 support which can be enabled through r.D3D12.AllowShaderModel6=1.
Example usage in a shader:

PLATFORM_ASSERT4(GroupThread > 4321, 0xDF7DC903, GroupThread, GroupIndex, GroupBase, asuint(123.456f));

Example GPU crash report output:

LogD3D12RHI: Error: [GPUBreadCrumb] Last tracked GPU operations:
LogD3D12RHI: Error: [GPUBreadCrumb]	3D Queue 0 - Begin: Frame 348 - Scene - ReflectionIndirect - RayTracingReflections - RayTracingDeferredReflectionsShade 957x466
LogD3D12RHI: Error: [GPUBreadCrumb]	Shader assertion failed! ID: 0xDF7DC903
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload  [int32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload [uint32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload    [hex]: 0x000001A0 0x0000002A 0x0002A000 0x42F6E979
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload  [float]: 0.000000 0.000000 0.000000 123.456001

This works through automatic diagnostic buffer binding in D3D12 RHI, which becomes available in *any* shader as a UAV.
Opens the door for arbitrary human-readable message output from any shader in the future.

PLATFORM_ASSERT macro is always enabled and available on supported platforms. It is intended to be a low-level mechanism for a higher-level check() that would be controlled via CVars.

#rb Christopher.Waters

[CL 16167404 by Yuriy ODonnell in ue5-main branch]
2021-04-30 08:37:35 -04:00
aurel cordonnier
50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00
Krzysztof Narkowicz
f94472aea1 Lumen surface cache compression
* First all cards are allocated to a temporary atlas of fixed size set by r.LumenScene.CardCaptureAtlasFactor
* After cards are captured into temporary atlas, they are compressed into final BC compressed atlas. Compression can be disabled with r.LumenScene.SurfaceCache.Compress
* Atlas clears were also converted to support clearing compressed surfaces
* Atlas capture operations work on uploaded rect list, instead of a GPU generated card list
* Renamed r.LumenSurfaceCache.* to r.LumenScene.SurfaceCache.*
* Renamed LumenSceneLighting.usf to LumenSurfaceCache.usf
* Renamed LumenScenePrefilter.cpp to LumenSurfaceCache.cpp

Cuts down VRAM memory usage by 160mb
Compression performance on console: ~0.18ms for 1M texels (~0.9ms with UAV aliasing path, which is currently disabled due to missing pieces in RHI)

[CL 16160800 by Krzysztof Narkowicz in ue5-main branch]
2021-04-29 15:30:04 -04:00
dmytro vovk
eab8b64ef1 Removed Scene Software Occlusion
#jira none
#rb Dmitriy.Dyomin

[CL 16158927 by dmytro vovk in ue5-main branch]
2021-04-29 13:14:48 -04:00
Dmitriy Dyomin
89905e5412 Disabling SDF shadowing on D3D mobile for now as it adds one more sampler
#rb none
#jira UE-114009

[CL 16153466 by Dmitriy Dyomin in ue5-main branch]
2021-04-29 00:30:36 -04:00
Jeremy Moore
3b08896fef #jira UE-110652
Force IsUsingDBuffers to return false on mobile.
UE5 decal code has already been modified so that material compilation and rendering will remain correct on both mobile and mobile deferred after this change.
#rb dmitriy.dyomin

[CL 16131444 by Jeremy Moore in ue5-main branch]
2021-04-27 15:36:19 -04:00
christopher waters
0eed080980 Restoring functionality that allowed platforms to override shader debug settings. Updating some inis to include the default values as examples of how to override them.
#rb graham.wihlidal
#preflight 60870c430bdfbc000170f5a4

[CL 16129544 by christopher waters in ue5-main branch]
2021-04-27 13:25:03 -04:00
Stu McKenna
ffa44d764d - Integrate and update CL 16013645 - Fix various Niagara data interfaces to work on mobile
- Ensure mobile scene textures are present for FXSystem to access

#rb jamie.hayes, rob.krajcarski
#jira FORT-259231

[CL 16128712 by Stu McKenna in ue5-main branch]
2021-04-27 11:56:51 -04:00
Jamie Dale
4afb7ce6bb Made EName an enum class to prevent implicit conversion to int
The following code would call the int overload rather than the name overload when passed an EName constant, which could easily lead to confusion and bugs:
    using FMyId = uint8;
    void DoThing(FName);
    void DoThing(FMyId);
    DoThing(NAME_Actor);

The change to use enum class requires that any code that actually deals with EName as an int (mostly internal name code and serialisation) be updated to explicitly cast, but prevents the implicit conversion that causes the issue above.

In order to preserve the NAME_X aliases that the old-style enum added to the global scope, new aliases have been added that point to the EName scoped versions. Unfortunately these can cause shadowing warnings if NAME_X is defined in the local scope, as the old-style enum used to allow that without shadowing, however there is no way to prevent this so we'll just need to fix any warnings that occur.

#rb Johan.Torp
#preflight 6087e06349a9840001414708

[CL 16126708 by Jamie Dale in ue5-main branch]
2021-04-27 10:11:18 -04:00
Jian Ru
e4b1ea48eb Join the last async compute pass to its first consumer pass instead of the graph epilogue
#rb zach.bethel

[CL 16118371 by Jian Ru in ue5-main branch]
2021-04-26 16:29:05 -04:00
zach bethel
b67b0d2dda Added FRHI{Texture, Buffer}ViewCache to clean up FRDGPooledX / FRHITransientX duplicate code. Added support for UAVs with a format.
#rb christopher.waters
#preflight 6086ee7c1046fb00018cec87

[CL 16116698 by zach bethel in ue5-main branch]
2021-04-26 14:12:08 -04:00
Jason Nadro
789defec99 Fix memory leak of shader code during shader compilation (during cooks, deployments, or editor). Depending on settings and project this can save a considerable amount. For example, this saved ~39GB on the test project I was cooking.
- FShaderMapResourceCode derives from FThreadSafeRefCountedObject which has a member that keeps track of the number of references to the object.  We were doing deep copies using the Copy Constructor of FShaderMapResourceCode which resulted in a member wise copy of the num refs.  This is not the behavior you'd expect.
- The offending line of code that caused the memory leak was in FShaderMapBase::AssignCopy:
    - Code = new FShaderMapResourceCode(*Source.Code);
- Like FRefCountBase I've deleted the copy constructor and assignment operator for FRefCountedObject and FThreadSafeRefCountedObject to catch issues at compile time where we are copying across NumRefs incorrectly.
- To fix the issue I've manually created copy constructors for FGPUProfilerEventNodeStats and FShaderMapResourceCode.

#rb Devin.Doucette, Dave.Jones, Arciel.Rekman, Ben.Ingram
#review-16115628 @Devin.Doucette, @Dave.Jones, @Arciel.Rekman, @Ben.Ingram
#jira UE-108598, UE-113736

[CL 16116577 by Jason Nadro in ue5-main branch]
2021-04-26 14:03:07 -04:00
zach bethel
953d21cec8 Transient allocator support for platform
#lockdown nick.whiting


#ROBOMERGE-SOURCE: CL 16106012 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16106022 by zach bethel in ue5-main branch]
2021-04-23 15:48:49 -04:00
zach bethel
47cf1f4458 Rewrite of RHI transient resource system.
- Views are cached on RHI transient resources; view renames are no longer necessary.
 - RHI Transient resources utilize a single cache per heap keyed off of the descriptor + offset. Resource caches and heaps are garbage collected.
 - CPU performance is effectively equivalent to the existing pooled resource method.
 - Added common RHI transient resource allocator implementation in RHI core; significantly reduces the amount of platform code.
 - Resource aliasing overlaps are tracked by the RHI and submitted through an acquire operation.
 - Fixed D3D12 implementation to support multi-GPU.
 - Removed condition that excluded small (<64k) buffers in the transient allocator.
 - RHI validation now checks that resource overlaps are valid; i.e. if an overlap occurs between resource A and B during an acquire of B, validation checks that A has been discarded.

#rb graham.wihlidal, luke.thatcher, kenzo.terelst

[CL 16076280 by zach bethel in ue5-main branch]
2021-04-21 13:03:28 -04:00
Guillaume Abadie
43ccc8111b Nukes USE_PREEXPOSURE
#rb uriel.doyon, jack.porter

[CL 16070774 by Guillaume Abadie in ue5-main branch]
2021-04-21 04:53:11 -04:00
christopher waters
83f70197d3 Tessellation Removal: Removing RHI Hull/Domain shader types and enums.
#rb lukas.hermanns
#jira UE-94564
#preflight 607f2e11eb4f050001d4655e

[CL 16066223 by christopher waters in ue5-main branch]
2021-04-20 17:00:25 -04:00
Jeremy Moore
47088020a3 Prepare code for removal of EDecalBlendMode.
Clean up logic for render stages.
Removed unneccessary GBufferNormal only target mode.
Remove volumetric decal.
#jira UE-100967
#rb none
#preflight 607e1f2129083200018fd8c4

[CL 16057700 by Jeremy Moore in ue5-main branch]
2021-04-19 21:37:52 -04:00
Steve Robb
490ff52780 Deprecation of TStaticArray's multi-element init constructor, to avoid confusion of something like TStaticArray<FVector4>(NoInit) and TStaticArray<FVector4>(InPlace, NoInit) producing very different codegen (worse in the original case).
#rb yuriy.odonnell
#jira none

[CL 16053261 by Steve Robb in ue5-main branch]
2021-04-19 14:34:13 -04:00