refactor(rendering): drive main scene graph usage through stage policy
This commit is contained in:
@@ -41,7 +41,7 @@ bool CameraFramePlan::UsesGraphManagedMainSceneColor() const {
|
||||
}
|
||||
|
||||
bool CameraFramePlan::UsesGraphManagedOutputColor(CameraFrameStage stage) const {
|
||||
if (stage == CameraFrameStage::MainScene) {
|
||||
if (SupportsCameraFramePipelineGraphRecording(stage)) {
|
||||
return UsesGraphManagedMainSceneColor();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ bool CameraFramePlan::IsPostProcessStageValid() const {
|
||||
UsesGraphManagedOutputColor(CameraFrameStage::PostProcess) ||
|
||||
(HasValidColorTarget(postProcess.destinationSurface) &&
|
||||
HasValidSurfaceSampleDescription(postProcess.destinationSurface));
|
||||
return UsesGraphManagedMainSceneColor() &&
|
||||
return UsesGraphManagedOutputColor(CameraFrameStage::MainScene) &&
|
||||
postProcess.passes != nullptr &&
|
||||
HasValidSingleSampleColorSource(request.surface) &&
|
||||
hasUsableDestination;
|
||||
@@ -97,7 +97,7 @@ bool CameraFramePlan::IsFinalOutputStageValid() const {
|
||||
|
||||
const bool hasUsableSource =
|
||||
finalOutputSource == CameraFrameColorSource::MainSceneColor
|
||||
? UsesGraphManagedMainSceneColor()
|
||||
? UsesGraphManagedOutputColor(CameraFrameStage::MainScene)
|
||||
: UsesGraphManagedOutputColor(CameraFrameStage::PostProcess);
|
||||
return hasUsableSource &&
|
||||
finalOutput.passes != nullptr &&
|
||||
@@ -106,7 +106,7 @@ bool CameraFramePlan::IsFinalOutputStageValid() const {
|
||||
}
|
||||
|
||||
bool CameraFramePlan::HasFrameStage(CameraFrameStage stage) const {
|
||||
if (stage == CameraFrameStage::MainScene) {
|
||||
if (SupportsCameraFramePipelineGraphRecording(stage)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ const RenderSurface* CameraFramePlan::GetSharedStageOutputSurface(
|
||||
}
|
||||
|
||||
const RenderSurface& CameraFramePlan::GetMainSceneSurface() const {
|
||||
if (UsesGraphManagedMainSceneColor() &&
|
||||
if (UsesGraphManagedOutputColor(CameraFrameStage::MainScene) &&
|
||||
graphManagedMainSceneSurface.GetWidth() > 0u &&
|
||||
graphManagedMainSceneSurface.GetHeight() > 0u) {
|
||||
return graphManagedMainSceneSurface;
|
||||
|
||||
Reference in New Issue
Block a user