Nomenclature/Direct State Access

From OpenGL Wiki
< Nomenclature
Revision as of 04:52, 15 April 2015 by Alfonse (talk | contribs) (Adding page about DSA nomenclature. It's a subpage so that it can be included in the nomenclature article as well as the DSA page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Nomenclature for Direct State Access is a bit more consistent than the non-DSA naming. Just as with functions that modify objects through the context, DSA functions apply an object-specific prefix to the function name. Unlike the context functions, all DSA functions consistently use the object prefix (even if it makes the function name unwieldy).

The unusual bit with DSA functions is that some of the prefixes will use Named as part of the prefix, while others do not. Fortunately, all functions within a particular object group will consistently use the same convention.

OpenGL Object Type Context Prefix DSA Prefix
Texture Object "Tex" "Texture"
Framebuffer Object "Framebuffer" "NamedFramebuffer"
Buffer Object "Buffer" "NamedBuffer"
Transform Feedback Object N/A1 "TransformFeedback"
Vertex Array Object "VertexAttrib" "VertexArray"
Sampler Object N/A2 "Sampler"
Query Object N/A2 "Query"
1: Transform feedback state consists only of the buffers bound to GL_TRANSFORM_FEEDBACK_BUFFER with glBindBufferRange, as well as a captured primitive count. As such, they never needed an object-based prefix. Direct state access gives transform feedback buffer attachment their own calls, so they need a prefix.
2: These object types already used DSA-style functions.

While these conventions are followed, there are functions where the object prefix does not come first in a function's name. All glGet functions put the object prefix after the "Get". This is also true for "Invalidate", "Map", "Unmap", "FlushMapped", "Enable", "Disable", "Clear", "Blit", "Copy", "Check", and "Compressed".