Files
UnrealEngineUWP/Engine/Shaders/Private/VirtualShadowMaps/VirtualShadowMapPageCacheCommon.ush

21 lines
725 B
Plaintext
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
VirtualShadowMapPageCacheCommon.ush:
=============================================================================*/
#pragma once
struct FShadowMapCacheData
{
Implement persistent shadow physical page pool - Eliminates the previous frame texture (~128MB in default config) and copy - Cached pages are kept in place, with a quick pass to find and allocate free pages following - Experimented with a persistent free list but for the small numbers of pages we are talking about (2k-4k ish standard), recomputing the free list each frame was cheap and robust - Main cost is synchronization/barriers between the new passes. Fairly low measured overhead compared to the much larger wins, but can revisit later if need be. - Removed a few things that added complexity but were not making a big difference to performance, especially with the changes: - No longer support "panning" the directional light cascade cached pages. With the changes to the snapping and depth range invalidations this was no longer making much of a difference anyways. - No longer do the hierarchical "eliminate parent if all 4 mip children are marked" for local lights. Tested a bit and it was not making a measurable difference in most cases with caching. Can be revived if useful later. - Moved ownership of the now persistent physical pool to CacheManager - A bunch of related cleanup and fixes #rb ola.olsson #preflight 61008a655938f90001f04260 #ROBOMERGE-OWNER: andrew.lauritzen #ROBOMERGE-AUTHOR: andrew.lauritzen #ROBOMERGE-SOURCE: CL 16985509 via CL 16987414 #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207) [CL 16987415 by andrew lauritzen in ue5-release-engine-test branch]
2021-07-28 17:00:37 -04:00
// ID of the corresponding virtual shadow map from the previous frame, or INDEX_NONE if
// there wasn't one.
int PrevVirtualShadowMapId;
};
StructuredBuffer<FShadowMapCacheData> ShadowMapCacheData;
StructuredBuffer<uint> PrevPageFlags;
StructuredBuffer<uint> PrevPageTable;
StructuredBuffer<FPhysicalPageMetaData> PrevPhysicalPageMetaData;
StructuredBuffer<uint> PrevDynamicCasterPageFlags;
ByteAddressBuffer PrevProjectionData;