Unity-Technologies/UnityCsReference · error · NotImplementedException

GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete.

Error message

GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete. Use GetRenderersFilteringResults(ReadOnlySpan<EntityId>) instead.

What it means

EditorCameraUtils.GetRenderersFilteringResults(ReadOnlySpan<int>) is decorated with [Obsolete(..., true)] (error=true), so any use is a compile-time error. The method body also throws NotImplementedException defensively for runtime/reflective access. The API was replaced by the EntityId-based overload GetRenderersFilteringResults(ReadOnlySpan<EntityId>, Span<bool>) because renderer identifiers are now EntityIds, not raw ints.

Source

Thrown at Editor/Mono/Camera/EditorCameraUtils.bindings.cs:26

using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Scripting;

namespace UnityEditor.Rendering
{
    [NativeHeader("Editor/Src/Camera/EditorCameraUtils.h")]
    [RequiredByNativeCode]
    public static class EditorCameraUtils
    {
        public static bool RenderToCubemap(this Camera camera, Texture target, int faceMask, StaticEditorFlags culledFlags)
            => RenderToCubemapImpl(camera, target, faceMask, culledFlags) == 1;

        [System.Obsolete("GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete. Use GetRenderersFilteringResults(ReadOnlySpan<EntityId>) instead.", true)]
        public static unsafe void GetRenderersFilteringResults(ReadOnlySpan<int> rendererIDs, Span<bool> results)
        {
            throw new System.NotImplementedException("GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete. Use GetRenderersFilteringResults(ReadOnlySpan<EntityId>) instead.");
        }

        public static unsafe void GetRenderersFilteringResults(ReadOnlySpan<EntityId> rendererIDs, Span<bool> results)
        {
            if (rendererIDs.Length != results.Length)
                throw new ArgumentException("rendererIDs and results NativeArrays don't match in length.");

            GetRenderersFilteringResultsImpl(rendererIDs, results);
        }

        [System.Obsolete("GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete. Use GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>) instead.", true)]
        public static unsafe void GetRenderersHiddenResultBits(ReadOnlySpan<int> rendererIDs, Span<ulong> resultBits)
        {
            throw new System.NotImplementedException("GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete. Use GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>) instead.");
        }

        public static unsafe void GetRenderersHiddenResultBits(ReadOnlySpan<EntityId> rendererIDs, Span<ulong> resultBits)
        {

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Switch to the EntityId overload: GetRenderersFilteringResults(ReadOnlySpan<EntityId>, Span<bool>).
  2. Convert your int renderer IDs to EntityId values using the current conversion API before calling.
  3. Remove all references to the int-based overload from your codebase.

Example fix

// before
EditorCameraUtils.GetRenderersFilteringResults(rendererIntIds, results);

// after
EditorCameraUtils.GetRenderersFilteringResults(rendererEntityIds, results);
Defensive patterns

Strategy: type-guard

Validate before calling

// Ensure compile-time switch to the EntityId overload; remove all int-overload references.

Type guard

static void Call(ReadOnlySpan<EntityId> ids, Span<bool> results) => EditorCameraUtils.GetRenderersFilteringResults(ids, results);

Prevention

When it happens

Trigger: Calling GetRenderersFilteringResults with ReadOnlySpan<int> renderer IDs — either directly or via code that was not migrated. The obsolete marker makes this a hard error at compile time.

Common situations: Upgrading Unity versions where renderer IDs changed from int to EntityId; code targeting an older API surface; reflection/dynamic invocation that bypasses the compiler error.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/85a60e33b395c52d. Report an issue: GitHub.