refactor(rendering): move directional shadow execution defaults into pipeline
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#include <XCEngine/Rendering/RenderPipeline.h>
|
||||
|
||||
#include <XCEngine/Rendering/Caches/DirectionalShadowSurfaceCache.h>
|
||||
#include <XCEngine/Rendering/Execution/DirectionalShadowExecutionState.h>
|
||||
|
||||
#include "Components/CameraComponent.h"
|
||||
#include "Rendering/Execution/CameraFramePlan.h"
|
||||
#include "Rendering/Shadow/DirectionalShadowData.h"
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Rendering {
|
||||
@@ -54,5 +58,35 @@ void RenderPipeline::ConfigureRenderSceneData(
|
||||
BuildDefaultEnvironmentData(plan);
|
||||
}
|
||||
|
||||
void ApplyDefaultRenderPipelineDirectionalShadowExecutionPolicy(
|
||||
const CameraFramePlan& plan,
|
||||
const DirectionalShadowSurfaceAllocation& shadowAllocation,
|
||||
DirectionalShadowExecutionState& shadowState) {
|
||||
shadowState.shadowCasterRequest.surface = shadowAllocation.surface;
|
||||
shadowState.shadowCasterRequest.clearFlags = RenderClearFlags::Depth;
|
||||
if (!shadowState.shadowCasterRequest.hasCameraDataOverride) {
|
||||
shadowState.shadowCasterRequest.hasCameraDataOverride = true;
|
||||
shadowState.shadowCasterRequest.cameraDataOverride =
|
||||
plan.directionalShadow.cameraData;
|
||||
}
|
||||
|
||||
shadowState.shadowData =
|
||||
BuildRenderDirectionalShadowData(
|
||||
plan.directionalShadow,
|
||||
shadowAllocation.depthShaderView);
|
||||
}
|
||||
|
||||
bool RenderPipeline::ConfigureDirectionalShadowExecutionState(
|
||||
const CameraFramePlan& plan,
|
||||
const DirectionalShadowSurfaceAllocation& shadowAllocation,
|
||||
DirectionalShadowExecutionState& shadowState) const {
|
||||
ApplyDefaultRenderPipelineDirectionalShadowExecutionPolicy(
|
||||
plan,
|
||||
shadowAllocation,
|
||||
shadowState);
|
||||
return shadowState.shadowCasterRequest.IsValid() &&
|
||||
shadowState.shadowData.IsValid();
|
||||
}
|
||||
|
||||
} // namespace Rendering
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user