Mesa (main): glx/drisw: invalidate drawables upon binding context if flush extension exists

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 22 02:56:03 UTC 2022


Module: Mesa
Branch: main
Commit: ea005c9e0470adbaa167b6a1d2da5f04efe2035a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea005c9e0470adbaa167b6a1d2da5f04efe2035a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jun 20 15:37:46 2022 -0400

glx/drisw: invalidate drawables upon binding context if flush extension exists

this forces surface resize as expected

cc: mesa-stable

fixes #6706

Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17147>

---

 src/glx/drisw_glx.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index a9c6aac40b3..9d3bfeb31b9 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -439,12 +439,18 @@ drisw_bind_context(struct glx_context *context, struct glx_context *old,
 
    driReleaseDrawables(&pcp->base);
 
-   if ((*psc->core->bindContext) (pcp->driContext,
+   if (!(*psc->core->bindContext) (pcp->driContext,
                                   pdraw ? pdraw->driDrawable : NULL,
                                   pread ? pread->driDrawable : NULL))
-      return Success;
+      return GLXBadContext;
+   if (psc->f) {
+      if (pdraw)
+         psc->f->invalidate(pdraw->driDrawable);
+      if (pread && (!pdraw || pread->driDrawable != pdraw->driDrawable))
+         psc->f->invalidate(pread->driDrawable);
+   }
 
-   return GLXBadContext;
+   return Success;
 }
 
 static void



More information about the mesa-commit mailing list