Generalize the native fullscreen pass and descriptor plumbing so managed SRP can request shader-driven fullscreen stages without being locked to the ColorScale path. Keep ColorScale as a convenience descriptor mapped to the builtin color-scale shader, and add native fullscreen factory coverage for the new shader-vector path.
70 lines
2.0 KiB
C#
70 lines
2.0 KiB
C#
using System;
|
|
|
|
namespace XCEngine
|
|
{
|
|
public sealed class ScriptableRenderContext
|
|
{
|
|
private readonly ulong m_nativeHandle;
|
|
|
|
internal ScriptableRenderContext(ulong nativeHandle)
|
|
{
|
|
m_nativeHandle = nativeHandle;
|
|
}
|
|
|
|
public CameraFrameStage stage =>
|
|
(CameraFrameStage)InternalCalls.Rendering_ScriptableRenderContext_GetStage(
|
|
m_nativeHandle);
|
|
|
|
public bool RecordScene()
|
|
{
|
|
return InternalCalls
|
|
.Rendering_ScriptableRenderContext_RecordScene(
|
|
m_nativeHandle);
|
|
}
|
|
|
|
public bool RenderScene()
|
|
{
|
|
return RecordScene();
|
|
}
|
|
|
|
public bool RecordScenePhase(ScenePhase scenePhase)
|
|
{
|
|
return InternalCalls
|
|
.Rendering_ScriptableRenderContext_RecordScenePhase(
|
|
m_nativeHandle,
|
|
(int)scenePhase);
|
|
}
|
|
|
|
public bool RecordSceneInjectionPoint(
|
|
SceneRenderInjectionPoint injectionPoint)
|
|
{
|
|
return InternalCalls
|
|
.Rendering_ScriptableRenderContext_RecordSceneInjectionPoint(
|
|
m_nativeHandle,
|
|
(int)injectionPoint);
|
|
}
|
|
|
|
public bool RecordFullscreenPass(
|
|
FullscreenPassDescriptor pass)
|
|
{
|
|
if (!pass.IsValid())
|
|
{
|
|
throw new ArgumentException(
|
|
"Invalid fullscreen pass descriptor.",
|
|
nameof(pass));
|
|
}
|
|
|
|
string shaderPath = pass.shaderPath ?? string.Empty;
|
|
string passName = pass.passName ?? string.Empty;
|
|
Vector4 vectorPayload = pass.vectorPayload;
|
|
return InternalCalls
|
|
.Rendering_ScriptableRenderContext_RecordFullscreenPass(
|
|
m_nativeHandle,
|
|
(int)pass.type,
|
|
shaderPath,
|
|
passName,
|
|
ref vectorPayload);
|
|
}
|
|
}
|
|
}
|