diff options
author | Hal Gentz <zegentzy@protonmail.com> | 2019-09-15 15:29:50 -0600 |
---|---|---|
committer | Hal Gentz <zegentzy@protonmail.com> | 2019-09-20 14:04:12 -0600 |
commit | 57c894334ee14c7075bc8c1fb8ff180631ccb527 (patch) | |
tree | 51ce0e82aa694698138115d81a36d9ac736b0667 | |
parent | 6e4fd14b0feb04d991e250792b013fee6758a1b3 (diff) | |
download | mesa-57c894334ee14c7075bc8c1fb8ff180631ccb527.tar.gz |
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@lists.freedesktop.org
Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | src/gallium/state_trackers/osmesa/osmesa.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c index 4660a53bfd2..8225860dfa8 100644 --- a/src/gallium/state_trackers/osmesa/osmesa.c +++ b/src/gallium/state_trackers/osmesa/osmesa.c @@ -770,6 +770,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; } |