您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

89 行
2.3 KiB

using UnityEngine.Profiling;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public enum CustomSamplerId
{
PushGlobalParameters,
CopySetDepthBuffer,
CopyDepthStencilbuffer,
HTileForSSS,
Forward,
RenderSSAO,
RenderShadows,
RenderDeferredDirectionalShadow,
BuildLightList,
BlitToFinalRT,
Distortion,
ApplyDistortion,
DepthPrepass,
TransparentDepthPrepass,
GBuffer,
DBufferRender,
DBufferPrepareDrawData,
DisplayDebugDecalsAtlas,
DisplayDebugViewMaterial,
DebugViewMaterialGBuffer,
BlitDebugViewMaterialDebug,
SubsurfaceScattering,
ForwardPassName,
ForwardTransparentDepthPrepass,
RenderForwardError,
TransparentDepthPostpass,
ObjectsVelocity,
CameraVelocity,
GaussianPyramidColor,
PyramidDepth,
PostProcessing,
RenderDebug,
ClearBuffers,
ClearDepthStencil,
ClearSSSDiffuseTarget,
ClearSSSFilteringTarget,
ClearAndCopyStencilTexture,
ClearHTile,
ClearHDRTarget,
ClearGBuffer,
HDRenderPipelineRender,
CullResultsCull,
CopyDepthForSceneView,
// Profile sampler for tile pass
TPPrepareLightsForGPU,
TPPushGlobalParameters,
TPTiledLightingDebug,
TPDeferredDirectionalShadow,
TPTileSettingsEnableTileAndCluster,
TPForwardPass,
TPForwardTiledClusterpass,
TPDisplayShadows,
TPRenderDeferredLighting,
// Misc
VolumeUpdate,
Max
}
public static class HDCustomSamplerExtension
{
static CustomSampler[] s_Samplers;
public static CustomSampler GetSampler(this CustomSamplerId samplerId)
{
// Lazy init
if (s_Samplers == null)
{
s_Samplers = new CustomSampler[(int)CustomSamplerId.Max];
for (int i = 0; i < (int)CustomSamplerId.Max; i++)
{
var id = (CustomSamplerId)i;
s_Samplers[i] = CustomSampler.Create("C#_" + id);
}
}
return s_Samplers[(int)samplerId];
}
}
}