2026-04-18 13:51:09 +08:00
|
|
|
using System;
|
|
|
|
|
|
2026-04-17 21:53:52 +08:00
|
|
|
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);
|
|
|
|
|
|
2026-04-18 13:30:45 +08:00
|
|
|
public bool RecordScene()
|
2026-04-17 21:53:52 +08:00
|
|
|
{
|
|
|
|
|
return InternalCalls
|
2026-04-18 13:30:45 +08:00
|
|
|
.Rendering_ScriptableRenderContext_RecordScene(
|
2026-04-17 21:53:52 +08:00
|
|
|
m_nativeHandle);
|
|
|
|
|
}
|
2026-04-17 22:26:51 +08:00
|
|
|
|
2026-04-18 13:30:45 +08:00
|
|
|
public bool RenderScene()
|
2026-04-17 22:26:51 +08:00
|
|
|
{
|
2026-04-18 13:30:45 +08:00
|
|
|
return RecordScene();
|
2026-04-17 22:26:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:30:45 +08:00
|
|
|
public bool RecordScenePhase(ScenePhase scenePhase)
|
2026-04-17 22:26:51 +08:00
|
|
|
{
|
|
|
|
|
return InternalCalls
|
2026-04-18 13:30:45 +08:00
|
|
|
.Rendering_ScriptableRenderContext_RecordScenePhase(
|
2026-04-17 22:26:51 +08:00
|
|
|
m_nativeHandle,
|
|
|
|
|
(int)scenePhase);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:30:45 +08:00
|
|
|
public bool RecordSceneInjectionPoint(
|
2026-04-17 22:26:51 +08:00
|
|
|
SceneRenderInjectionPoint injectionPoint)
|
|
|
|
|
{
|
|
|
|
|
return InternalCalls
|
2026-04-18 13:30:45 +08:00
|
|
|
.Rendering_ScriptableRenderContext_RecordSceneInjectionPoint(
|
2026-04-17 22:26:51 +08:00
|
|
|
m_nativeHandle,
|
|
|
|
|
(int)injectionPoint);
|
|
|
|
|
}
|
2026-04-17 22:58:39 +08:00
|
|
|
|
2026-04-18 13:51:09 +08:00
|
|
|
public bool RecordFullscreenPass(
|
|
|
|
|
FullscreenPassDescriptor pass)
|
2026-04-17 22:58:39 +08:00
|
|
|
{
|
2026-04-18 13:51:09 +08:00
|
|
|
if (!pass.IsValid())
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException(
|
|
|
|
|
"Invalid fullscreen pass descriptor.",
|
|
|
|
|
nameof(pass));
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 16:08:01 +08:00
|
|
|
string shaderPath = pass.shaderPath ?? string.Empty;
|
|
|
|
|
string passName = pass.passName ?? string.Empty;
|
2026-04-18 13:51:09 +08:00
|
|
|
Vector4 vectorPayload = pass.vectorPayload;
|
2026-04-17 22:58:39 +08:00
|
|
|
return InternalCalls
|
2026-04-18 13:51:09 +08:00
|
|
|
.Rendering_ScriptableRenderContext_RecordFullscreenPass(
|
2026-04-17 22:58:39 +08:00
|
|
|
m_nativeHandle,
|
2026-04-18 13:51:09 +08:00
|
|
|
(int)pass.type,
|
2026-04-18 16:08:01 +08:00
|
|
|
shaderPath,
|
|
|
|
|
passName,
|
2026-04-18 13:51:09 +08:00
|
|
|
ref vectorPayload);
|
2026-04-17 22:58:39 +08:00
|
|
|
}
|
2026-04-17 21:53:52 +08:00
|
|
|
}
|
|
|
|
|
}
|