chore: checkpoint current workspace changes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "RHI/RHICommandList.h"
|
||||
#include "Rendering/Extraction/RenderSceneExtractor.h"
|
||||
#include "Rendering/Internal/RenderSurfacePipelineUtils.h"
|
||||
#include "Rendering/RenderSurface.h"
|
||||
#include "Resources/Mesh/Mesh.h"
|
||||
|
||||
@@ -66,14 +67,17 @@ bool BuiltinDepthStylePassBase::Execute(const RenderPassContext& context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::vector<RHI::RHIResourceView*>& colorAttachments = context.surface.GetColorAttachments();
|
||||
RHI::RHIResourceView* depthAttachment = context.surface.GetDepthAttachment();
|
||||
RHI::RHIResourceView* renderTarget =
|
||||
(!colorAttachments.empty() ? colorAttachments[0] : nullptr);
|
||||
if (depthAttachment == nullptr) {
|
||||
if (!::XCEngine::Rendering::Internal::IsDepthStyleCompatibleSurface(context.surface)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::vector<RHI::RHIResourceView*>& colorAttachments = context.surface.GetColorAttachments();
|
||||
const uint32_t colorAttachmentCount =
|
||||
::XCEngine::Rendering::Internal::ResolveSurfaceColorAttachmentCount(context.surface);
|
||||
RHI::RHIResourceView* depthAttachment = context.surface.GetDepthAttachment();
|
||||
RHI::RHIResourceView* renderTarget =
|
||||
(colorAttachmentCount > 0u ? colorAttachments[0] : nullptr);
|
||||
|
||||
const Math::RectInt renderArea = context.surface.GetRenderArea();
|
||||
if (renderArea.width <= 0 || renderArea.height <= 0) {
|
||||
return false;
|
||||
@@ -91,6 +95,12 @@ bool BuiltinDepthStylePassBase::Execute(const RenderPassContext& context) {
|
||||
context.surface.GetColorStateBefore(),
|
||||
RHI::ResourceStates::RenderTarget);
|
||||
}
|
||||
if (context.surface.IsAutoTransitionEnabled() && depthAttachment != nullptr) {
|
||||
commandList->TransitionBarrier(
|
||||
depthAttachment,
|
||||
context.surface.GetDepthStateBefore(),
|
||||
RHI::ResourceStates::DepthWrite);
|
||||
}
|
||||
|
||||
RHI::RHIResourceView* renderTargets[] = { renderTarget };
|
||||
const uint32_t renderTargetCount = renderTarget != nullptr ? 1u : 0u;
|
||||
@@ -145,6 +155,12 @@ bool BuiltinDepthStylePassBase::Execute(const RenderPassContext& context) {
|
||||
RHI::ResourceStates::RenderTarget,
|
||||
context.surface.GetColorStateAfter());
|
||||
}
|
||||
if (context.surface.IsAutoTransitionEnabled() && depthAttachment != nullptr) {
|
||||
commandList->TransitionBarrier(
|
||||
depthAttachment,
|
||||
RHI::ResourceStates::DepthWrite,
|
||||
context.surface.GetDepthStateAfter());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user