Unverified Commit 57c89433 authored by Freya Gentz's avatar Freya Gentz 🌱

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: Freya Gentz's avatarHal Gentz <zegentzy@protonmail.com>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent 6e4fd14b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment