{"record":{"id":"051951e9e4df6539","repo":"stride3d/stride","slug":"msaadepthresolvershadername","errorCode":null,"errorMessage":"msaaDepthResolverShaderName","messagePattern":"msaaDepthResolverShaderName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs","lineNumber":116,"sourceCode":"\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MSAAResolver\"/> class.\n        /// </summary>\n        public MSAAResolver()\n            : this(\"MSAAResolverEffect\", \"MSAADepthResolverEffect\")\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MSAAResolver\"/> class.\n        /// </summary>\n        /// <param name=\"msaaResolverShaderName\">Name of the MSAA resolve pass shader.</param>\n        /// <param name=\"msaaDepthResolverShaderName\">Name of the MSAA depth resolve pass shader.</param>\n        public MSAAResolver(string msaaResolverShaderName, string msaaDepthResolverShaderName)\n            : base(msaaResolverShaderName)\n        {\n            if (msaaResolverShaderName == null) throw new ArgumentNullException(nameof(msaaResolverShaderName));\n            if (msaaDepthResolverShaderName == null) throw new ArgumentNullException(nameof(msaaDepthResolverShaderName));\n\n            msaaResolver = new ImageEffectShader(msaaResolverShaderName);\n            msaaDepthResolver = new ImageEffectShader(msaaDepthResolverShaderName);\n\n            EnableSetRenderTargets = false;\n        }\n\n        /// <summary>\n        /// Resolves the specified input multisampled texture.\n        /// </summary>\n        /// <param name=\"drawContext\">The draw context.</param>\n        /// <param name=\"input\">The input.</param>\n        /// <param name=\"output\">The output.</param>\n        public void Resolve(RenderDrawContext drawContext, Texture input, Texture output)\n        {\n            SetInput(0, input);\n            SetOutput(output);\n            Draw(drawContext);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs#L98-L134","documentation":"Same constructor as the color-resolve check, but for the DEPTH resolve shader name: MSAAResolver throws ArgumentNullException(msaaDepthResolverShaderName) when the second argument is null. The depth-resolve pass is required to resolve multisampled depth-stencil buffers.","triggerScenarios":"new MSAAResolver(\"MSAAResolverShader\", null) — passing null as the depth-resolve shader name.","commonSituations":"Depth resolve being optional in older codepaths and later made mandatory; settings lookups returning null for the depth shader key; copy-paste refactors dropping the second argument's initialization.","solutions":["Pass a valid depth-resolve shader name as the second constructor argument","Fix the configuration lookup returning null for msaaDepthResolverShaderName","Add a call-site guard/verbosity: fail early with the actual config key missing"],"exampleFix":"// before\nnew MSAAResolver(\"MSAAResolverShader\", null);\n// after\nnew MSAAResolver(\"MSAAResolverShader\", \"MSAADepthResolverShader\");","handlingStrategy":"validation","validationCode":"if (msaaDepthResolverShaderName == null)\n    throw new InvalidOperationException(\"MSAA depth resolve shader name is required\");\nvar resolver = new MSAAResolver(msaaResolverShaderName, msaaDepthResolverShaderName);","typeGuard":"static bool HasDepthShaderName((string color, string depth) shaders) =>\n    !string.IsNullOrEmpty(shaders.depth);","tryCatchPattern":"try { resolver = new MSAAResolver(name, depthName); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"msaaDepthResolverShaderName\") {\n    // supply the default depth-resolve shader name and retry\n}","preventionTips":["Treat both resolve shader names as a required pair in configuration","Add constructor-call unit tests covering null-argument paths","Default missing depth shader keys to the engine's standard depth resolve shader"],"tags":["csharp","rendering","msaa"],"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"}