Skip to content

OpenGL: Mesa renderer crashes when creating a new buffer inside SyncScript Update #3138

@xianbaum

Description

@xianbaum

Release Type: Official Release

Version: 4.3.0.2507 and master branch

Platform(s): Linux, OpenGL mesa (possibly other OpenGL platforms)

Describe the bug
The indexBuffer in the CommandList becomes unbound when a new buffer is created, but it is still treated as bound. This causes a crash in mesa in when called from DrawElements.

Minimal repro of bug. Can be cloned on Linux and ran

To Reproduce

  1. Be on Linux using mesa driver
  2. Create and add a model to the scene inside of a Start() script using Buffer.Index.New()
  3. Simply call Buffer.Index.New() inside of an Update() script while the scene is rendering
  4. Application will crash.

Expected behavior
Creating a buffer within SyncScript.Update() does not crash

Screenshots
N/A

Log and callstacks

Call stack of crash

More stack details & details of crash

Additional context

Inside Buffer.OpenGL.cs:Init, there is a commented out method call to an unimplemented UnbindVertexArrayObject.

                    // If we're on main context, unbind VAO before binding context.
                    // It will be bound again on next draw.
                    //if (!creationContext.UseDeviceCreationContext)
                    //    GraphicsDevice.UnbindVertexArrayObject();

I did not see an implementation in the git history, but I did see other commented out calls to it. Possibly related?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions