stride3d/stride · error · ArgumentNullException
view
Error message
view
What it means
SetOutput sets the single render target output for this image effect. Stride throws ArgumentNullException("view") when the caller passes a null texture, because the effect's internal output state would otherwise be silently cleared or corrupted. It is a fail-fast guard on a public API.
Solutions
- Ensure the Texture passed to SetOutput is created successfully (PushRenderTexture / RenderContext.Allocator) before the call
- Check that the texture was not disposed earlier in the frame
- Guard the call: if (view != null) effect.SetOutput(view)
Example fix
// before
effect.SetOutput(renderTarget);
// after
if (renderTarget == null) throw new InvalidOperationException("render target not allocated");
effect.SetOutput(renderTarget); Defensive patterns
Strategy: validation
Validate before calling
if (texture == null) throw new InvalidOperationException("Output texture must be allocated before SetOutput"); Type guard
bool IsValidOutput(Texture view) => view != null && view.IsValid;
Try / catch
try { effect.SetOutput(view); } catch (ArgumentNullException) { /* allocate/bind output and retry */ } Prevention
- Always allocate render targets via RenderContext allocator before binding
- Check for null after any texture-producing call
- Never dispose a texture still bound to a live effect
When it happens
Trigger: Calling effect.SetOutput(null) directly, or forwarding a texture variable that was never assigned / failed to load (e.g. a render target allocation that returned null).
Common situations: Chaining image effects in a custom post-processing pipeline where an earlier effect was never drawn, so its output texture is still null; disposing render targets during resize and reusing the old reference.
Related errors
- views
- ArgumentNullException: generator
- ArgumentNullException: parameters
- BoundingVolumeBufferDownsampleLevel
- builder
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/211b8ddee28d06be.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Rendering/Rendering/Images/ImageEffect.cs:110
public override void Reset()
{
base.Reset();
maxInputTextureIndex = -1;
Array.Clear(inputTextures, 0, inputTextures.Length);
outputDepthStencilView = null;
outputRenderTargetView = null;
outputRenderTargetViews = null;
}
/// <summary>
/// Sets the render target output.
/// </summary>
/// <param name="view">The render target output view.</param>
/// <exception cref="System.ArgumentNullException">view</exception>
public void SetOutput(Texture view)
{
if (view == null) throw new ArgumentNullException("view");
SetOutputInternal(view);
}
/// <summary>
/// Sets the render target outputs.
/// </summary>
/// <param name="views">The render target output views.</param>
public void SetOutput(params Texture[] views)
{
if (views == null) throw new ArgumentNullException("views");
SetOutputInternal(views);
}
/// <summary>
/// Sets the render target output.
/// </summary>View on GitHub (pinned to 96fad776d2)