[Mesa-dev] [PATCH 0/3] Removing unnecessary flushes in Gallium

Mark Mueller markkmueller at gmail.com
Thu Mar 10 14:02:19 PST 2011

On Thu, Mar 10, 2011 at 12:56 PM, Brian Paul <brianp at vmware.com> wrote:

> On 03/10/2011 12:25 PM, Marek Olšák wrote:
>> Hi,
>> I have reviewed where we call flush() and why and some of them
>> seem unnecessary to me. Those flushes may slightly decrease
>> performance, depending on each driver, and may hide driver bugs.
>> glFlush doesn't have to be called in OpenGL so often, and
>> I think state trackers should follow suit.
>> The worst example of this is st/vega. I guess those flushes are
>> there for debugging only.
>> Please review.
>> Marek Olšák (3):
>>       st/mesa: remove unnecessary flushes
>>       st/vega: remove unnecessary flushes
>>       draw: remove unnecessary flush
>>  src/gallium/auxiliary/draw/draw_pipe_pstipple.c |    7 -------
>>  src/gallium/auxiliary/util/u_gen_mipmap.c       |    2 --
>>  src/gallium/state_trackers/vega/api_images.c    |    4 ----
>>  src/gallium/state_trackers/vega/image.c         |    8 --------
>>  src/gallium/state_trackers/vega/mask.c          |    2 --
>>  src/mesa/state_tracker/st_cb_fbo.c              |    3 ---
>>  6 files changed, 0 insertions(+), 26 deletions(-)
> If there aren't any regressions with piglit and the OpenVG demos, looks
> good.

Some time back I did some heavy duty vega work that was focused specifcally
on conformance and found the flushes to be important, but that was also on a
version of gallium much older than today's code, which I am not as familiar
with. Thus YMMV... from my own.

One example is that OpenVG uses blend modes that generally aren't supported
in most hardware, thus a custom shader is loaded that samples from a texture
created immediately prior to the draw via a blt of the actual render target.
The flush was important in this case to make sure that the frame buffer was
current prior to the creation of that texture copy. My memory is vague but I
believe this also applied to mask, filters... probably others in there too.
If the render target is safely current without the flush in today's gallium,
then the flush probably servers no purpose.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110310/669a3a37/attachment.htm>

More information about the mesa-dev mailing list