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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user