mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
egl: use a non-kms_swrast check for swapbuffers DRI2_FLUSH
only swrast (non-kms) doesn't support this Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30494>
This commit is contained in:
parent
a04f8cba53
commit
0ff37e7591
1 changed files with 20 additions and 22 deletions
|
|
@ -1706,29 +1706,27 @@ dri2_flush_drawable_for_swapbuffers_flags(
|
||||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||||
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw);
|
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw);
|
||||||
|
|
||||||
if (dri2_dpy->flush) {
|
/* flush not available for swrast */
|
||||||
if (dri2_dpy->flush->base.version >= 4) {
|
if (dri2_dpy->swrast_not_kms)
|
||||||
/* We know there's a current context because:
|
return;
|
||||||
*
|
|
||||||
* "If surface is not bound to the calling thread’s current
|
|
||||||
* context, an EGL_BAD_SURFACE error is generated."
|
|
||||||
*/
|
|
||||||
_EGLContext *ctx = _eglGetCurrentContext();
|
|
||||||
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
|
|
||||||
|
|
||||||
/* From the EGL 1.4 spec (page 52):
|
/* We know there's a current context because:
|
||||||
*
|
*
|
||||||
* "The contents of ancillary buffers are always undefined
|
* "If surface is not bound to the calling thread’s current
|
||||||
* after calling eglSwapBuffers."
|
* context, an EGL_BAD_SURFACE error is generated."
|
||||||
*/
|
*/
|
||||||
dri2_dpy->flush->flush_with_flags(
|
_EGLContext *ctx = _eglGetCurrentContext();
|
||||||
dri2_ctx->dri_context, dri_drawable,
|
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
|
||||||
__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_INVALIDATE_ANCILLARY,
|
|
||||||
throttle_reason);
|
/* From the EGL 1.4 spec (page 52):
|
||||||
} else {
|
*
|
||||||
dri2_dpy->flush->flush(dri_drawable);
|
* "The contents of ancillary buffers are always undefined
|
||||||
}
|
* after calling eglSwapBuffers."
|
||||||
}
|
*/
|
||||||
|
dri2_dpy->flush->flush_with_flags(
|
||||||
|
dri2_ctx->dri_context, dri_drawable,
|
||||||
|
__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_INVALIDATE_ANCILLARY,
|
||||||
|
throttle_reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue