egl: disable partial redraw when gallium hud is active

We draw the gallium hud directly to the rendered buffer, meaning that if
the buffer age is queried and then a partial redraw is done, we get a
ghosting effect from the hud drawn in previous frames.

Since we need to draw the hud with updated values every frame anyway,
there's no harm in disabling the buffer age and partial redraw.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Chris Healy <cphealy@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20387>
This commit is contained in:
Italo Nicola
2022-12-14 20:29:14 -03:00
committed by Marge Bot
parent 86532fa21d
commit e516a0a94f
3 changed files with 7 additions and 1 deletions

View File

@@ -697,6 +697,9 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
disp->Options.Zink = env && !strcmp(env, "zink");
disp->Options.ForceSoftware |= disp->Options.Zink;
const char *gallium_hud_env = getenv("GALLIUM_HUD");
disp->Options.GalliumHud = gallium_hud_env && gallium_hud_env[0] != '\0';
/**
* Initialize the display using the driver's function.
* If the initialisation fails, try again using only software rendering.

View File

@@ -203,6 +203,7 @@ struct _egl_display
struct {
EGLBoolean Zink; /**< Use kopper only */
EGLBoolean ForceSoftware; /**< Use software path only */
EGLBoolean GalliumHud; /**< Using gallium hud, disable buffer age */
EGLAttrib *Attribs; /**< Platform-specific options */
int fd; /**< platform device specific, local fd */
} Options;

View File

@@ -564,7 +564,9 @@ _eglQuerySurface(_EGLDisplay *disp, _EGLSurface *surface,
ctx->DrawSurface != surface)
return _eglError(EGL_BAD_SURFACE, "eglQuerySurface");
EGLint result = disp->Driver->QueryBufferAge(disp, surface);
EGLint result = 0;
if (!disp->Options.GalliumHud)
result = disp->Driver->QueryBufferAge(disp, surface);
if (result < 0)
return EGL_FALSE;