Skip to content

Mesh non deterministic glitch #303

@davideGiovannini

Description

@davideGiovannini

Summary

I apologize for the lack of details, I'm still trying to find a way to reliably reproduce this.


Setup

I'm using a ScreenScaler, a Texture atlas to draw tiles and entities and Mesh to draw particles and debug graphic.

        let mut particle_mesh =
            Mesh::rectangle(ctx, ShapeStyle::Fill, Rectangle::new(0.0, 0.0, 1.0, 1.0))?;
        particle_mesh.set_backface_culling(false);

        ...

        for particle in particles{
            particle_mesh.draw(ctx, particle);
        }

This works fine, except that randomly the screen glitches and 1 frame is drawn at a huge scale.

bug1.mp4

Glitched frame

glitched_frame

So far after some testing this seems to happen only if I draw Mesh objects.
I have not found any pattern yet, sometime it happens only 1 or 2 times after a lot of time, while more rarely it happens for longer bursts.

If I had to guess it looks like a possible buffer overflow.

Steps to Reproduce

I will update this once I manage to reproduce it in a small example.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: GraphicsIssues related to graphics/rendering.Status: Needs ReplicatingIndicates that the issue cannot be replicated - this doesn't necessarily mean it's invalid!Type: BugProblems with the code/documentation that need to be fixed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions