Wire depth and shadow requests through camera renderer

This commit is contained in:
2026-04-04 14:41:01 +08:00
parent 9e8810e593
commit 1a236b866d
6 changed files with 323 additions and 7 deletions

View File

@@ -179,8 +179,19 @@ bool BuiltinDepthStylePassBase::Execute(const RenderPassContext& context) {
renderArea.x + renderArea.width,
renderArea.y + renderArea.height
};
const RHI::Rect clearRects[] = { scissorRect };
commandList->SetViewport(viewport);
commandList->SetScissorRect(scissorRect);
const Math::Color clearColor = context.sceneData.cameraData.clearColor;
const float clearValues[4] = { clearColor.r, clearColor.g, clearColor.b, clearColor.a };
if (HasRenderClearFlag(context.sceneData.cameraData.clearFlags, RenderClearFlags::Color)) {
commandList->ClearRenderTarget(renderTarget, clearValues, 1, clearRects);
}
if (HasRenderClearFlag(context.sceneData.cameraData.clearFlags, RenderClearFlags::Depth)) {
commandList->ClearDepthStencil(context.surface.GetDepthAttachment(), 1.0f, 0, 1, clearRects);
}
commandList->SetPrimitiveTopology(RHI::PrimitiveTopology::TriangleList);
for (const VisibleRenderItem& visibleItem : context.sceneData.visibleItems) {