Multi-Draw Indirect (MDI) FunctionsĪnother feature expanded in recent versions of OpenGL is the set of MDI functions, which allow a large list of parameters for draws to be placed in a buffer object and then sent to the GPU at once.
Demonstrations of using persistent mapped buffers for shader parameters, vertex data, and texture data are included with the book's sample code in the pmbstreaming, ompparticles, and pmbfractal examples, respectively. This change allows an application to share a piece of memory between the CPU and GPU, and even deal with synchronization itself, which has implications for multithreading, fine-grained work generation, and efficient read-backs from the GPU to the CPU. OpenGL 4.4 made this use legal and well defined, so long as the application specifies its intention to use the buffer this way when it's allocated. Sometimes this kind of rendering would work, sometimes it would generate an error, and sometimes it wouldn't work but also wouldn't generate an error.
However, because the overhead is so great for a driver to attempt to figure out whether any mapped buffer might be used by a particular draw, it wasn't guaranteed that you'd actually see that error, and most drivers didn't do the check at all. In prior versions of OpenGL, it was an error to attempt to render from a buffer while that buffer was mapped. Possibly the most interesting of the new features introduced since OpenGL 4.3 is persistent mapped buffers, which were included with the GL_ARB_buffer_storage extension and are now part of OpenGL 4.4 and 4.5. However, these features represent the cutting edge of graphics technology at this point in 2015, OpenGL is the only way to get them. Because these extensions have become more ubiquitous, I decided to showcase them. This marks a departure from the previous edition, in which I stayed away from extensions in order to ensure the widest possible user base for the code. The book contains examples of the use of all of these features, some of which are available only on very recent hardware with up-to-date drivers that expose specific extensions. Arrayed indirect draws (multi-draw indirect, or MDI).Zero-copy features enabled by persistent mapped buffers.Some key topics addressed in this latest edition are part of what has become known as the "Approaching Zero Driver Overhead" (AZDO) suite of features: However, I believe there is still a place for the venerable OpenGL, which is why OpenGL SuperBible, Seventh Edition incorporates new features from OpenGL 4.5 and brings in discussion of extensions. I am actually involved in the development of Vulkan, Khronos Group's new graphics and compute API. Over the last few months in 2015, we have heard a lot of talk about new APIs and how they enable new rendering effects and unprecedented performance. OpenGL Superbible: Comprehensive Tutorial and Reference, 7th Edition