{"record":{"id":"b31fcb8bea2f7186","repo":"stride3d/stride","slug":"output","errorCode":null,"errorMessage":"output","messagePattern":"output","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs","lineNumber":151,"sourceCode":"            SetOutput(output);\n            Draw(drawContext);\n        }\n\n        protected override void InitializeCore()\n        {\n            base.InitializeCore();\n            ToLoadAndUnload(msaaResolver);\n            ToLoadAndUnload(msaaDepthResolver);\n        }\n\n        protected override void DrawCore(RenderDrawContext drawContext)\n        {\n            var input = GetInput(0);\n            var output = GetOutput(0);\n            if (input == null)\n                throw new ArgumentNullException(nameof(input));\n            if (output == null)\n                throw new ArgumentNullException(nameof(output));\n            if (!input.IsMultiSampled)\n                throw new ArgumentOutOfRangeException(nameof(input), \"Source texture is not a MSAA texture.\");\n            if (output.IsMultiSampled)\n                throw new ArgumentOutOfRangeException(nameof(input), \"Destination texture is a MSAA texture.\");\n\n            // Prepare\n            int samplesCount = (int)input.MultisampleCount;\n            var inputSize = input.Size;\n            // SvPosUnpack = float4(float2(0.5, -0.5) * TextureSize, float2(0.5, 0.5) * TextureSize))\n            // TextureSizeLess1 = TextureSize - 1\n            var svPosUnpack = new Vector4(0.5f * inputSize.Width, -0.5f * inputSize.Height, 0.5f * inputSize.Width, 0.5f * inputSize.Height);\n            var textureSizeLess1 = new Vector2(inputSize.Width - 1.0f, inputSize.Height - 1.0f);\n\n            if (input.IsDepthStencil)\n            {\n                System.Diagnostics.Debug.Assert(output.IsDepthStencil, \"input and output IsDepthStencil don't match\");\n\n                // Resolve using custom pixel shader (output depth only)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs#L133-L169","documentation":"Thrown by MSAAResolver.DrawCore when the first input or output texture slot is missing (GetInput(0)/GetOutput(0) returned null). MSAAResolver resolves a multisampled source texture into a non-MSAA destination, so both slots are mandatory before the draw can proceed. The library throws ArgumentNullException eagerly to fail fast instead of crashing inside the GPU draw path.","triggerScenarios":"Rendering with MSAAResolver in a scene composition graph without connecting input slot 0 (the MSAA source) or output slot 0 (the resolved target) before DrawCore executes.","commonSituations":"Building a custom compositing pipeline in Stride and forgetting to assign the MSAA render target; a renderer stage upstream produces no texture so the slot stays null; copy-pasting a compositing graph and dropping a link.","solutions":["Connect the MSAA source texture to MSAAResolver's input slot 0 before rendering.","Connect a non-MSAA destination texture to MSAAResolver's output slot 0.","Verify the upstream compositing node that should feed the resolver actually produces a texture."],"exampleFix":"// before\nvar resolver = new MSAAResolver(); // input/output never set\n// after\nresolver.SetInput(0, msaaColorTarget, null);\nresolver.SetOutput(0, resolvedColorTarget);\nsceneRenderer.Render(context);","handlingStrategy":"validation","validationCode":"if (resolver.GetInput(0) == null) resolver.SetInput(0, msaaSource, null);\nif (resolver.GetOutput(0) == null) resolver.SetOutput(0, resolvedTarget);\n// now safe to render","typeGuard":"bool CanRender(MSAAResolver r) => r.GetInput(0) != null && r.GetOutput(0) != null;","tryCatchPattern":"try { renderer.Render(context); }\ncatch (ArgumentNullException ex) { Log.Error($\"MSAAResolver slot missing: {ex.ParamName}\"); }","preventionTips":["Always wire both slots 0 (input and output) when adding MSAAResolver to a compositing graph.","Validate the composition graph for null slots before first render.","Assert during scene setup that every resolver has an MSAA source and a resolved target."],"tags":["rendering","msaa","null-argument","stride"],"backgroundTag":"null-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}