stride3d/stride · error · InvalidOperationException
Requested RenderView|RenderStage combination doesn't exist…
Error message
Requested RenderView|RenderStage combination doesn't exist. Please add it to RenderView.RenderStages.
What it means
Before drawing, RenderSystem resolves the RenderStage associated with the current RenderView via RenderView.RenderStages. If no RenderViewStage with a valid Index is found (Index == -1), the requested view/stage combination was never registered on the view, so InvalidOperationException is thrown.
Solutions
- Add the RenderStage to the RenderView before drawing: view.RenderStages.Add(myStage)
- Verify the exact RenderStage instance passed to Draw is the same one registered in the view (not a duplicate)
- Check any code that clears/filters view.RenderStages (visibility culling, LOD logic) so the stage isn't removed each frame
Example fix
// before
var view = new RenderView { Name = "MyView" };
renderSystem.RenderViews.Add(view);
renderSystem.Draw(context, view, myStage); // throws: stage not on view
// after
var view = new RenderView { Name = "MyView", RenderStages = { myStage } };
renderSystem.RenderViews.Add(view);
renderSystem.Draw(context, view, myStage); Defensive patterns
Strategy: validation
Validate before calling
if (view.RenderStages == null || !view.RenderStages.Contains(stage))
throw new InvalidOperationException($"Stage {stage.Name} not registered on RenderView {view.Name}"); Type guard
static bool StageRegistered(RenderView view, RenderStage stage) => view.RenderStages?.Contains(stage) == true;
Try / catch
try { renderSystem.Draw(context, view, stage); }
catch (InvalidOperationException ex) when (ex.Message.Contains("RenderView|RenderStage")) {
if (!view.RenderStages.Contains(stage)) view.RenderStages.Add(stage); // repair and retry
} Prevention
- Register every RenderStage on its RenderView before the first Draw
- Use the exact same RenderStage instance everywhere (no duplicate constructions)
- Audit any per-frame code that mutates view.RenderStages
When it happens
Trigger: Calling RenderSystem.Draw (or the renderer invoking it) for a RenderView whose RenderStages collection does not contain the RenderStage being drawn — e.g. rendering a custom RenderStage without adding it to the view's RenderStages list.
Common situations: Creating a custom RenderStage (e.g. a shadow or post-effect stage) and a matching RenderView but forgetting view.RenderStages.Add(stage); stage removed from the view by other code; stage ordering/culling logic filtering the stage out of the view.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- A texture with size [ ] already exist with the same output…
- ApplicationDataSubDirectory cannot be modified after the…
- Asked for " + i + " but no more than 10 default textures…
- Attributes can not be null
- Begin must be called before functionName
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/04bc16946a002fc3.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Rendering/Rendering/RenderSystem.cs:369
public void Draw(RenderDrawContext renderDrawContext, RenderView renderView, RenderStage renderStage)
{
using var _ = Profiler.Begin(DrawKey);
// Sync point: draw (from now, we should execute with a graphics device context to perform rendering)
// Look for the RenderViewStage corresponding to this RenderView | RenderStage combination
var renderViewStage = RenderViewStage.Invalid;
foreach (var currentRenderViewStage in renderView.RenderStages)
{
if (currentRenderViewStage.Index == renderStage.Index)
{
renderViewStage = currentRenderViewStage;
break;
}
}
if (renderViewStage.Index == -1)
{
throw new InvalidOperationException("Requested RenderView|RenderStage combination doesn't exist. Please add it to RenderView.RenderStages.");
}
using (Profiler.Begin(UpdateRenderViewsKey))
{
// Perform updates once per change of RenderView
foreach (var renderFeature in RenderFeatures)
{
renderFeature.Draw(renderDrawContext, renderView, renderViewStage);
}
}
// Generate and execute draw jobs
var renderNodes = renderViewStage.SortedRenderNodes;
var renderNodeCount = renderViewStage.RenderNodes.Count;
if (renderNodeCount == 0)
return;
View on GitHub (pinned to 96fad776d2)