On Mon, 2009-12-07 at 05:01 -0800, Marek Olšák wrote: > Hi, > > Because some hardware under some circumstances (e.g. disabled tiling) > may not be able to use a hardware-specific clear path, it would be > nice to let a state tracker do the clearing by drawing a > screen-aligned quad. I am proposing to change the pipe_context->clear > function to return TRUE if buffers were cleared by the driver, and > FALSE if the state tracker should do the clearing by taking a generic > path. > > As an example, r300g can use the fast clearing only if colorbuffers > and zbuffers are micro-tiled, otherwise it must draw a screen-aligned > quad and doing it in the driver is really messy. > > The attached patch implements this interface change and adapts all > state trackers and drivers. > > I noticed that a lot of drivers still use slow util_clear, so they > will greatly benefit from this patch. It's up to their maintainers > whether they enable it, I suspect some unstable drivers may not be > able to draw a quad without visual errors. > > Please review.
Marek, I think I'd prefer a scheme where we make it easier for the drivers to do whatever they need internally to get clears done. This is mainly for consistency with the rest of Gallium, where once we ask a driver to do something, the contract is that it will get done, and that the state-tracker can have a good idea about what a driver's capabilities are ahead of time. In terms of this, it seems what we're really missing to allow drivers to call equivalents of util_draw_quad() and friends is a way to save/restore the current bound state which will get clobbered running the quad blitter. Providing a general facility to support this in the driver gives the equivalent functionality of this fallback patch on every path which could potentially do this type of fallback, as opposed to adding return values and dealing with fallbacks in every state tracker. So, I think I'll be naking this patch, but I recognise the issue and would be interested to see ways that we can enable the driver to call some driver-side equivalent of util_draw_quad() or similar to achieve the clear. Keith ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
