[Intel-gfx] [RFC] DRI2 swapbuffers (yes yet again)

Jesse Barnes jbarnes at virtuousgeek.org
Fri May 1 17:22:53 CEST 2009


On Fri, 1 May 2009 04:06:09 +0200
Stefan Dösinger <stefan at codeweavers.com> wrote:

> Am Donnerstag, 30. April 2009 23:25:54 schrieb Ville Syrjälä:
> > > > Your interval handling seems to be too harsh. In case you wanted
> > > > something that can implement GLX_SGI_swap_control then AFAICS
> > > > the interval should only specify the minimum number of frames
> > > > that must pass between two swaps. Your code appears to always
> > > > delay the flip by exactly interval frames.
> > >
> > > The completion won't happen until at least 'interval' frames have
> > > passed since the flip was queued, so I think the semantics match?
> >
> > Well I guess it satisfies the requirement that flips will never
> > happen less than interval frames apart but if the application is
> > flipping at a slower rate anyway you still delay each flip by
> > interval frames even though there is no real need to do so. So it
> > increases the latency a bit. Also if/when you add support for
> > queueing multiple flips the code needs to be changed anyway to use
> > the previous flip rather than when the current flip was queued as
> > the reference.
> I just want to chime in and note that the behavior Ville describes is
> the default Direct3D behavior. Ie, if you perform a flip *after* the
> vertical blank since the last flip, the flip occurs immediately. Only
> if the flip happens before the next vblank it is delayed. To support
> this, wine needs GLX_SGI_swap_control support. (Luckily very few apps
> depend on it - so far I only know Need For Speed 3)
> 
> The behavior for the user is that if vsync is enabled at a refresh
> rate of, say, 60 HZ, the framerate will be capped at 60 HZ. However,
> if the game renders slower, e.g. at 48 FPS, it still gets the 48
> FPS(+tearing). The GLX_SGI_video_sync behavior would force the game
> down to 30 FPS(-tearing) to wait for the next vblank after the
> delayed sync. One could argue which one is better, it's just that D3D
> behaves the way it behaves and Wine needs GLX_SGI_swap_control to
> properly support it. So there are braindead apps out there that need
> it :-)

Ok, thanks a lot for the explanation, it definitely helps.  I guess we
have to support several modes of operation here in order to be broadly
compatible.

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list