OpenGL 3.4 / 4.1: Expectations / Wish-list (DSA!)
Oh Jesus Christ. âDirect State Access (DSA) is the most wanted feature for OpenGL 3.4 and OpenGL 4.1 by most serious OpenGL developers.â I call total BS on this statement. And considering that itâs the very first sentence, that does not bode well for the rest.
The presence or absence of DSA doesnât prevent you from getting your work done. The only thing it might prevent is a reasonable multithreaded implementation. Important, yes. But far from overwhelming. The simple fact is this: except for the multithreading issue (which I admit isnât something one should easily gloss over, but it does require additional API support), what are you going to do with DSA that you could not do without it?
Nothing. It is pure convenience.
When there are real problems and needs with regard to the API, convenience is a luxury.
Currently, at linking the compiler need to link the output variables of the vertex shader to the input variables of the fragment shader using the variable string name. With explicit varying location, this task would disapear: output vertex shader variable with location 0 would automatically communicate with input fragment shader variable with location 0 automatically.
So you get to name things by different names in different stages. Again: pure convenience; the types still have to match. Personally, I prefer names. They have an actual meaning, unlike a number which doesnât.
And having the same variable defined with different names in different places is pretty much the definition of âconfused logicâ.
VAO alternative idea with explicit binding points and layout sharing:
Thatâs a pretty terrible idea. The offsets are baked into the format, and you can only bind the buffer objectâs base. Because the bindless âhandlesâ are simply GLuint64âs, you can âbindâ any arbitrary number. This allows you to put multiple meshes with the same format in the same buffer, and simply âbindingâ a different set of addresses for each attribute in each mesh. To make this work, you need to be able to use something like glBindBufferRange.
More important than that, by NVIDIAâs admission, the reason bindless gets its performance advantage is from cache issues. Cache issues specifically related to having to read data from buffer objects. Making the user bind buffer objects more frequently is not the way to solve this problem. The performance benefits come from locking the buffer, not from rearranging commands.