mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
glx: Fix GLX_SGI_video_sync for the no-current-drawable case
Starting with GL 3.0 it's legal to have no drawable bound to the current context. GLX_SGI_video_sync doesn't take a drawable for an argument so it implicitly operates on... something. NVIDIA's driver throws GLX_BAD_CONTEXT for GetVideoSync, but WaitVideoSync seems to actually wait for the next MSC on the context's screen. We could work around this by internally creating/destroying a GLXWindow for the root window, but for Xwayland there's not necessarily a good answer it can return. Just throw GLX_BAD_CONTEXT for both. Fixes: mesa/mesa#1207 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8334>
This commit is contained in:
parent
88ca480c8b
commit
acaf07c24b
1 changed files with 6 additions and 0 deletions
|
|
@ -1888,6 +1888,9 @@ glXGetVideoSyncSGI(unsigned int *count)
|
|||
if (!gc->isDirect)
|
||||
return GLX_BAD_CONTEXT;
|
||||
|
||||
if (!gc->currentDrawable)
|
||||
return GLX_BAD_CONTEXT;
|
||||
|
||||
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
|
||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||
|
||||
|
|
@ -1926,6 +1929,9 @@ glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
|
|||
if (!gc->isDirect)
|
||||
return GLX_BAD_CONTEXT;
|
||||
|
||||
if (!gc->currentDrawable)
|
||||
return GLX_BAD_CONTEXT;
|
||||
|
||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue