#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
#ROBOMERGE-BOT: (v835-16672529)
[CL 16724487 by jeremy moore in ue5-main branch]
- 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
[CL 16308484 by Ben Ingram in ue5-main branch]
- 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]
- Check partially allocated block for fit, don't need to start with a completely free block for allocations
- Try to use the lowest possible vAddress for new allocations, this reduces the texture area covered by allocations
- Page table is no longer required to be square power-2 texture, instead allow it to grow organically as allocated area increases
- Allocator starts with maximum-sized block and tracks allocated area, no longer needs special logic to 'grow'
- Rectangular allocated VTs now mip based on min-size rather than max-size, relaxes alignment requirements and allows better packing
#rb jeremy.moore
#jira none
[CL 15825578 by Ben Ingram in ue5-main branch]
Previously for streaming pages, the request would return pending, but because the page is mapped, no subsequent request would occur.
#rb none
[CL 14738087 by Jeremy Moore in ue5-main branch]
Add VT scalability setting for throttling continuous updates
#ROBOMERGE-SOURCE: CL 13181235 via CL 13181238 via CL 13181240 via CL 13181249
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v688-13145358)
[CL 13181259 by jeremy moore in Main branch]
#rnx
#rb none
#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)
[CL 10870549 by ryan durand in Main branch]
Also remove virtual texture time slice option which was never used/needed
#ROBOMERGE-SOURCE: CL 10114449 via CL 10115537 via CL 10115579
#ROBOMERGE-BOT: (v587-10111126)
[CL 10115610 by jeremy moore in Main branch]
#rb none
#ROBOMERGE-OWNER: jeremy.moore
#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 9428260 via CL 9428262 via CL 9444157 via CL 9449047 via CL 9449237
#ROBOMERGE-BOT: (v495-9448618)
[CL 9451783 by jeremy moore in Main branch]
This prevents reported bug when flushing at low frame rates (which can happen when sculpting many layer landscape).
If we flush without a feedback buffer, then we will have to wait for at least one frame before refilling the cache and this can cause the landscape to look constantly low res.
#ROBOMERGE-SOURCE: CL 8335474 via CL 8357963
#ROBOMERGE-BOT: (v401-8057353)
[CL 8359123 by jeremy moore in Main branch]
#rb none
#ROBOMERGE-OWNER: jeremy.moore
#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 8126366 via CL 8132083
#ROBOMERGE-BOT: (v401-8057353)
[CL 8157029 by jeremy moore in Main branch]
- FVirtualTexturePhysicalSpace* now stored using TRefCountPtr<>, since code was changed to destroy previous unused physical spaces
- Otherwise we get into bad state since AllocatedVT could reference already deleted physical space, and cause system to get out of sync and/or crash
- Also defer deletion of unreferenced physical spaces until end of each render thread update, not strictly needed, but keeps large textures from getting destroyed/recreated in some cases
#rb none
[FYI] jeremy.moore
#ROBOMERGE-SOURCE: CL 8012534 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v396-7974030)
[CL 8012536 by ben ingram in Main branch]
The VT update can run concurrently with worker thread mesh command generation
VT system callbacks which can touch materials need to be complete before this phase
Moved VT callbacks to before InitViews to fix this
[FYI] Ben.Ingram
#ROBOMERGE-SOURCE: CL 7892548 via CL 7916688
#ROBOMERGE-BOT: (v389-7813075)
[CL 7916891 by jeremy moore in Main branch]
Integrated from //UE4/Dev-Rendering
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 7788444 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v388-7785529)
[CL 7788460 by jeremy moore in Main branch]
Release VT physical pools when they are no longer referenced
Integrated from //UE4/Dev-Rendering
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 7140205 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v367-6836689)
[CL 7140214 by jeremy moore in Main branch]