[Mesa-dev] [PATCH 1/3] glx: remove glFlush call in glXSwapBuffers

Marek Olšák maraeo at gmail.com
Thu Nov 8 11:08:59 PST 2012


On Thu, Nov 8, 2012 at 7:59 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 11/08/2012 05:48 AM, Marek Olšák wrote:
>>
>> Flushing here is unnecessary. The drivers which always flush in
>> dri2Throttle
>> or __DRI2flushExtensionRec::flush are just wasting time here.
>>
>> st/mesa is updated to do what glFlush does.
>>
>> XXX I guess some other drivers should be updated to flush by themselves
>>      if they don't?
>> ---
>>   src/glx/glxcmds.c                    |    4 ----
>>   src/mesa/state_tracker/st_cb_flush.c |    1 +
>>   2 files changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
>> index 394bf59..22392bc 100644
>> --- a/src/glx/glxcmds.c
>> +++ b/src/glx/glxcmds.c
>> @@ -781,10 +781,6 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
>>         __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
>>
>>         if (pdraw != NULL) {
>> -         if (gc && drawable == gc->currentDrawable) {
>> -            glFlush();
>> -         }
>> -
>
>
> This will completely break if the user has a new libGL with an old driver.
> Our story for all the DRI1 drivers that we removed from the tree was that
> we'd maintain loader / driver compatibility.

Could a version check be added somewhere to make sure glFlush is
called with old drivers, but not with the latest drivers which want to
flush by themselves?

It looks like there's an awful amount of code for something that is
just a driver loader.

Marek


More information about the mesa-dev mailing list