Unity-Technologies/UnityCsReference · error · ArgumentException
${renderPipelineType} must be a valid ${RenderPipeline}
Error message
${renderPipelineType} must be a valid ${RenderPipeline} What it means
Thrown by EditorGraphicsSettings.CheckRenderPipelineType when the supplied Type is not assignable to RenderPipeline. This guard fronts every render-pipeline settings registration/lookup API (SetRenderPipelineGlobalSettingsAsset, etc.) so that callers cannot register a non-pipeline type against the SRP settings registry.
Source
Thrown at Editor/Mono/EditorGraphicsSettings.bindings.cs:63
set { SetAlbedoSwatches(value); }
}
extern public static BatchRendererGroupStrippingMode batchRendererGroupShaderStrippingMode { get; }
extern internal static bool activeProfileHasGraphicsSettings { get; set; }
[NativeName("RegisterRenderPipelineSettings")] static extern bool Internal_TryRegisterRenderPipeline(string renderpipelineName, Object settings);
[NativeName("UnregisterRenderPipelineSettings")] static extern bool Internal_TryUnregisterRenderPipeline(string renderpipelineName);
[NativeName("GetSettingsForRenderPipeline")] static extern Object Internal_GetSettingsForRenderPipeline(string renderpipelineName);
[NativeName("GetSettingsEntityIdForRenderPipeline")] internal static extern EntityId Internal_GetSettingsEntityIdForRenderPipeline(string renderpipelineName);
private static void CheckRenderPipelineType(Type renderPipelineType)
{
if (renderPipelineType == null)
throw new ArgumentNullException(nameof(renderPipelineType));
if (!typeof(RenderPipeline).IsAssignableFrom(renderPipelineType))
throw new ArgumentException($"{renderPipelineType} must be a valid {nameof(RenderPipeline)}");
}
public static void SetRenderPipelineGlobalSettingsAsset(Type renderPipelineType, RenderPipelineGlobalSettings newSettings)
{
//In Worker thread, we cannot update assets
if (AssetDatabase.IsAssetImportWorkerProcess())
return;
CheckRenderPipelineType(renderPipelineType);
bool globalSettingsAssetChanged;
if (newSettings != null)
{
RenderPipelineGraphicsSettingsManager.PopulateRenderPipelineGraphicsSettings(newSettings);
globalSettingsAssetChanged = Internal_TryRegisterRenderPipeline(renderPipelineType.FullName, newSettings);
}
else
globalSettingsAssetChanged = Internal_TryUnregisterRenderPipeline(renderPipelineType.FullName);View on GitHub (pinned to 225b0fbdb5)
Solutions
- Pass a Type that derives from RenderPipeline (e.g. typeof(UniversalRenderPipeline)).
- If registering global settings, use the pipeline type, not the RenderPipelineGlobalSettings subclass.
- Verify the SRP package version exposes the expected RenderPipeline subclass before registering.
Example fix
// before
EditorGraphicsSettings.SetRenderPipelineGlobalSettingsAsset(
typeof(MyRenderPipelineSettings), asset); // wrong: settings type
// after
EditorGraphicsSettings.SetRenderPipelineGlobalSettingsAsset(
typeof(UniversalRenderPipeline), asset); Defensive patterns
Strategy: type-guard
Validate before calling
if (renderPipelineType == null || !typeof(RenderPipeline).IsAssignableFrom(renderPipelineType)) { Debug.LogError($"{renderPipelineType} is not a RenderPipeline"); return; } Type guard
static bool IsRenderPipelineType(Type t) => t != null && typeof(RenderPipeline).IsAssignableFrom(t);
Prevention
- Pass the pipeline Type (e.g. typeof(UniversalRenderPipeline)), never the settings Type.
- Guard all SRP settings registration calls with IsAssignableFrom checks.
- Document which Type each registration API expects to prevent copy-paste mistakes.
When it happens
Trigger: Passing typeof(SomeNonPipelineClass), typeof(ScriptableRendererFeature), or any Type not deriving from RenderPipeline to a global-settings method. Also passing a RenderPipeline-derived abstract type when a concrete pipeline is expected.
Common situations: SRP package integration code that registers a settings asset against the wrong type; custom render pipeline authoring where the registration call uses the settings type instead of the pipeline type; copy-paste from samples that reference a pipeline type not present in the project.
Related errors
- Specified enumType must be System.Enum
- A shader '{assetPath}' cannot depend on the 'srp/default-sha
- No valid types in required type list
- Parameter selected must be of type System.Enum
- Parameter enumValue must be of type System.Enum
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/6c423339351e7c26.
Report an issue: GitHub.