using System;
namespace UnityEngine.Rendering
{
///
/// A graphics settings container for settings related to the Render Graph for all Scriptable Render Pipelines.
///
///
/// To change those settings, go to Editor > Project Settings in the Graphics tab.
/// Changing this through the API is only allowed in the Editor. In the Player, this raises an error.
///
///
///
/// This example demonstrates how to determine if your project uses RenderGraph's compilation caching.
///
/// using UnityEngine.Rendering;
///
/// public static class RenderGraphHelper
/// {
/// public static bool enableCompilationCaching
/// {
/// get
/// {
/// var gs = GraphicsSettings.GetRenderPipelineSettings<RenderGraphGlobalSettings>();
/// if (gs == null) //not in SRP
/// return false;
/// return gs.enableCompilationCaching;
/// }
/// }
/// }
///
///
[Serializable]
[SupportedOnRenderPipeline]
[Categorization.CategoryInfo(Name = "Render Graph", Order = 50)]
[Categorization.ElementInfo(Order = 0)]
public class RenderGraphGlobalSettings : IRenderPipelineGraphicsSettings
{
enum Version
{
Initial,
Count,
Last = Count - 1
}
bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true;
[SerializeField, HideInInspector]
private Version m_version = Version.Last;
int IRenderPipelineGraphicsSettings.version => (int)m_version;
[RecreatePipelineOnChange , SerializeField, Tooltip("Enable caching of render graph compilation from one frame to another.")]
private bool m_EnableCompilationCaching = true;
/// Enable Compilation caching for render graph.
public bool enableCompilationCaching
{
get => m_EnableCompilationCaching;
set => this.SetValueAndNotify(ref m_EnableCompilationCaching, value);
}
[RecreatePipelineOnChange , SerializeField, Tooltip("Enable validity checks of render graph in Editor and Development mode. Always disabled in Release build.")]
private bool m_EnableValidityChecks = true;
/// Enable validity checks for render graph. Always disabled in Release mode.
public bool enableValidityChecks
{
get => m_EnableValidityChecks;
set => this.SetValueAndNotify(ref m_EnableValidityChecks, value);
}
}
}