refactor(srp): move renderer request helpers out of core
This commit is contained in:
@@ -73,61 +73,61 @@ namespace XCEngine.Rendering
|
||||
m_nativeHandle);
|
||||
}
|
||||
|
||||
public bool RecordOpaqueScenePhase()
|
||||
internal bool RecordOpaqueScenePhase()
|
||||
{
|
||||
return RecordScenePhaseInternal(
|
||||
RecordedScenePhase.Opaque);
|
||||
}
|
||||
|
||||
public bool RecordSkyboxScenePhase()
|
||||
internal bool RecordSkyboxScenePhase()
|
||||
{
|
||||
return RecordScenePhaseInternal(
|
||||
RecordedScenePhase.Skybox);
|
||||
}
|
||||
|
||||
public bool RecordTransparentScenePhase()
|
||||
internal bool RecordTransparentScenePhase()
|
||||
{
|
||||
return RecordScenePhaseInternal(
|
||||
RecordedScenePhase.Transparent);
|
||||
}
|
||||
|
||||
public bool RecordBeforeOpaqueInjection()
|
||||
internal bool RecordBeforeOpaqueInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.BeforeOpaque);
|
||||
}
|
||||
|
||||
public bool RecordAfterOpaqueInjection()
|
||||
internal bool RecordAfterOpaqueInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.AfterOpaque);
|
||||
}
|
||||
|
||||
public bool RecordBeforeSkyboxInjection()
|
||||
internal bool RecordBeforeSkyboxInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.BeforeSkybox);
|
||||
}
|
||||
|
||||
public bool RecordAfterSkyboxInjection()
|
||||
internal bool RecordAfterSkyboxInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.AfterSkybox);
|
||||
}
|
||||
|
||||
public bool RecordBeforeTransparentInjection()
|
||||
internal bool RecordBeforeTransparentInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.BeforeTransparent);
|
||||
}
|
||||
|
||||
public bool RecordAfterTransparentInjection()
|
||||
internal bool RecordAfterTransparentInjection()
|
||||
{
|
||||
return RecordSceneInjectionPointInternal(
|
||||
RecordedSceneInjectionPoint.AfterTransparent);
|
||||
}
|
||||
|
||||
public bool RecordColorScaleFullscreenPass(
|
||||
internal bool RecordColorScaleFullscreenPass(
|
||||
Vector4 colorScale)
|
||||
{
|
||||
return RecordFullscreenPassInternal(
|
||||
@@ -137,7 +137,7 @@ namespace XCEngine.Rendering
|
||||
colorScale);
|
||||
}
|
||||
|
||||
public bool RecordShaderVectorFullscreenPass(
|
||||
internal bool RecordShaderVectorFullscreenPass(
|
||||
string shaderPath,
|
||||
Vector4 vectorPayload,
|
||||
string passName = null)
|
||||
|
||||
@@ -21,12 +21,12 @@ namespace XCEngine.Rendering
|
||||
.Rendering_ScriptableRenderPipelineCameraRequestContext_GetRenderedRequestCount(
|
||||
m_nativeHandle);
|
||||
|
||||
public bool hasDirectionalShadow =>
|
||||
internal bool hasDirectionalShadow =>
|
||||
InternalCalls
|
||||
.Rendering_ScriptableRenderPipelineCameraRequestContext_GetHasDirectionalShadow(
|
||||
m_nativeHandle);
|
||||
|
||||
public void ClearDirectionalShadow()
|
||||
internal void ClearDirectionalShadow()
|
||||
{
|
||||
InternalCalls
|
||||
.Rendering_ScriptableRenderPipelineCameraRequestContext_ClearDirectionalShadow(
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace XCEngine.Rendering.FirstParty
|
||||
: ScriptableRendererFeature
|
||||
{
|
||||
public override void ConfigureCameraRenderRequest(
|
||||
ScriptableRenderPipelineCameraRequestContext context)
|
||||
RendererCameraRequestContext context)
|
||||
{
|
||||
if (context != null &&
|
||||
context.hasDirectionalShadow)
|
||||
|
||||
@@ -26,8 +26,10 @@ namespace XCEngine.Rendering.Renderer
|
||||
ResolveRendererData();
|
||||
if (rendererData != null)
|
||||
{
|
||||
RendererCameraRequestContext rendererContext =
|
||||
new RendererCameraRequestContext(context);
|
||||
rendererData.ConfigureCameraRenderRequestInstance(
|
||||
context);
|
||||
rendererContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using XCEngine;
|
||||
using XCEngine.Rendering;
|
||||
|
||||
namespace XCEngine.Rendering.Renderer
|
||||
{
|
||||
public sealed class RendererCameraRequestContext
|
||||
{
|
||||
private readonly ScriptableRenderPipelineCameraRequestContext
|
||||
m_requestContext;
|
||||
|
||||
internal RendererCameraRequestContext(
|
||||
ScriptableRenderPipelineCameraRequestContext requestContext)
|
||||
{
|
||||
m_requestContext = requestContext;
|
||||
}
|
||||
|
||||
public int renderedBaseCameraCount =>
|
||||
m_requestContext != null
|
||||
? m_requestContext.renderedBaseCameraCount
|
||||
: 0;
|
||||
|
||||
public int renderedRequestCount =>
|
||||
m_requestContext != null
|
||||
? m_requestContext.renderedRequestCount
|
||||
: 0;
|
||||
|
||||
public bool hasDirectionalShadow =>
|
||||
m_requestContext != null &&
|
||||
m_requestContext.hasDirectionalShadow;
|
||||
|
||||
public void ClearDirectionalShadow()
|
||||
{
|
||||
if (m_requestContext != null)
|
||||
{
|
||||
m_requestContext.ClearDirectionalShadow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace XCEngine.Rendering.Renderer
|
||||
}
|
||||
|
||||
internal void ConfigureCameraRenderRequestInstance(
|
||||
ScriptableRenderPipelineCameraRequestContext context)
|
||||
RendererCameraRequestContext context)
|
||||
{
|
||||
ConfigureCameraRenderRequest(context);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace XCEngine.Rendering.Renderer
|
||||
}
|
||||
|
||||
protected virtual void ConfigureCameraRenderRequest(
|
||||
ScriptableRenderPipelineCameraRequestContext context)
|
||||
RendererCameraRequestContext context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace XCEngine.Rendering.Renderer
|
||||
}
|
||||
|
||||
public virtual void ConfigureCameraRenderRequest(
|
||||
ScriptableRenderPipelineCameraRequestContext context)
|
||||
RendererCameraRequestContext context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user