Mesa (staging/19.2): gallium/osmesa: Fix the inability to set no context as current.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 23 18:32:12 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: 6485fd83623099034727f14ba9253941fcfc6725
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6485fd83623099034727f14ba9253941fcfc6725

Author: Hal Gentz <zegentzy at protonmail.com>
Date:   Sun Sep 15 15:29:50 2019 -0600

gallium/osmesa: Fix the inability to set no context as current.

Currently there is no way to make no context current w/gallium + osmesa.
The non-gallium version of osmesa does this if the context and buffer
passed to `OSMesaMakeCurrent` are both null. This small change makes it
so that this is also the case with the gallium version.

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Hal Gentz <zegentzy at protonmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit 57c894334ee14c7075bc8c1fb8ff180631ccb527)

---

 src/gallium/state_trackers/osmesa/osmesa.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 41ff9216fc6..97db3d15653 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -760,6 +760,11 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
    struct osmesa_buffer *osbuffer;
    enum pipe_format color_format;
 
+   if (!osmesa && !buffer) {
+      stapi->make_current(stapi, NULL, NULL, NULL);
+      return GL_TRUE;
+   }
+
    if (!osmesa || !buffer || width < 1 || height < 1) {
       return GL_FALSE;
    }




More information about the mesa-commit mailing list