using System;
namespace UnityEngine.Rendering.HighDefinition
{
///
/// Context used when executing custom passes
///
public struct CustomPassContext
{
///
/// Scriptable Render Context, used for any SRP related operations.
///
public readonly ScriptableRenderContext renderContext;
///
/// Command Buffer, used to enqueue graphic commands to the GPU.
///
public readonly CommandBuffer cmd;
///
/// HdCamera, HDRP data related to the rendering camera. Use the camera property to access the Camera class.
///
public readonly HDCamera hdCamera;
///
/// Result of the culling either of the camera or the custom pass if AggregateCullingParameters is used.
///
public CullingResults cullingResults;
///
/// Camera culling results, not modified by the custom pass culling.
///
public readonly CullingResults cameraCullingResults;
///
/// Camera color buffer.
///
public readonly RTHandle cameraColorBuffer;
///
/// Camera depth buffer.
///
public readonly RTHandle cameraDepthBuffer;
///
/// Camera normal buffer.
///
public readonly RTHandle cameraNormalBuffer;
///
/// Lazy handle to the custom color buffer, not allocated if not used.
///
public readonly Lazy customColorBuffer;
///
/// Lazy handle to the custom depth buffer, not allocated if not used.
///
public readonly Lazy customDepthBuffer;
///
/// Material Property Block, unique for each custom pass instance.
///
public readonly MaterialPropertyBlock propertyBlock;
internal CustomPassContext(
ScriptableRenderContext renderContext, CommandBuffer cmd,
HDCamera hdCamera, CullingResults cullingResults,
CullingResults cameraCullingResults,
RTHandle cameraColorBuffer, RTHandle cameraDepthBuffer,
RTHandle cameraNormalBuffer, Lazy customColorBuffer,
Lazy customDepthBuffer, MaterialPropertyBlock propertyBlock)
{
this.renderContext = renderContext;
this.cmd = cmd;
this.hdCamera = hdCamera;
this.cullingResults = cullingResults;
this.cameraCullingResults = cameraCullingResults;
this.cameraColorBuffer = cameraColorBuffer;
this.cameraDepthBuffer = cameraDepthBuffer;
this.customColorBuffer = customColorBuffer;
this.cameraNormalBuffer = cameraNormalBuffer;
this.customDepthBuffer = customDepthBuffer;
this.propertyBlock = propertyBlock;
}
}
}