refactor(rendering): queue managed fullscreen pass descriptors

This commit is contained in:
2026-04-18 13:51:09 +08:00
parent 788b1b971e
commit c91e87f2e2
6 changed files with 129 additions and 38 deletions

View File

@@ -0,0 +1,33 @@
namespace XCEngine
{
public enum FullscreenPassType
{
ColorScale = 0
}
public struct FullscreenPassDescriptor
{
public FullscreenPassType type;
public Vector4 vectorPayload;
public static FullscreenPassDescriptor CreateColorScale(
Vector4 colorScale)
{
FullscreenPassDescriptor descriptor = new FullscreenPassDescriptor();
descriptor.type = FullscreenPassType.ColorScale;
descriptor.vectorPayload = colorScale;
return descriptor;
}
public bool IsValid()
{
switch (type)
{
case FullscreenPassType.ColorScale:
return true;
default:
return false;
}
}
}
}

View File

@@ -405,9 +405,10 @@ namespace XCEngine
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool
Rendering_ScriptableRenderContext_RecordColorScaleFullscreenPass(
Rendering_ScriptableRenderContext_RecordFullscreenPass(
ulong nativeHandle,
ref Vector4 colorScale);
int passType,
ref Vector4 vectorPayload);
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern int

View File

@@ -1,3 +1,5 @@
using System;
namespace XCEngine
{
public sealed class ScriptableRenderContext
@@ -42,13 +44,22 @@ namespace XCEngine
(int)injectionPoint);
}
public bool RecordColorScaleFullscreenPass(
Vector4 colorScale)
public bool RecordFullscreenPass(
FullscreenPassDescriptor pass)
{
if (!pass.IsValid())
{
throw new ArgumentException(
"Invalid fullscreen pass descriptor.",
nameof(pass));
}
Vector4 vectorPayload = pass.vectorPayload;
return InternalCalls
.Rendering_ScriptableRenderContext_RecordColorScaleFullscreenPass(
.Rendering_ScriptableRenderContext_RecordFullscreenPass(
m_nativeHandle,
ref colorScale);
(int)pass.type,
ref vectorPayload);
}
}
}