Removing more headers from ScenePrivate.h

#preflight 63b7569d68068a8bd6dfaea4

[CL 23596021 by christopher waters in ue5-main branch]
This commit is contained in:
christopher waters
2023-01-06 01:47:56 -05:00
parent 4859c29c73
commit 6d540211d7
8 changed files with 89 additions and 79 deletions
@@ -23,6 +23,13 @@
#include "Nanite/NaniteVisualize.h"
#include "RenderCore.h"
#include "DataDrivenShaderPlatformInfo.h"
#include "VolumetricFog.h"
#include "BasePassRendering.inl"
// Instantiate the common policies
template class TBasePassVertexShaderPolicyParamType<FUniformLightMapPolicy>;
template class TBasePassPixelShaderPolicyParamType<FUniformLightMapPolicy>;
// Changing this causes a full shader recompile
static TAutoConsoleVariable<int32> CVarSelectiveBasePassOutputs(
@@ -8,6 +8,7 @@
#pragma once
#include "CoreFwd.h"
#include "BasePassRendering.h"
class FMeshMaterialShader;
class FPrimitiveSceneProxy;
@@ -7,6 +7,7 @@
#include "CoreMinimal.h"
#include "Stats/Stats.h"
#include "HAL/IConsoleManager.h"
#include "IO/IoDispatcher.h"
#include "Async/ParallelFor.h"
#include "RHI.h"
#include "RenderResource.h"
@@ -436,6 +437,68 @@ void FDistanceFieldBlockAllocator::Free(const TArray<int32, TInlineAllocator<4>>
FreeBlocks.Append(ElementRange);
}
struct FDistanceFieldReadRequest
{
// SDF scene context
FSetElementId AssetSetId;
int32 ReversedMipIndex = 0;
int32 NumDistanceFieldBricks = 0;
uint64 BuiltDataId = 0;
// Used when BulkData is nullptr
const uint8* AlwaysLoadedDataPtr = nullptr;
// Inputs of read request
const FBulkData* BulkData = nullptr;
uint32 BulkOffset = 0;
uint32 BulkSize = 0;
#if !WITH_EDITOR
// Outputs of read request
FBulkDataBatchReadRequest RequestHandle;
FIoBuffer RequestBuffer;
#endif
};
struct FDistanceFieldAsyncUpdateParameters
{
FDistanceFieldSceneData* DistanceFieldSceneData = nullptr;
FIntVector4* BrickUploadCoordinatesPtr = nullptr;
uint8* BrickUploadDataPtr = nullptr;
uint32* IndirectionIndicesUploadPtr = nullptr;
FVector4f* IndirectionDataUploadPtr = nullptr;
TArray<FDistanceFieldReadRequest> NewReadRequests;
TArray<FDistanceFieldReadRequest> ReadRequestsToUpload;
TArray<FDistanceFieldReadRequest> ReadRequestsToCleanUp;
};
FDistanceFieldSceneData::FDistanceFieldSceneData(FDistanceFieldSceneData&&) = default;
FDistanceFieldSceneData::FDistanceFieldSceneData(EShaderPlatform ShaderPlatform)
: NumObjectsInBuffer(0)
, IndirectionAtlasLayout(8, 8, 8, 512, 512, 512, false, true, false)
, HeightFieldAtlasGeneration(0)
, HFVisibilityAtlasGenerattion(0)
{
ObjectBuffers = nullptr;
HeightFieldObjectBuffers = nullptr;
bTrackAllPrimitives = ShouldAllPrimitivesHaveDistanceField(ShaderPlatform);
bCanUse16BitObjectIndices = RHISupportsBufferLoadTypeConversion(ShaderPlatform);
StreamingRequestReadbackBuffers.AddZeroed(MaxStreamingReadbackBuffers);
}
FDistanceFieldSceneData::~FDistanceFieldSceneData()
{
delete ObjectBuffers;
delete HeightFieldObjectBuffers;
}
class FDistanceFieldStreamingUpdateTask
{
public:
@@ -6,10 +6,11 @@
#pragma once
#include "CoreMinimal.h"
#include "ShaderParameters.h"
#include "SceneRendering.h"
#include "VolumetricFog.h"
#include "ShaderParameterMacros.h"
#include "RenderGraphFwd.h"
class FSceneViewFamily;
class FViewInfo;
BEGIN_GLOBAL_SHADER_PARAMETER_STRUCT(FFogUniformParameters,)
SHADER_PARAMETER(FVector4f, ExponentialFogParameters)
@@ -6,9 +6,7 @@
#pragma once
#include "CoreMinimal.h"
#include "RendererInterface.h"
#include "RenderGraphDefinitions.h"
#include "RenderGraphFwd.h"
class FViewInfo;
@@ -606,28 +606,6 @@ bool FPixelInspectorData::AddPixelInspectorRequest(FPixelInspectorRequest *Pixel
#endif //WITH_EDITOR
FDistanceFieldSceneData::FDistanceFieldSceneData(EShaderPlatform ShaderPlatform)
: NumObjectsInBuffer(0)
, IndirectionAtlasLayout(8, 8, 8, 512, 512, 512, false, true, false)
, HeightFieldAtlasGeneration(0)
, HFVisibilityAtlasGenerattion(0)
{
ObjectBuffers = nullptr;
HeightFieldObjectBuffers = nullptr;
bTrackAllPrimitives = ShouldAllPrimitivesHaveDistanceField(ShaderPlatform);
bCanUse16BitObjectIndices = RHISupportsBufferLoadTypeConversion(ShaderPlatform);
StreamingRequestReadbackBuffers.AddZeroed(MaxStreamingReadbackBuffers);
}
FDistanceFieldSceneData::~FDistanceFieldSceneData()
{
delete ObjectBuffers;
delete HeightFieldObjectBuffers;
}
bool IncludePrimitiveInDistanceFieldSceneData(bool bTrackAllPrimitives, const FPrimitiveSceneProxy* Proxy)
{
return PrimitiveNeedsDistanceFieldSceneData(
@@ -8,8 +8,6 @@
// Dependencies.
#include "CoreMinimal.h"
#include "IO/IoDispatcher.h"
#include "Misc/Guid.h"
#include "Math/RandomStream.h"
#include "Templates/PimplPtr.h"
@@ -31,13 +29,10 @@
#include "LightSceneInfo.h"
#include "DepthRendering.h"
#include "SceneHitProxyRendering.h"
//#include "ShadowRendering.h"
#include "TextureLayout.h"
#include "SceneRendering.h"
#include "LightMapRendering.h"
#include "VelocityRendering.h"
#include "BasePassRendering.h"
#include "MobileBasePassRendering.h"
#include "VolumeRendering.h"
#include "CommonRenderResources.h"
#include "VisualizeTexture.h"
@@ -667,13 +662,7 @@ public:
return (PrimitiveId == Other.PrimitiveId && Light == Other.Light && ShadowSplitIndex == Other.ShadowSplitIndex && bTranslucentShadow == Other.bTranslucentShadow);
}
FProjectedShadowKey(const FProjectedShadowInfo& ProjectedShadowInfo)
: PrimitiveId(ProjectedShadowInfo.GetParentSceneInfo() ? ProjectedShadowInfo.GetParentSceneInfo()->PrimitiveComponentId : FPrimitiveComponentId())
, Light(ProjectedShadowInfo.GetLightSceneInfo().Proxy->GetLightComponent())
, ShadowSplitIndex(ProjectedShadowInfo.CascadeSettings.ShadowSplitIndex)
, bTranslucentShadow(ProjectedShadowInfo.bTranslucentShadow)
{
}
FProjectedShadowKey(const FProjectedShadowInfo& ProjectedShadowInfo);
FProjectedShadowKey(FPrimitiveComponentId InPrimitiveId, const ULightComponent* InLight, int32 InSplitIndex, bool bInTranslucentShadow)
: PrimitiveId(InPrimitiveId)
@@ -1899,47 +1888,14 @@ private:
TArray<int32, TInlineAllocator<4>> FreeBlocks;
};
struct FDistanceFieldReadRequest
{
// SDF scene context
FSetElementId AssetSetId;
int32 ReversedMipIndex = 0;
int32 NumDistanceFieldBricks = 0;
uint64 BuiltDataId = 0;
// Used when BulkData is nullptr
const uint8* AlwaysLoadedDataPtr = nullptr;
// Inputs of read request
const FBulkData* BulkData = nullptr;
uint32 BulkOffset = 0;
uint32 BulkSize = 0;
#if !WITH_EDITOR
// Outputs of read request
FBulkDataBatchReadRequest RequestHandle;
FIoBuffer RequestBuffer;
#endif
};
struct FDistanceFieldAsyncUpdateParameters
{
FDistanceFieldSceneData* DistanceFieldSceneData = nullptr;
FIntVector4* BrickUploadCoordinatesPtr = nullptr;
uint8* BrickUploadDataPtr = nullptr;
uint32* IndirectionIndicesUploadPtr = nullptr;
FVector4f* IndirectionDataUploadPtr = nullptr;
TArray<FDistanceFieldReadRequest> NewReadRequests;
TArray<FDistanceFieldReadRequest> ReadRequestsToUpload;
};
struct FDistanceFieldReadRequest;
struct FDistanceFieldAsyncUpdateParameters;
/** Scene data used to manage distance field object buffers on the GPU. */
class FDistanceFieldSceneData
{
public:
FDistanceFieldSceneData(FDistanceFieldSceneData&&);
FDistanceFieldSceneData(EShaderPlatform ShaderPlatform);
~FDistanceFieldSceneData();
@@ -3623,5 +3579,3 @@ inline bool ShouldIncludeDomainInMeshPass(EMaterialDomain Domain)
return Domain != MD_Volume;
}
#include "BasePassRendering.inl" // IWYU pragma: export
@@ -2492,6 +2492,14 @@ void FProjectedShadowInfo::ClearTransientArrays()
GraphicsMinimalPipelineStateSet.Empty();
}
FSceneViewState::FProjectedShadowKey::FProjectedShadowKey(const FProjectedShadowInfo& ProjectedShadowInfo)
: PrimitiveId(ProjectedShadowInfo.GetParentSceneInfo() ? ProjectedShadowInfo.GetParentSceneInfo()->PrimitiveComponentId : FPrimitiveComponentId())
, Light(ProjectedShadowInfo.GetLightSceneInfo().Proxy->GetLightComponent())
, ShadowSplitIndex(ProjectedShadowInfo.CascadeSettings.ShadowSplitIndex)
, bTranslucentShadow(ProjectedShadowInfo.bTranslucentShadow)
{
}
/** Returns a cached preshadow matching the input criteria if one exists. */
TRefCountPtr<FProjectedShadowInfo> FSceneRenderer::GetCachedPreshadow(
const FLightPrimitiveInteraction* InParentInteraction,