Skip to content

System.IndexOutOfRangeException: Index was outside the bounds of the array when binding buffers #2

@k4G17eYWI

Description

@k4G17eYWI

Found a bug (as I think)

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Microsoft.Xna.Framework.Graphics.ShaderResourceCollection.SetResourceForBindingSlot(ShaderResource resource, Int32 bindingSlot, Boolean writeAccess, Boolean useSampler, Int32 bindingSlotForCounter)
   at Microsoft.Xna.Framework.Graphics.EffectPass.SetShaderResources(Shader shader, GraphicsDevice device)
   at Microsoft.Xna.Framework.Graphics.EffectPass.ApplyCompute()

Seems that it tries to bind resource on a 9'th slot of 8.

image

But I have less than 8 writable resources even with append counters. In my shader I have:

StructuredBuffer<particle_type> particle_types;
StructuredBuffer<uint> indirect_args;
RWStructuredBuffer<particle> particles;
AppendStructuredBuffer<particle_to_render> render_particles_transparency;
AppendStructuredBuffer<particle_to_render> render_particles_additive;
AppendStructuredBuffer<particle_to_render> render_particles_max;

And if I look into this._writeableResources I see not all the elements set, some have null values.

image

Btw: is there a better place to submit issues? Seems that issues are disabled at https://github.com/cpt-max/MonoGame

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions