stride3d/stride · error · InvalidOperationException
PerView VoxelizerStorer layout differs between different Ren
Error message
PerView VoxelizerStorer layout differs between different RenderObject in the same RenderView
What it means
VoxelRenderFeature.Prepare verifies that all RenderObjects in a single RenderView resolve the PerView VoxelizerStorer resource group to the same layout hash. If a later object's view layout hash differs from firstViewLighting.Hash, the per-view resource group binding would be inconsistent, so the feature throws InvalidOperationException. This is an internal consistency check on shader resource group layouts for voxelization.
Solutions
- Ensure all voxel-casting RenderObjects in a view use the same shader/effect so VoxelizerStorer has an identical layout.
- Check that every voxel caster's material resolves the VoxelizerStorerCasterKey the same way (non-empty and equal hashes).
- Split differently-shaded voxel objects into separate RenderViews/render stages, or update the engine if this case should be supported.
Example fix
// before
// one RenderView containing voxel objects with two different material shader variants
materialA = new Material { /* uses VoxelizerStorer layout X */ };
materialB = new Material { /* uses VoxelizerStorer layout Y */ }; // throws in Prepare
// after
// use the same shader variant / layout for all casters in the view
materialB = materialA; // or move materialB objects to their own RenderView Defensive patterns
Strategy: validation
Validate before calling
// before rendering, ensure all voxel casters in the view share one material/shader variant bool sameLayout = casters.Select(c => c.Material).Distinct().Count() <= 1;
Try / catch
try { renderSystem.Render(); }
catch (InvalidOperationException ex) when (ex.Message.Contains("VoxelizerStorer")) { /* fix materials / split views */ } Prevention
- Use identical materials/shader variants for all voxel-casting RenderObjects in a RenderView.
- Avoid mixing hand-edited shader permutations among voxel casters.
- Split incompatible voxel objects into separate views.
When it happens
Trigger: Mixing RenderObjects in one RenderView whose material/effect produces different VoxelizerStorer logical group layouts (e.g. different shader permutations or material changes mid-view).
Common situations: Adding voxel-casting objects with mismatched shaders/effects to the same view; editing materials so one voxel caster compiles a different VoxelizerStorer layout; custom render stages that group incompatible voxel objects.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Custom strides is not supported with packed PixelFormats
- output
- Source texture is not a MSAA texture.
- Destination texture is a MSAA texture.
- value
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/8b16e2fb42b46624.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Voxels/Voxels/GraphicsCompositor/VoxelRenderFeature.cs:161
ParameterCollection VSViewParameters = viewParameters;
pass.storer.ApplyVoxelizationParameters(VSViewParameters);
foreach (var attr in processedVolume.Attributes)
{
attr.Attribute.ApplyVoxelizationParameters(VSViewParameters);
}
foreach (var viewLayout in viewFeature.Layouts)
{
if (viewLayout.State != RenderEffectState.Normal)
continue;
var voxelizerStorer = viewLayout.GetLogicalGroup(VoxelizerStorerCasterKey);
if (voxelizerStorer.Hash == ObjectId.Empty)
continue;
if (voxelizerStorer.Hash != firstViewLighting.Hash)
throw new InvalidOperationException("PerView VoxelizerStorer layout differs between different RenderObject in the same RenderView");
var resourceGroup = viewLayout.Entries[pass.view.Index].Resources;
resourceGroup.UpdateLogicalGroup(ref voxelizerStorer, VSViewParameters);
}
}
}
}
}
}
View on GitHub (pinned to 96fad776d2)