Ben brought this up offline, but I'm trying to move interface
discussions onto the mesa list. The initial proposal was to pass an
array of primitive descriptors into the pipe->draw_arrays() and
pipe->draw_elements() calls.
The motivation is reducing the number of state validation checks. From
my point of view, it's also good at reducing the map/unmap calls that we
do prior to calling into the draw module on swtnl cards.
This is OK, but I'd like to maintain a way to say whether an individual
primitive was successfully rasterized, eg the current BOOL return value
from the draw calls. One possibility is to have the new calls above
return the number of successfully rasterized primitives, but it's
getting a little complex.
Thinking about this a bit more, there are a couple of options with the
interface:
- draw multiple primitives in one call
- explicit validate_state() call that must precede any drawing
- explicit begin_draw() / end_draw() calls that surround drawing
It's worth noting that for many card the primitive being drawn is an
important piece of state, and many things can change depending on it.
For example some hardware needs a different vertex format for points vs
triangles, and other hardware needs to turn off stipple explicitly for
non-triangle primitives.
Reflecting this in the driver interface could be helpful, so eg:
- explicit begin_draw( unsigned primitive_mode ) / end_draw() calls
that surround rendering.
So that would look like:
begin_draw( TRIANGLES ) --> validates state, maps vertex buffers
draw_arrays( 10, 20 )
draw_arrays( 30, 40 )
draw_elements( 100 )
end_draw() --> unmaps vertex buffers
begin_draw( LINES ) --> validates state, maps vertex buffers
...
end_draw() --> unmaps vertex buffers
bind_state()
etc.
Another possibility is that all the mapping/unmapping could be optimized
a bit by playing pointer games with the pipe dispatch table.
Keith
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev