Firstborn/Library/PackageCache/com.unity.render-pipelines..../Runtime/Decal/DecalPreviewPass.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

41 lines
1.6 KiB
C#

using System.Collections.Generic;
namespace UnityEngine.Rendering.Universal
{
internal class DecalPreviewPass : ScriptableRenderPass
{
private FilteringSettings m_FilteringSettings;
private List<ShaderTagId> m_ShaderTagIdList;
private ProfilingSampler m_ProfilingSampler;
public DecalPreviewPass()
{
renderPassEvent = RenderPassEvent.AfterRenderingOpaques;
ConfigureInput(ScriptableRenderPassInput.Depth); // Require depth
m_ProfilingSampler = new ProfilingSampler("Decal Preview Render");
m_FilteringSettings = new FilteringSettings(RenderQueueRange.opaque, -1);
m_ShaderTagIdList = new List<ShaderTagId>();
m_ShaderTagIdList.Add(new ShaderTagId(DecalShaderPassNames.DecalScreenSpaceMesh));
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
SortingCriteria sortingCriteria = renderingData.cameraData.defaultOpaqueSortFlags;
DrawingSettings drawingSettings = CreateDrawingSettings(m_ShaderTagIdList, ref renderingData, sortingCriteria);
CommandBuffer cmd = CommandBufferPool.Get();
using (new ProfilingScope(cmd, m_ProfilingSampler))
{
context.ExecuteCommandBuffer(cmd);
cmd.Clear();
context.DrawRenderers(renderingData.cullResults, ref drawingSettings, ref m_FilteringSettings);
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
}
}