-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global OpenGL state #8
Comments
That's expensive to do (getting, and then resetting). I don't see where you think this will matter for DSA |
I agree with Nick. Most of the time you don't care about resetting the state as you have to set up the entire state anyways when doing anything. As for setting and restoring state, you can use |
Yeah, you are totally right, but as I said it'd be only for debug purposes (I swear :D) About DSA, it's a way to say to gln to use DSA version or not whenever we have to retrieve/set identifiers parameters Like, at the start, you check if you have DSA and then you set it
I don't recall that function going through all the core gl classes, and indeed it looks it's deprecated One cool features to have, I thought about, is also a function that will print out in console (or some other smarter way) all the states which are not default, that is all those who are currently affected by your code till that point. |
Regarding the |
Maybe something like this? I see what you mean with the things in gl11, but this option only adds runtime overhead to those that request it |
That could be modified to hold variables, but keep the tracking enabled/disabled part. Thoughts? |
it looks overkill for me, but I feel the idea has a lot of potential though. Let's keep this in the air for further updates |
thoughts on https://gist.github.com/Sylvyrfysh/ed8297d9680f90844df079541359d9d7 ? dsa like, that could be a use case |
The DSA looks also interesting indeed. Honestly I always thought (and implemented so far) only the arb one. But we could support also the ext one. Ps: what's the |
Just plain GL45 dsa calls. Since that's when it became core |
Thoughts on the two last commits at https://github.com/kotlin-graphics/gln/commits/more-state ? The framebuffer one might be overreaching, but I thought that you guys might have different ideas on what should be tracked. The first commit is the more important one, as it explicitly tracks what the last logicop and cullface were set to. This would be a negative if the user is using an external library that does not use GLN, as it no longer queries the GL as to what is actually active. |
The framebuffer one might indeed be overreaching, but we can leave it as it is until we reach some more firm point, it won't hurt. The logicOp and cullFace is instead more important and useful, querying the state on the java client side is definitely much faster than querying gl, everything happens under the jvm (included optimization), no native call involved. To avoid confusion/problems with the user using an external library, this shall be definitely mentioned in the manual, feel free to modify it. I still didnt care for a clean struct atm, it's still highly wip |
globjects poses a very interesting matter about the opengl state
From their readme
"
State
OpenGL state is wrapped as States, StateSettings and Capabilities, where the latter two are mainly used internally.
I like the idea to have a determined place where we can set important variables. In the sample he uses ImmediateMode, but I'm thinking more about using DSA (Direct State Access) or not. Atm DSA is just a top variable to say..
Also, sometimes, for debug purposes, I always missed a confortable way to reset the whole current gl state in a specific point.
Having something like
state::reset
looks wonderful under this point of view..The text was updated successfully, but these errors were encountered: