Commit Graph

100 Commits

Author SHA1 Message Date
jeremy moore
e17c769e22 Always sync locked VT tiles in Editor.
This waits correctly for DDC.
Fixes nightly render issues.
#rb jason.nadro
#preflight 61609ba898f25900019360d2
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17762847 via CL 17985640 via CL 18368077 via CL 18368129
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18368150 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 09:57:17 -05:00
jeremy moore
d0b252cf4f Don't start waiting on produce tasks if we know that there is nothing to wait for.
#rb ben.ingram
#preflight 615f6d0451b6340001dfb866
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17757034 via CL 17985565 via CL 18368058 via CL 18368117
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18368144 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 09:56:33 -05:00
jeremy moore
8754174a0d Fix VT page playback bias.
Was setting original LevelPlusOne instead of modified LevelPlusOne in the page id.
#rb ben.ingram
#preflight 615f29b0cec44a0001399a7b
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17752201 via CL 17985202 via CL 18368044 via CL 18368103
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18368139 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 09:55:50 -05:00
jeremy moore
a9b70f7b5d Don't assert on case where locked tile is invalid to produce.
This must be happening after the change to defer producing locked tiles.
Needs some further investigation to understand why it is happening, but this quick fix should unblock.
#rb ben.ingram
#preflight trivial to unblock
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17736595 via CL 17982017 via CL 18367163 via CL 18367181
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18367188 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 03:23:08 -05:00
jeremy moore
e66533b874 Add support for mip bias of prestream VT page requests.
This includes a fixed per platform component and a dynamic component that takes into account the current pool residency mip bias.
#rb ben.ingram
#preflight 615c8efd184ecf0001211c86
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17725859 via CL 17979595 via CL 18366901 via CL 18366958
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18366976 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 02:56:34 -05:00
jeremy moore
dae5645f4e Add r.VT.ProduceLockedTilesOnFlush to not sync when producing locked tiles.
#rb ben.ingram
#preflight 615c476d8c8edf00011b2a2a
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17720292 via CL 17979487 via CL 18366651 via CL 18366733
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18366795 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 02:44:17 -05:00
jeremy moore
b9285121e7 Added a CVar to disable VT page playback.
#rb ben.ingram
#preflight 61563a656ed55a0001763a45
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17684931 via CL 17967447 via CL 18366105 via CL 18366199
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18366306 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 01:39:18 -05:00
jeremy moore
877e51c5cc Add hash for allocated virtual textures that can persist across runs.
Use this as id for recording and playback of virtual texture feedback.
Flesh out API for recording and playback of collected ids.
#preflight 61530aa080eba00001a511b6
#rb ben.ingram
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17653384 via CL 17965453 via CL 18365635 via CL 18365739
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18365816 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 01:10:59 -05:00
jeremy moore
748c4023e1 Allow multiple physical pools to be created for the same virtual texture format.
Producers will be randomly distributed between physical pools.
The maximum physical pool tile size is set by r.VT.SplitPhysicalPoolSize.
Setting a size of 64 will force all pools to be divided so that their page tables fit in 16 bits.
This makes it possible to use large physical pools without doubling the cost of page table memory.
#rb none
[FYI] ben.ingram
#preflight 611a616a8ff5540001cf6575

#ROBOMERGE-SOURCE: CL 17175504 via CL 17175510
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17175517 by jeremy moore in ue5-release-engine-test branch]
2021-08-16 09:38:03 -04:00
jeremy moore
be05ec480b Disabled VT pool notifications by default.
Enable with r.VT.Residency.Notify
Default VT residency mip map on for default pools.
This is overridable per project and per pool.
#rb none
#preflight 61128bb272fe2c00013a846c

#ROBOMERGE-SOURCE: CL 17116695 via CL 17116736
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17116751 by jeremy moore in ue5-release-engine-test branch]
2021-08-10 10:51:03 -04:00
jeremy moore
e3b07e972d Add r.vt.DumpPoolUsage.
This outputs the physical tile footprint of each VT producer.
Useful for finding producers that are using up most of the physical cache.
#rb none
#preflight 6108b0b72b00280001195a54

#ROBOMERGE-SOURCE: CL 17025048 via CL 17025049
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v839-17012307)

[CL 17025051 by jeremy moore in ue5-release-engine-test branch]
2021-08-02 23:44:36 -04:00
jeremy moore
400aa717b0 Add stat scope for virtual texture finalize and page table update phases.
#rb none
#preflight 61083a1e4cd793000148efcb

