OpenGL Direct State Access (DSA)

Direct State Access or DSA is an useful OpenGL extension that allows to update (or query) OpenGL states in a direct way without using an OpenGL state selector. GL_EXT_direct_state_access is available for AMD Radeon cards since Catalyst 10.7 (July 2010) and since ForceWare 180.42 (October 2008) for NVIDIA GeForce boards. This extension should be supported (partially) by any OpenGL 2.1 compliant implementation and complete support should be available in any OpenGL 3.0 compliant implementation (please, correct me if I’m wrong).

DSA introduces new OpenGL functions like glProgramUniform_XXX_EXT() for setting GPU program uniform variables, or glFramebufferTexture2DEXT() for attaching a logical buffer to a FBO. All new functions and complete specification can be found here: GL_EXT_direct_state_access @ OpenGL registry.

I don’t understand how this can speed up much, other than from what I see is a few less function calls to setup the same operations… Seems to me people just wanted to call a bunch of ops in a single call or two… So if that is the case, this isn’t going to speed up GPU but maybe CPU cycles will be less now?

Rosario, the paper you linked is about the bindless extensions, not DSA.
DSA is more of an API change, away from that giant state machine to a more object orientated model.
The bindless extensions, however, allow you to query for the GPU internal 64bit addresses of objects and use those in subsequent calls. This frees the driver from looking up the addresses by name, which resulted in a likely cache-miss. Hence speeding up the whole thing.

Please correct me if I got it wrong or I didn’t get the point of your comment. 🙂

Yes, it just nice try to make API easier. We jump from bind-process-unbind model to create-direct_access. GPU will not work faster with that(I mean DSA), but CPU will be less busy by changing states, and that’s all. It is good only when application is CPU-bounded.

@Mars_999 It makes it a lot easier when you want to change one attribute about a state instead of switching the states, making the change, and then switching back. 3 lines versus one line. It’s also good if you want to create a utility library and are tired about making sure the state is the same as how it was when the function entered – less headaches, and cheaper than calling a glGet or pushing the state, doing the work and then restoring. I’m guessing there’s also benefits for it when mixing it in with display lists. It’s less about huge optimizations and more about elegance against clunky state management.