2022-02-02 08:19:08 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
/*================================================================================================
VirtualShadowMapDefinitions . h : used in virtual shadow map shaders and C + + code to define common constants
! ! ! Changing this file requires recompilation of the engine ! ! !
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
# pragma once
# define VIRTUAL_SHADOW_MAP_VISUALIZE_NONE 0
# define VIRTUAL_SHADOW_MAP_VISUALIZE_SHADOW_FACTOR (1 << 0)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_CLIPMAP_OR_MIP (1 << 1)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_VIRTUAL_PAGE (1 << 2)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_CACHED_PAGE (1 << 3)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_SMRT_RAY_COUNT (1 << 4)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_CLIPMAP_VIRTUAL_SPACE (1 << 5)
2022-03-16 17:30:21 -04:00
# define VIRTUAL_SHADOW_MAP_VISUALIZE_GENERAL_DEBUG (1 << 6)
2022-09-12 18:06:57 -04:00
# define VIRTUAL_SHADOW_MAP_VISUALIZE_DIRTY_PAGE (1 << 7)
2022-09-27 02:14:18 -04:00
# define VIRTUAL_SHADOW_MAP_VISUALIZE_GPU_INVALIDATED_PAGE (1 << 8)
# define VIRTUAL_SHADOW_MAP_VISUALIZE_MERGED_PAGE (1 << 9)
2023-09-12 13:19:05 -04:00
# define VIRTUAL_SHADOW_MAP_VISUALIZE_NANITE_OVERDRAW (1 << 10)
2022-07-01 12:47:13 -04:00
# define VSM_PROJ_FLAG_CURRENT_DISTANT_LIGHT (1U << 0)
2022-08-26 11:06:04 -04:00
# define VSM_PROJ_FLAG_UNCACHED (1U << 1) // Used to indicate that the light is uncached and should only render to dynamic pages
2023-06-30 15:15:06 -04:00
# define VSM_PROJ_FLAG_UNREFERENCED (1U << 2) // Used to indicate that the light is not referenced/rendered to this render
2022-08-26 11:06:04 -04:00
// Hard limit for max distant lights supported 8k for now - we may revise later. We need to keep them in a fixed range for now to make allocation easy and minimize overhead for indexing.
# define VSM_MAX_SINGLE_PAGE_SHADOW_MAPS (1024U * 8U)
2023-03-09 17:51:49 -05:00
# ifdef __cplusplus
# include "HLSLTypeAliases.h"
namespace UE : : HLSL
{
# endif
struct FVSMVisibleInstanceCmd
{
uint PackedPageInfo ;
uint InstanceIdAndFlags ;
uint IndirectArgIndex ;
} ;
struct FVSMCullingBatchInfo
{
uint FirstPrimaryView ;
uint NumPrimaryViews ;
uint PrimitiveRevealedOffset ;
uint PrimitiveRevealedNum ;
} ;
2023-04-05 13:48:25 -04:00
struct FNextVirtualShadowMapData
{
int NextVirtualShadowMapId ;
int2 PageAddressOffset ;
int _Padding ;
} ;
2023-03-09 17:51:49 -05:00
# ifdef __cplusplus
} // namespace UE::HLSL
using FVSMVisibleInstanceCmd = UE : : HLSL : : FVSMVisibleInstanceCmd ;
using FVSMCullingBatchInfo = UE : : HLSL : : FVSMCullingBatchInfo ;
2023-04-05 13:48:25 -04:00
using FNextVirtualShadowMapData = UE : : HLSL : : FNextVirtualShadowMapData ;
2023-03-09 17:51:49 -05:00
# endif