Code Monkey home page Code Monkey logo

Comments (5)

rune-scape avatar rune-scape commented on May 12, 2024 1

I understand now, I was just a bit confused by the automated project management stuff. Thank you.

And good luck with vulkan!

from magnum-integration.

mosra avatar mosra commented on May 12, 2024

Hi!

This is not related to ImGui, but rather to the way how Magnum tracks OpenGL state in general -- in order to avoid redundant OpenGL calls, Magnum remembers what buffers / VAOs / textures ... are bound and what shaders are used. Doing it like this leads to significant perf improvements where the cost of GL API calls is high, especially Emscripten and shitter mobile drivers.

But of course this breaks when you (or some 3rd party lib) accesses GL directly, and in that case Magnum gets confused and assumes a particular state is set while it isn't. To fix that, you need to inform Magnum's state tracker before and after the direct GL access is happening. Docs: https://doc.magnum.graphics/magnum/opengl-wrapping.html#opengl-state-tracking

Hope this helps! :)

from magnum-integration.

rune-scape avatar rune-scape commented on May 12, 2024

Yes, thank you!

Is this on the milestone to do better state tracking? or automatic state tracking? or something else?

from magnum-integration.

rune-scape avatar rune-scape commented on May 12, 2024

I just realize you may not have wanted me to close this

from magnum-integration.

mosra avatar mosra commented on May 12, 2024

How do you mean, better? :) There's not really a way to handle this automatically and still be performant enough -- the "safe bet" which works with 3rd party GL code would be that every API assumes no state is set to desired values and always bind / use / set ... everything needed upfront, and then reset all that back so 3rd party GL code isn't affected by what magnum did. That's what I was doing originally back in ~2010 but that made the driver waste a lot of time compared to what it does now. So there's not really much to do now (except for adding similar state tracking for a bunch of features that don't have it yet).

In comparison, with Vulkan (that's on the roadmap) this whole global driver state is gone and this is not a problem there anymore.

Hope that explains it :)

from magnum-integration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.