[Mesa-dev] More UBOs: std140 layout test works.

Eric Anholt eric at anholt.net
Mon Jul 2 17:38:09 PDT 2012


Here's a new pile of UBO stuff.  It gets things through the linker and
answers some more API queries.  It doesn't include the driver backend
yet.  I have some WIP code that's getting a lot of rendering to work,
so I'm pretty convinced that this chunk of code won't require a lot of
work.  However, I'm thinking I want to do a lowering pass in the
middle that simplifies the driver implementation.

Check out the ubo branches of my trees if you just can't get enough
and want to look ahead at what's coming.  That branch passes all the
piglit, except for row_major rendering tests, rendering failures on
maxblocks, and I haven't updated piglit for the conclusion about
GenBuffers vs BindBufferBase/Range.

There are a couple of things I'm not sure about in the current
implementation:

- struct gl_uniform_buffer_variable.

There is one of these per ir_variable.  My theory was that we wanted
something that doesn't get dead-code eliminated (due to std140
requirements) and was easy to walk over for doing layout at link time.
But we could potentially pull std140 layout to ast_to_hir time, make
sure the ir_variables stayed around, and reference those from the
struct gl_uniform_buffer.  I ended up preventing dead code elimination
because it was part of making std140 layout work, anyway

- struct gl_uniform_buffer in the linked program.

This is an extra copy of the uniform buffer layouts mostly used to
answer the getters.  We could potentially just have references to the
gl_uniform_buffers in one of the linked shaders instead of keeping an
extra copy in the program.



More information about the mesa-dev mailing list