stride3d/stride · error · ArgumentNullException

output

Error message

output

What it means

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.

Solutions

  1. Connect the MSAA source texture to MSAAResolver's input slot 0 before rendering.
  2. Connect a non-MSAA destination texture to MSAAResolver's output slot 0.
  3. Verify the upstream compositing node that should feed the resolver actually produces a texture.

Example fix

// before
var resolver = new MSAAResolver(); // input/output never set
// after
resolver.SetInput(0, msaaColorTarget, null);
resolver.SetOutput(0, resolvedColorTarget);
sceneRenderer.Render(context);
Defensive patterns

Strategy: validation

Validate before calling

if (resolver.GetInput(0) == null) resolver.SetInput(0, msaaSource, null);
if (resolver.GetOutput(0) == null) resolver.SetOutput(0, resolvedTarget);
// now safe to render

Type guard

bool CanRender(MSAAResolver r) => r.GetInput(0) != null && r.GetOutput(0) != null;

Try / catch

try { renderer.Render(context); }
catch (ArgumentNullException ex) { Log.Error($"MSAAResolver slot missing: {ex.ParamName}"); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/b31fcb8bea2f7186. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Rendering/Rendering/Compositing/MSAAResolver.cs:151

            SetOutput(output);
            Draw(drawContext);
        }

        protected override void InitializeCore()
        {
            base.InitializeCore();
            ToLoadAndUnload(msaaResolver);
            ToLoadAndUnload(msaaDepthResolver);
        }

        protected override void DrawCore(RenderDrawContext drawContext)
        {
            var input = GetInput(0);
            var output = GetOutput(0);
            if (input == null)
                throw new ArgumentNullException(nameof(input));
            if (output == null)
                throw new ArgumentNullException(nameof(output));
            if (!input.IsMultiSampled)
                throw new ArgumentOutOfRangeException(nameof(input), "Source texture is not a MSAA texture.");
            if (output.IsMultiSampled)
                throw new ArgumentOutOfRangeException(nameof(input), "Destination texture is a MSAA texture.");

            // Prepare
            int samplesCount = (int)input.MultisampleCount;
            var inputSize = input.Size;
            // SvPosUnpack = float4(float2(0.5, -0.5) * TextureSize, float2(0.5, 0.5) * TextureSize))
            // TextureSizeLess1 = TextureSize - 1
            var svPosUnpack = new Vector4(0.5f * inputSize.Width, -0.5f * inputSize.Height, 0.5f * inputSize.Width, 0.5f * inputSize.Height);
            var textureSizeLess1 = new Vector2(inputSize.Width - 1.0f, inputSize.Height - 1.0f);

            if (input.IsDepthStencil)
            {
                System.Diagnostics.Debug.Assert(output.IsDepthStencil, "input and output IsDepthStencil don't match");

                // Resolve using custom pixel shader (output depth only)

View on GitHub (pinned to 96fad776d2)