Unity-Technologies/UnityCsReference · error · ArgumentException
Given rpAssetType must derive from RenderPipelineAsset
Error message
Given rpAssetType must derive from RenderPipelineAsset
What it means
Thrown by the ScriptableRenderPipelineExtensionAttribute constructor when the supplied rpAssetType is null or not a subclass of RenderPipelineAsset. The attribute (now deprecated) requires a concrete render pipeline asset type.
Solutions
- Pass a type that derives from RenderPipelineAsset (e.g. typeof(UniversalRenderPipelineAsset)).
- Migrate to the replacement SupportedOnRenderPipelineAttribute per the deprecation message.
- Verify rpAssetType?.IsSubclassOf(typeof(RenderPipelineAsset)) before applying the attribute.
Example fix
// before
[ScriptableRenderPipelineExtension(typeof(UniversalRenderPipeline))]
class MyFeature {}
// after
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
class MyFeature {} Defensive patterns
Strategy: type-guard
Validate before calling
bool ok = rpAssetType != null && rpAssetType.IsSubclassOf(typeof(RenderPipelineAsset));
Type guard
static bool IsValidRpAssetType(Type t) => t?.IsSubclassOf(typeof(RenderPipelineAsset)) ?? false;
Prevention
- Pass a RenderPipelineAsset subclass.
- Migrate to SupportedOnRenderPipelineAttribute.
When it happens
Trigger: Decorating a class with [ScriptableRenderPipelineExtension(typeof(SomeType))] where SomeType does not derive from RenderPipelineAsset. Passing an interface, abstract base, or unrelated type.
Common situations: Mistaking the render pipeline type for the asset type. Passing typeof(RenderPipeline) instead of typeof(RenderPipelineAsset). Migration from the deprecated attribute where the type argument was wrong.
Related errors
- expandedProjectWindowItems is deprecated. Use…
- Host type is not matching any asset type at Path
- Parameter enumValue must be of type System.Enum
- renderingLayerNames is null or empty
- The MaterialProperty
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/023f5d1e4f5cb730.
Report an issue: GitHub.
Appendix: source
Thrown at Editor/Mono/Inspector/ScriptableRenderPipelineExtensionAttribute.deprecated.cs:19
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering;
[Obsolete($"{nameof(ScriptableRenderPipelineExtensionAttribute)} is deprecated. Use {nameof(SupportedOnRenderPipelineAttribute)} instead. #from(23.1) (UnityUpgradable) -> UnityEngine.Rendering.SupportedOnRenderPipelineAttribute", false)]
[AttributeUsage(AttributeTargets.Class)]
public class ScriptableRenderPipelineExtensionAttribute : Attribute
{
internal Type renderPipelineType;
public ScriptableRenderPipelineExtensionAttribute(Type rpAssetType)
{
if (!(rpAssetType?.IsSubclassOf(typeof(RenderPipelineAsset)) ?? false))
throw new ArgumentException($"Given {nameof(rpAssetType)} must derive from {nameof(RenderPipelineAsset)}");
renderPipelineType = rpAssetType;
}
[Obsolete($"ScriptableRenderPipelineExtensionAttribute.inUse is deprecated. Use SupportedOnRenderPipelineAttribute.isSupportedOnCurrentPipeline instead. #from(23.1) (UnityUpgradable) -> UnityEngine.Rendering.SupportedOnRenderPipelineAttribute.isSupportedOnCurrentPipeline", false)]
public bool inUse
=> GraphicsSettings.currentRenderPipelineAssetType == renderPipelineType;
}
View on GitHub (pinned to 225b0fbdb5)