1
0
mirror of synced 2024-12-16 00:01:18 +01:00
WACVR/Assets/LIV/Scripts/SDKUniversalRenderFeature.cs

49 lines
1.2 KiB
C#
Raw Normal View History

#if LIV_UNIVERSAL_RENDER
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using System.Collections;
using System.Collections.Generic;
namespace LIV.SDK.Unity
{
public class SDKPass : ScriptableRenderPass
{
public CommandBuffer commandBuffer;
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
context.ExecuteCommandBuffer(commandBuffer);
}
}
public class SDKUniversalRenderFeature : ScriptableRendererFeature
{
static List<SDKPass> passes = new List<SDKPass>();
public static void AddPass(SDKPass pass)
{
passes.Add(pass);
}
public static void ClearPasses()
{
passes.Clear();
}
public override void Create()
{
}
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
while (passes.Count > 0)
{
renderer.EnqueuePass(passes[0]);
passes.RemoveAt(0);
}
}
}
}
#endif