(GL 4.6) How to write parameter buffer from shaders?

Khronos recently released the OpenGL 4.6 spec which incorporates the ARB_indirect_parameters extension.
While it’s rather obvious how to use the new functions (f.e. glMultiDrawElementsCount) it is not clear how one can fill the parameter buffer in a shader as glBindBufferBase doesn’t accept the GL_PARAMETER_BUFFER enum (according to the spec.).

So my questions are:
[li]how do I write this buffer from a shader
[/li][li]how do I write this buffer with transform feedback

Buffer objects are not typed. There is no such thing as a “parameter buffer,” “vertex buffer,” “pixel buffer,” or anything. There are just buffer objects, and the various ways in which they can be used. Any buffer object can be used with any of the buffer object usages.

So if you have a buffer, you can write to it from a shader using any of the ways of doing so. Atomic counters, image load/store to buffer textures, SSBOs, etc. After that’s done, bind it to the GL_PARAMETER_BUFFER bind point and render.

… that being said, I just realized something. The ARB neglected to add a glMemoryBarrier bit for parameter buffer usage. So you actually can’t use image load/store or SSBOs to write, since there’s no barrier to make those writes visible.

Thanks, that was my first thought too, I just wanted confirmation. The GL standard is a little confusing in this regard, with all its buffer bindings etc.
In Metal for example you really have just one general-purpose buffer concept, and you can use it for whatever you want to.

That’s what you have in OpenGL too.

The difference is that instead of always passing in these buffer objects as parameters to functions that use them (e.g. glVertexAttribPointer), you sometimes bind them to context-provided buffer bind targets first, and then those API calls read the buffer handles from there. The bind targets behave as implicit parameters to those functions.