Formalize camera post-process descriptors

This commit is contained in:
2026-04-06 14:56:43 +08:00
parent 3a64c325bf
commit b6132aec4d
9 changed files with 400 additions and 41 deletions

View File

@@ -2,7 +2,7 @@
#include "Components/CameraComponent.h"
#include "Rendering/Caches/FullscreenPassSurfaceCache.h"
#include "Rendering/Passes/BuiltinColorScalePostProcessPass.h"
#include "Rendering/Planning/CameraPostProcessPassFactory.h"
#include "Rendering/Planning/SceneRenderRequestUtils.h"
namespace XCEngine {
@@ -104,8 +104,8 @@ void SceneRenderer::AttachCameraPostProcessRequests(
continue;
}
const std::vector<Math::Vector4>& colorScalePasses = request.camera->GetColorScalePostProcessPasses();
if (colorScalePasses.empty()) {
const CameraPostProcessStack& postProcessPasses = request.camera->GetPostProcessPasses();
if (postProcessPasses.empty()) {
continue;
}
@@ -131,12 +131,11 @@ void SceneRenderer::AttachCameraPostProcessRequests(
continue;
}
std::unique_ptr<RenderPassSequence> postProcessSequence = std::make_unique<RenderPassSequence>();
for (const Math::Vector4& colorScale : colorScalePasses) {
postProcessSequence->AddPass(
std::make_unique<Passes::BuiltinColorScalePostProcessPass>(colorScale));
std::unique_ptr<RenderPassSequence> postProcessSequence =
BuildCameraPostProcessPassSequence(postProcessPasses);
if (postProcessSequence == nullptr || postProcessSequence->GetPassCount() == 0u) {
continue;
}
RenderSurface sourceSurface = sourceEntry->surface;
sourceSurface.SetDepthAttachment(request.surface.GetDepthAttachment());
sourceSurface.SetColorStateBefore(RHI::ResourceStates::Common);