refactor(rendering): unify managed fullscreen planning stage api

replace post-process and final-output specific planning calls with a single fullscreen stage bridge

align managed planning with the native CameraFrameStage fullscreen seam
This commit is contained in:
2026-04-18 15:12:41 +08:00
parent eb39f87cdd
commit 2b6d62a127
4 changed files with 58 additions and 88 deletions

View File

@@ -2721,68 +2721,47 @@ void InternalCall_Rendering_ScriptableRenderPipelineCameraRequestContext_ClearDi
state->request->directionalShadow = {};
}
void InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearPostProcessStage(
uint64_t nativeHandle) {
void InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearFullscreenStage(
uint64_t nativeHandle,
int32_t stage) {
ManagedScriptableRenderPipelinePlanningContextState* const state =
FindManagedScriptableRenderPipelinePlanningContextState(nativeHandle);
if (state == nullptr || state->plan == nullptr) {
const Rendering::CameraFrameStage frameStage =
static_cast<Rendering::CameraFrameStage>(stage);
if (state == nullptr ||
state->plan == nullptr ||
!Rendering::IsCameraFrameFullscreenSequenceStage(frameStage)) {
return;
}
state->plan->ClearFullscreenStage(Rendering::CameraFrameStage::PostProcess);
state->plan->ClearFullscreenStage(frameStage);
}
mono_bool
InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestPostProcessStage(
InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestFullscreenStage(
uint64_t nativeHandle,
int32_t stage,
int32_t source,
mono_bool usesGraphManagedOutputColor) {
ManagedScriptableRenderPipelinePlanningContextState* const state =
FindManagedScriptableRenderPipelinePlanningContextState(nativeHandle);
const Rendering::CameraFrameStage frameStage =
static_cast<Rendering::CameraFrameStage>(stage);
if (state == nullptr ||
state->plan == nullptr ||
!Rendering::IsCameraFrameFullscreenSequenceStage(frameStage) ||
source == static_cast<int32_t>(Rendering::CameraFrameColorSource::ExplicitSurface)) {
return 0;
}
return state->plan->RequestFullscreenStage(
Rendering::CameraFrameStage::PostProcess,
frameStage,
static_cast<Rendering::CameraFrameColorSource>(source),
usesGraphManagedOutputColor != 0)
? 1
: 0;
}
void InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearFinalOutputStage(
uint64_t nativeHandle) {
ManagedScriptableRenderPipelinePlanningContextState* const state =
FindManagedScriptableRenderPipelinePlanningContextState(nativeHandle);
if (state == nullptr || state->plan == nullptr) {
return;
}
state->plan->ClearFullscreenStage(Rendering::CameraFrameStage::FinalOutput);
}
mono_bool
InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestFinalOutputStage(
uint64_t nativeHandle,
int32_t source) {
ManagedScriptableRenderPipelinePlanningContextState* const state =
FindManagedScriptableRenderPipelinePlanningContextState(nativeHandle);
if (state == nullptr ||
state->plan == nullptr ||
source == static_cast<int32_t>(Rendering::CameraFrameColorSource::ExplicitSurface)) {
return 0;
}
return state->plan->RequestFullscreenStage(
Rendering::CameraFrameStage::FinalOutput,
static_cast<Rendering::CameraFrameColorSource>(source))
? 1
: 0;
}
void RegisterInternalCalls() {
if (GetInternalCallRegistrationState()) {
return;
@@ -2920,10 +2899,8 @@ void RegisterInternalCalls() {
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelineCameraRequestContext_GetRenderedRequestCount", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelineCameraRequestContext_GetRenderedRequestCount));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelineCameraRequestContext_GetHasDirectionalShadow", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelineCameraRequestContext_GetHasDirectionalShadow));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelineCameraRequestContext_ClearDirectionalShadow", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelineCameraRequestContext_ClearDirectionalShadow));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_ClearPostProcessStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearPostProcessStage));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_RequestPostProcessStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestPostProcessStage));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_ClearFinalOutputStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearFinalOutputStage));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_RequestFinalOutputStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestFinalOutputStage));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_ClearFullscreenStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_ClearFullscreenStage));
mono_add_internal_call("XCEngine.InternalCalls::Rendering_ScriptableRenderPipelinePlanningContext_RequestFullscreenStage", reinterpret_cast<const void*>(&InternalCall_Rendering_ScriptableRenderPipelinePlanningContext_RequestFullscreenStage));
GetInternalCallRegistrationState() = true;
}