Commit Graph

34 Commits

Author SHA1 Message Date
jeremy moore
d362cef172 #jira UE-136254
Fix MipLevel sample mode with Adaptive Virtual Texture.
#preflight 61f88a0bf657e25a590668d4

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18803237 in //UE5/Release-5.0/... via CL 18803254 via CL 18821582
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821667 by jeremy moore in ue5-main branch]
2022-02-02 01:49:39 -05:00
jon nabozny
6ba99692f9 When sampling VT use a fallback color held in a uniform if the root page isn't mapped.
#rb ben.ingram
#preflight 6175b24d875c1a0001aed3e4
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17904945 via CL 18006803 via CL 18370387 via CL 18370436
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18370510 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 13:43:10 -05:00
jeremy moore
fdd4fa9be8 Move some log spam to verbose
#preflight 616de66ed48c46000176b699
#lockdown michal.valient

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17852833 via CL 18003968 via CL 18369727 via CL 18369804
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18369845 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 13:07:58 -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
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
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
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
e6c2c85df5 Fixes for UDIM VTs in texture editor
UDIMs use transformed UVs, account for these when computing visible regions
#rb none
#jira none

[CL 15926164 by Ben Ingram in ue5-main branch]
2021-04-05 21:56:26 -04:00
Ben Ingram
fa2db3f9fe Always use anisotropic formulat to compute VT mip level, even if VT anisotropic filtering is disabled
- If filtering is disabled, we'll still avoid using SampleGrad (which should still avoid most of the shader overhead)
- This way the computed VT mip level will match the non-VT mip level much more closely
Also tweak the way noise is mixed in to VT mip level, better match HW formular (also slightly cheaper)
#rb none
#jira UE-108270

[CL 15903344 by Ben Ingram in ue5-main branch]
2021-04-02 14:08:28 -04:00
Ben Ingram
9964cab80e AllocatedVT no longer assumes a square power-2 allocation region when unmapping/evicting pages
#rb none
#jira none

[CL 15827936 by Ben Ingram in ue5-main branch]
2021-03-25 14:24:11 -04:00
Ben Ingram
60478d3652 VT allocator improvements
- 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]
2021-03-25 12:40:35 -04:00
Ben Ingram
3a8e214e70 Missing include
#rb none
#jira UE-108983

[CL 15476103 by Ben Ingram in ue5-main branch]
2021-02-19 16:48:18 -04:00
Ben Ingram
bbca415d3c Downgrade a Virtual Texture check() into a warning, add more info
#rb none
#jira none

[CL 15409274 by Ben Ingram in ue5-main branch]
2021-02-15 15:08:04 -04:00
Ben Ingram
4c31355638 Fix clamp of VT MaxLevel (MaxLevel is MaxNumMips-1)
#jira UE-107099
#rb none

[CL 15185840 by Ben Ingram in ue5-main branch]
2021-01-25 16:45:24 -04:00
Marc Audy
bc88b73a29 Merge Release-Engine-Staging to Main @ CL# 15151250
Represents UE4/Main @ 15133763

[CL 15158774 by Marc Audy in ue5-main branch]
2021-01-21 16:22:06 -04:00
Ben Ingram
463d603315 Add more info to a check() that's reported to sometimes fail
#rb none
#jira none

[CL 14942629 by Ben Ingram in ue5-main branch]
2020-12-16 18:01:55 -04:00
Ben Ingram
fa3e271e0e Relax restriction that requires all VTs within a stack to match aspect ratio. Instead, crop mismatched textures to match. This should support common case of dummy/constant textures at least.
#rb none
#jira none

[CL 14838407 by Ben Ingram in ue5-main branch]
2020-12-02 16:15:40 -04:00
Ben Ingram
de1bc01ce9 Fix logic used to wrap UDIM VT coordinates during CPU update
- Need to make sure wrapped vAddress is properly used in all cases, otherwise can end up with duplicate/inconsistent page mappings
#rb none
#jira UESP-4030, UESP-4017

[CL 14580045 by Ben Ingram in ue5-main branch]
2020-10-26 15:28:18 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
Michal Valient
95d19f95b1 [REVERB] Merging //UE4/Private-Reverb-Development@13832732
#rb graham.wihlidal, rune.stubbe, brian.karis, andrew.lauritzen, jeff.farris

[CL 13834854 by Michal Valient in ue5-main branch]
2020-07-06 18:58:26 -04:00
danny couture
620cb1b9b8 Fix crash if physical texture in AllocatedVT is null, this can happen with async texture creation if VTs haven't finished background creation
Edigrated from CL 13818555

#rb none

[CL 13826118 by danny couture in ue5-main branch]
2020-07-02 13:45:03 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
jeremy moore
a5b54434c7 Readd support for 16bit virtual texture page tables.
This had been broken by a previous changelist (9751925)
#jira none
#rb none

#ROBOMERGE-SOURCE: CL 12382248 in //UE4/Release-4.25/... via CL 12382250
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v671-12333473)

[CL 12382257 by jeremy moore in Main branch]
2020-03-23 15:55:34 -04:00
Rolando Caloca
bbb9564388 Copying //UE4/Dev-RenderPlat-Staging@11110326 to //UE4/Main
#rb none
#rnx

[CL 11110369 by Rolando Caloca in Main branch]
2020-01-24 18:07:01 -05:00
ryan durand
0f0464a30e Updating copyright for Engine Runtime.
#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]
2019-12-26 14:45:42 -05:00