OpenGL set a vertex element stride of zero Problem X: I need to provide "compensation" streams for attributes that are not plugged by the mesh data, but the shader requires them.
(In d3d not matching the input layout is a hard error)

Solution Y: In D3D I've created a 16 bytes buffer initialized with some default color (when the missing semantic is color, let's take this as my typical use case) and specified a stride of zero so that one element is repeated whatever the index in the index buffer, and this way I don't need to clog VRAM with the biggest buffer that's necessary to cover all objects. This works in D3D.

But looking at glVertexAttribPointer I see that the API is eating away my stride and makes it automatic when I specify zero.

Any workaround ?
Disable the vertex attrib array and use glVertexAttrib to set the data that should be used.