{"record":{"id":"b7da123d22ca4b63","repo":"stride3d/stride","slug":"input","errorCode":null,"errorMessage":"input","messagePattern":"input","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs","lineNumber":149,"sourceCode":"        {\n            SetInput(0, input);\n            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\");","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs#L131-L167","documentation":"Inside DrawCore (an ImageEffect stage), the MSAA resolver requires input slot 0 to be a multisampled source texture and output slot 0 to be non-null. This ArgumentNullException is thrown when GetInput(0) returns null — no texture was bound to the effect's first input before the resolve pass ran.","triggerScenarios":"Running the MSAAResolver compositor when input 0 was never set (upstream pass produced no texture, or SetInput wasn't called); pipeline wired with a missing render stage.","commonSituations":"Misconfigured compositing graph where an upstream pass is disabled or renamed so the MSAA input is never produced; camera/render stage wiring mistakes.","solutions":["Ensure the upstream MSAA render pass writes its color target and it is bound via SetInput(0, texture) before Draw","Verify the compositing stage order: render to MSAA target, then MSAAResolver, then output","Null-check/diagnose the compositing graph — a null input usually indicates a missing/renamed upstream stage"],"exampleFix":"// before\nresolver.Draw(context); // input 0 never bound\n// after\nresolver.SetInput(0, msaaColorTarget, context.Parameters);\nresolver.Draw(context);","handlingStrategy":"validation","validationCode":"var input = resolver.GetInput(0);\nif (input == null || !input.IsMultiSampled)\n    throw new InvalidOperationException(\"MSAA resolver input 0 must be a bound MSAA texture before Draw.\");","typeGuard":"static bool HasValidMsaaInput(ImageEffectShader resolver) =>\n    resolver.GetInput(0) is { } tex && tex.IsMultiSampled;","tryCatchPattern":"try { resolver.Draw(drawContext); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"input\") {\n    // upstream MSAA pass did not run or was not bound; fix compositing graph\n}","preventionTips":["Verify the compositing stage order: MSAA render pass -> resolver -> output","Assert inputs are set (GetInput(0) != null) before invoking image effects","Log compositing graph wiring at startup to catch missing upstream passes early"],"tags":["csharp","rendering","compositing"],"backgroundTag":"null-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}