Marek, 

These patches look good, but have you covered the case where the application is 
changing the contents of vertex arrays without rebinding/notifying GL in any 
way? 


eg. an app could do: 


memcpy(varray, foo, ...); 
glDrawArrays(...); 
memcpy(varray, bar, ...); 
glDrawArrays(...); 


with these changes will drivers still notice the difference? 


Keith 

----- Original Message -----
From: "Marek Olšák" <mar...@gmail.com> 
To: mesa-dev@lists.freedesktop.org 
Sent: Saturday, February 12, 2011 7:05:27 PM 
Subject: [Mesa-dev] [PATCH 0/6] Mesa/Gallium vertex array state optimizations 

Hi, 

this patch series optimizes vertex array state changes in Mesa/Gallium. The 
problem with the vbo module and st/mesa is that it re-binds vertex arrays every 
draw operation instead of only when they get changed by the application, and 
this series aims to address that issue. 

Some new issues arose during the implemention though: 

1) The VBO module didn't notify the underlying driver when it was changing 
buffer offsets and other vertex array properties. This is fixed in the 1st 
patch. 

2) If we do not re-bind vertex arrays every draw operation, we must assure that 
the state is preserved after operations like glBlitFramebuffer. This is 
resolved in the 3rd patch using cso_cache. 

3) Unfortunately, user buffers must be mutable in order to prevent re-binding 
vertex buffers because we have no way to know how large they are. Instead, a 
new context hook has been added to Gallium called 'redefine_user_buffer', which 
notifies a driver that a subrange of a user buffer should be reuploaded, and 
also redefines its size. 

I've only tested softpipe and r300g and there were no regressions. r600g should 
also work and Christopher told me his Nouveau drivers should be ready for this 
series too. 

Please review. 

Marek Olšák (6): 
vbo: notify a driver that we change buffer offsets, strides, etc. 
vbo: bind arrays only when necessary 
gallium: always save and restore vertex buffers using cso_cache 
gallium: remove pipe_vertex_buffer::max_index 
st/mesa: set vertex arrays state only when necessary 
gallium: notify drivers about possible changes in user buffer contents 

Best regards 
Marek 

_______________________________________________ 
mesa-dev mailing list 
mesa-dev@lists.freedesktop.org 
http://lists.freedesktop.org/mailman/listinfo/mesa-dev 
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to