Editor/Prism/Compiler/CompileMode.cs

Enum CompileMode in the Editor.Prism.Compiler namespace. It defines four compile targets (Final, Preview, Thumbnail, SyntaxOnly) that alter what the compiler emits and how previews/thumbnails/diagnostics are produced.

namespace Editor.Prism.Compiler;

/// <summary>
/// What a compile is for. The mode changes what the compiler emits, not just where it writes it.
/// </summary>
public enum CompileMode
{
	/// <summary>
	/// The artifact saved beside the document. Literals are baked, every declared mode and combo is
	/// emitted, and no preview instrumentation is added.
	/// </summary>
	Final,

	/// <summary>
	/// The live viewport shader. Literals become named uniforms recorded in
	/// <c>CompileResult.PreviewAttributes</c>, so dragging a slider updates at frame rate with zero
	/// recompiles. The minimum combo set is declared to keep compile latency down.
	/// </summary>
	Preview,

	/// <summary>
	/// One shader containing every previewable node's expression behind a stage-id switch, used to
	/// render all node thumbnails from a single compile.
	/// </summary>
	Thumbnail,

	/// <summary>
	/// Type-check and emit far enough to produce diagnostics, then stop. Used by the debounced
	/// validation pass and by the code panel's IR tab.
	/// </summary>
	SyntaxOnly
}