[Mesa-dev] gl requirements of UBO size alignments?

Roland Scheidegger sroland at vmware.com
Fri May 1 10:53:24 PDT 2015


Hi,

this is sort of a revisit of a topic discussed here,
http://lists.freedesktop.org/archives/mesa-dev/2015-April/082199.html
but this time aimed squarely at GL itself.

Do uniform buffer objects need the size to be a multiple of
UNIFORM_BUFFER_OFFSET_ALIGNMENT or not?

The problem here is the state tables say this applies to both offset and
size of UBOs.
However, BindBufferRange does NOT need size to be aligned to it (and
from the ARB_ubo history, the language generating an error there was
removed at some point).

Plus, if the size of the UBO needs to be a multiple of the offset
alignment, this actually looks problematic (other than for never
generating an error): The spec says the workaround for implementations
which can't support any offsets for UBOs is to set a "sufficently large"
UNIFORM_BUFFER_OFFSET_ALIGNMENT value. This, in the end, would mean that
for such implementations always the maximum allowed UBO size would have
to be allocated (as there is no other such sufficiently large value),
which doesn't seem reasonable (?).

So, what's the answer there? I'm just trying to figure out if I need to
fix the piglit test (trivial...) or the driver (a bit more work...).

Roland



More information about the mesa-dev mailing list