feat(rendering): add managed SRP renderer runtime

This commit is contained in:
2026-04-19 00:05:29 +08:00
parent a57b322bc7
commit b989edca91
50 changed files with 5732 additions and 171 deletions

View File

@@ -3,6 +3,7 @@
#include "Components/CameraComponent.h"
#include "Rendering/Execution/DirectionalShadowExecutionState.h"
#include "Rendering/Execution/Internal/CameraFrameGraph/Executor.h"
#include "Rendering/GraphicsSettingsState.h"
#include "Rendering/Internal/RenderPipelineFactory.h"
#include "Rendering/Pipelines/ManagedScriptableRenderPipelineAsset.h"
#include "Rendering/RenderPipelineAsset.h"
@@ -88,7 +89,7 @@ void CameraRenderer::RefreshManagedPipelineBindingIfNeeded() {
}
const size_t currentGeneration =
Pipelines::GetManagedRenderPipelineEnvironmentGeneration();
GetGraphicsSettingsState().GetEnvironmentGeneration();
if (currentGeneration == m_managedPipelineEnvironmentGeneration) {
return;
}
@@ -117,7 +118,7 @@ void CameraRenderer::ResetPipeline(std::unique_ptr<RenderPipeline> pipeline) {
m_managedPipelineEnvironmentGeneration =
UsesManagedPipelineBinding()
? Pipelines::GetManagedRenderPipelineEnvironmentGeneration()
? GetGraphicsSettingsState().GetEnvironmentGeneration()
: 0u;
}

View File

@@ -582,12 +582,22 @@ RenderPassContext BuildCameraFrameStageFallbackPassContext(
RenderPipelineStageRenderGraphContext BuildCameraFramePipelineStageRenderGraphContext(
const CameraFrameRenderGraphStageContext& context,
const CameraFrameStageGraphBuildState& stageState) {
return BuildRenderPipelineStageRenderGraphContext(
RenderPipelineStageRenderGraphContext pipelineContext =
BuildRenderPipelineStageRenderGraphContext(
BuildCameraFrameStageGraphRecordingContext(
context,
stageState,
context.sceneData),
stageState.stage);
pipelineContext.finalColorPolicy =
context.plan.finalColorPolicy;
pipelineContext.stageColorSource =
context.plan.ResolveStageColorSource(stageState.stage);
pipelineContext.usesGraphManagedOutputColor =
context.plan.UsesGraphManagedOutputColor(stageState.stage);
pipelineContext.directionalShadowPlan =
context.plan.directionalShadow;
return pipelineContext;
}
bool RecordCameraFramePipelineStageGraphPass(