#ROBOMERGE-SOURCE: CL 17019668 via CL 17019684
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v839-17012307)

[CL 17019696 by jeremy moore in ue5-release-engine-test branch]
2021-08-02 15:40:13 -04:00
jeremy moore
7124ab4a00 #jira UE-117953
#jira UE-109349
Add mip map bias for virtual texture sampling.
Respects the existing r.MiipMapLodBias CVar.
Also add residency tracking for each virtual texture physical pool.
If the pool has been created from a config with the bEnableResidencyMipMapBias flag set then a mip map lod bias is applied to bring the pool back within budget.
The residency mip map lod bias is applied globally (combined with the global mip map lod bias).
In future it could be good to apply the mip map lod bias per physical pool, but this will require tracking all physical pool combinations for each page table.
Physical pool residency tracking can be shown on screen with r.vt.residency.show CVar.
#rb ben.ingram

#ROBOMERGE-SOURCE: CL 16724483 via CL 16724487
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16724488 by jeremy moore in ue5-release-engine-test branch]
2021-06-20 18:47:26 -04:00
ben ingram
4474e52846 Also destroy pending AllocatedVTs when flushing destroyed VT resources
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 16313886 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16313900 by ben ingram in ue5-release-engine-test branch]
2021-05-13 11:53:48 -04:00
ben ingram
990b78cea7 Remove PRAGMA_DISABLE_OPTIMIZATION left in by mistake
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 16308786 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v800-16297934)

[CL 16308863 by ben ingram in ue5-release-engine-test branch]
2021-05-12 22:00:31 -04:00
ben ingram
439afdb8e9 Restore functionality to automatically map newly allocated VTs, but only for lowest resolution mip level
- This should be much faster than previous code which attempted to map all mip levels
- Need to ensure at least lowest resolution mip is mapped, in order to avoid rendering frames with garbage data mapped
- Add warning for AllocatedVTs that never manage to complete this mappings
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 16308484 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v800-16297934)

[CL 16308810 by ben ingram in ue5-release-engine-test branch]
2021-05-12 21:59:47 -04:00
Ben Ingram
bf28486030 Try to make it more obvious that allocated memory will be initialized, attempt to satisfy static analysis
#rb none
#jira none

[CL 16249374 by Ben Ingram in ue5-main branch]
2021-05-10 11:38:54 -04:00
Ben Ingram
de367642c7 AllocatedVTs that use private space are deleted immediately, rather than staying cached for some frames
#jira none
#rb jeremy.moore

[CL 16224868 by Ben Ingram in ue5-main branch]
2021-05-06 15:26:23 -04:00
Jeremy Moore
baf9af8803 Fix nullptr dereference.
#jira none
#rb trivial

[CL 16222882 by Jeremy Moore in ue5-main branch]
2021-05-06 12:54:31 -04:00
Ben Ingram
9468976c1d Don't try to map all resident pages to newly allocated VTs. Too slow, especially for large VTs
- Instead, keep VT cached for a few frames after they are deleted, this way they can be re-used if they're deleted/recreated due to state changes
- This should solve the problem of material changes causing pages to become unmapped for a few frames
#rb none
#jira none

[CL 16209506 by Ben Ingram in ue5-main branch]
2021-05-05 13:09:24 -04:00
Ben Ingram
fc2da0313a Add cvar to control number of frames VT page must be unused before it's considered 'free'
With lots of VTs per material, pages may not be 'touched' by the CPU every frame they're used, this threshold will help prevent these pages from being re-used too early
Effectively this will make the 'VT oversubscription' message more likely to appear, but this should more accurately reflect the actual load on the system
#rb none
#jira none

[CL 16208261 by Ben Ingram in ue5-main branch]
2021-05-05 11:55:24 -04:00
Ben Ingram
71d9de4675 Display on-screen message when VT pool is oversubscribed
#rb none
#jira none

[CL 16201143 by Ben Ingram in ue5-main branch]
2021-05-04 19:20:32 -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
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
Ben Ingram
43ad5274ff Fixes for VT page unmapping...ensure that we don't get mismatched ancestor pages
#rb none
#jira none

[CL 15962520 by Ben Ingram in ue5-main branch]
2021-04-08 19:55:35 -04:00