refactor(srp): unify main-scene feature injection

This commit is contained in:
2026-04-22 02:15:03 +08:00
parent 36c4ae414b
commit 9b4a302f6a
7 changed files with 198 additions and 35 deletions

View File

@@ -0,0 +1,42 @@
using XCEngine;
using XCEngine.Rendering;
namespace XCEngine.Rendering.Universal
{
internal static class UniversalMainSceneFeatureUtility
{
public static bool IsActive(
RenderingData renderingData)
{
return renderingData != null &&
renderingData.isMainSceneStage;
}
public static bool SupportsPass(
RenderingData renderingData,
ScriptableRenderPass renderPass)
{
return IsActive(renderingData) &&
renderPass != null &&
renderPass.SupportsStage(
renderingData.stage);
}
public static bool EnqueuePass(
ScriptableRenderer renderer,
RenderingData renderingData,
ScriptableRenderPass renderPass)
{
if (renderer == null ||
!SupportsPass(
renderingData,
renderPass))
{
return false;
}
renderer.EnqueuePass(renderPass);
return true;
}
}
}