[Mesa-dev] [PATCH 00/11] Implement GL_ARB_vertex_attrib_binding

Eric Anholt eric at anholt.net
Wed Oct 30 19:53:08 CET 2013


Fredrik Höglund <fredrik at kde.org> writes:

> This extension decouples the vertex attributes from the vertex buffer
> bindings, making it possible to change buffers without having to
> respecify the formats.  The mapping between attributes and vertex
> buffer bindings also becomes configurable.

Patch 5 as posted doesn't compile.  I applied this:

@@ -105,16 +105,18 @@ type_to_bit(const struct gl_context *ctx, GLenum type)
 static inline struct gl_vertex_attrib_array *
 gl_vertex_attrib_array(struct gl_context *ctx, GLuint index)
 {
+   struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
    ASSERT(index < Elements(arrayObj->VertexAttrib));
-   return &ctx->Array.ArrayObj->VertexAttrib[index];
+   return &arrayObj->VertexAttrib[index];
 }

Also, when posting a big series that's likely to conflict soon, it's
nice to put it in a personal repo so people can just grab it instead of
applying it off the list.  I had to resolve a few conflicts from atomic
counters.

> This series adds new state structs and changes the gl*Pointer()
> functions to update the new states as described in the specification.
> To avoid making invasive changes in the vbo module I decided to keep
> the gl_client_arrays for now.  Those are now derived from the
> gl_vertex_attrib_array and gl_vertex_buffer_binding states.
> In theory this should also make it possible to incrementally port
> other parts of Mesa to use the new states directly.

I decided to check if the overhead of the computed state was a problem,
and on INTEL_NO_HW=1 cairo-gl I saw no effect (n=3).

> Note that this adds a glVertexAttribLFormat() entry point.
> Mesa doesn't support double-precision attributes (yet), but the
> GL specification says that the results of using a glVertex*L*()
> function to set a non-double precision attribute are undefined,
> so I don't think this is a problem.
>
> The extension is written against the GL 4.2 specification, and
> based on the tables it refers to one can infer that it requires
> ARB_vertex_array_bgra, ARB_vertex_type_2_10_10_10_rev and
> ARB_ES2_compatibility.  I think the dependencies section should
> have language that removes references to vertex formats added by
> those extensions when they're not supported, so in this series
> I have enabled the extension unconditionally.

Agreed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131030/6a84c5c2/attachment.pgp>


More information about the mesa-dev mailing list