[Mesa-dev] [PATCH 01/10] st/mesa: use bitshifting to define state flags

Brian Paul brianp at vmware.com
Wed Apr 18 09:41:56 PDT 2012


On 04/18/2012 10:28 AM, Mathias Fröhlich wrote:
>
> Hi,
>
> On Wednesday, April 18, 2012 18:22:48 Marek Olšák wrote:
>>> BTW, the gl_array_attrib::NewState field is assigned to but never used
>>> anywhere.  Want to remove it too?
>>
>> Hi Brian,
>>
>> I didn't remove it because I thought it would be useful in the future.
>> I wouldn't oppose somebody else removing it though.
> I was thinking about this too.
> But I agree with Marek.
>
> IMO It might be helpful to move this in the long term into gl_array_object and
> track this there, but that kind of information can safe us a lot of work in
> the end while updating array state.

Yes.  I actually started some work on that a while back but never got 
back to it.  I don't think there'd be any harm in moving the field so 
I'll go dig up that patch.

My goal was to explore having an st_array_object subclass of 
gl_array_object that would contain pipe_vertex_buffer and 
pipe_vertex_element state.  It would only have to be updated when that 
array object's state changed.

While not many apps use array objects yet, those that did could avoid 
some (most?) of the draw/array-releted state validation when they did:

create_array_objects();
...
glBindVertexArray(1);
glDrawArrays();
glBindVertexArray(2);
glDrawArrays();
etc..

I started plumbing a gl_array_object pointer through the VBO code but 
never finished.

-Brian


More information about the mesa-dev mailing list