feat(rendering): add shader-vector fullscreen SRP seam
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.
This commit is contained in:
@@ -2,12 +2,15 @@ namespace XCEngine
|
||||
{
|
||||
public enum FullscreenPassType
|
||||
{
|
||||
ColorScale = 0
|
||||
ColorScale = 0,
|
||||
ShaderVector = 1
|
||||
}
|
||||
|
||||
public struct FullscreenPassDescriptor
|
||||
{
|
||||
public FullscreenPassType type;
|
||||
public string shaderPath;
|
||||
public string passName;
|
||||
public Vector4 vectorPayload;
|
||||
|
||||
public static FullscreenPassDescriptor CreateColorScale(
|
||||
@@ -15,16 +18,33 @@ namespace XCEngine
|
||||
{
|
||||
FullscreenPassDescriptor descriptor = new FullscreenPassDescriptor();
|
||||
descriptor.type = FullscreenPassType.ColorScale;
|
||||
descriptor.shaderPath = string.Empty;
|
||||
descriptor.passName = string.Empty;
|
||||
descriptor.vectorPayload = colorScale;
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
public static FullscreenPassDescriptor CreateShaderVector(
|
||||
string shaderPath,
|
||||
Vector4 vectorPayload,
|
||||
string passName = null)
|
||||
{
|
||||
FullscreenPassDescriptor descriptor = new FullscreenPassDescriptor();
|
||||
descriptor.type = FullscreenPassType.ShaderVector;
|
||||
descriptor.shaderPath = shaderPath ?? string.Empty;
|
||||
descriptor.passName = passName ?? string.Empty;
|
||||
descriptor.vectorPayload = vectorPayload;
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
public bool IsValid()
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case FullscreenPassType.ColorScale:
|
||||
return true;
|
||||
case FullscreenPassType.ShaderVector:
|
||||
return !string.IsNullOrEmpty(shaderPath);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -408,6 +408,8 @@ namespace XCEngine
|
||||
Rendering_ScriptableRenderContext_RecordFullscreenPass(
|
||||
ulong nativeHandle,
|
||||
int passType,
|
||||
string shaderPath,
|
||||
string passName,
|
||||
ref Vector4 vectorPayload);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
|
||||
@@ -54,11 +54,15 @@ namespace XCEngine
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user