{"record":{"id":"4752125885c09c8c","repo":"Unity-Technologies/UnityCsReference","slug":"getrenderershiddenresultbits-readonlyspan-int-is","errorCode":null,"errorMessage":"GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete. Use GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>) instead.","messagePattern":"GetRenderersHiddenResultBits\\(ReadOnlySpan<int>\\) is obsolete\\. Use GetRenderersHiddenResultBits\\(ReadOnlySpan<EntityId>\\) instead\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Camera/EditorCameraUtils.bindings.cs","lineNumber":40,"sourceCode":"\n        [System.Obsolete(\"GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete. Use GetRenderersFilteringResults(ReadOnlySpan<EntityId>) instead.\", true)]\n        public static unsafe void GetRenderersFilteringResults(ReadOnlySpan<int> rendererIDs, Span<bool> results)\n        {\n            throw new System.NotImplementedException(\"GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete. Use GetRenderersFilteringResults(ReadOnlySpan<EntityId>) instead.\");\n        }\n\n        public static unsafe void GetRenderersFilteringResults(ReadOnlySpan<EntityId> rendererIDs, Span<bool> results)\n        {\n            if (rendererIDs.Length != results.Length)\n                throw new ArgumentException(\"rendererIDs and results NativeArrays don't match in length.\");\n\n            GetRenderersFilteringResultsImpl(rendererIDs, results);\n        }\n\n        [System.Obsolete(\"GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete. Use GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>) instead.\", true)]\n        public static unsafe void GetRenderersHiddenResultBits(ReadOnlySpan<int> rendererIDs, Span<ulong> resultBits)\n        {\n            throw new System.NotImplementedException(\"GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete. Use GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>) instead.\");\n        }\n\n        public static unsafe void GetRenderersHiddenResultBits(ReadOnlySpan<EntityId> rendererIDs, Span<ulong> resultBits)\n        {\n            const int kBitsPerChunkCount = sizeof(ulong) * 8;\n\n            int resultBitsLengthExpected = (rendererIDs.Length + kBitsPerChunkCount - 1) / kBitsPerChunkCount;\n\n            if (resultBitsLengthExpected != resultBits.Length)\n                throw new ArgumentException(\"Unexpected resultBits Span length. The expected length of resultBits Span should be equal to the formula: (rendererIDs.Length + 63) / 64\");\n\n            GetRenderersHiddenResultBitsImpl(rendererIDs, resultBits);\n        }\n\n        [FreeFunction(\"EditorCameraUtilsScripting::RenderToCubemap\")]\n        static extern int RenderToCubemapImpl(Camera camera, Texture target, [DefaultValue(\"63\")] int faceMask, StaticEditorFlags culledFlags);\n\n        [FreeFunction(\"EditorCameraUtilsScripting::GetRenderersFilteringResults\")]","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Camera/EditorCameraUtils.bindings.cs#L22-L58","documentation":"EditorCameraUtils.GetRenderersHiddenResultBits(ReadOnlySpan<int>) is marked [Obsolete(..., true)] (error=true) and replaced by GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>, Span<ulong>). The body throws NotImplementedException to fail at runtime for any reflective invocation. Renderer identifiers are now EntityIds, and the hidden-result format packs bits into ulong chunks, so the int overload is fully removed from the supported surface.","triggerScenarios":"Calling the int-based GetRenderersHiddenResultBits overload. The obsolete attribute makes this a compile error; the throw covers reflective/dynamic calls.","commonSituations":"Version upgrade where renderer IDs moved from int to EntityId; unmigrated tooling or third-party package code; reflection-based invocation.","solutions":["Switch to GetRenderersHiddenResultBits(ReadOnlySpan<EntityId>, Span<ulong>).","Convert int renderer IDs to EntityId and size the resultBits span per (ids.Length + 63) / 64.","Remove all int-overload references from your code and dependencies."],"exampleFix":"// before\nEditorCameraUtils.GetRenderersHiddenResultBits(rendererIntIds, bits);\n\n// after\nint chunks = (rendererEntityIds.Length + 63) / 64;\nSpan<ulong> bits = stackalloc ulong[chunks];\nEditorCameraUtils.GetRenderersHiddenResultBits(rendererEntityIds, bits);","handlingStrategy":"type-guard","validationCode":"// Use the EntityId overload and size resultBits as (ids.Length + 63) / 64 ulong chunks.","typeGuard":"static void Call(ReadOnlySpan<EntityId> ids, Span<ulong> bits) => EditorCameraUtils.GetRenderersHiddenResultBits(ids, bits);","tryCatchPattern":null,"preventionTips":["Migrate all calls to the EntityId-based overload.","Size the resultBits span correctly for the packed bit format.","Update packages that still reference the int API."],"tags":["unity","rendering","obsolete","entityid","api-migration","notimplemented"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}