mesa: Prevent classic swrast crash on a surfaceless context v2.
This fixes the egl_mesa_platform_surfaceless piglit test as well as the new egl_ext_device_base piglit test on classic swrast. v2: Fix swrast surfaceless contexts on the driver side. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
parent
15cb19ed6f
commit
1d0a8cf40d
|
@ -36,6 +36,7 @@
|
||||||
#include "main/api_exec.h"
|
#include "main/api_exec.h"
|
||||||
#include "main/context.h"
|
#include "main/context.h"
|
||||||
#include "main/extensions.h"
|
#include "main/extensions.h"
|
||||||
|
#include "main/fbobject.h"
|
||||||
#include "main/formats.h"
|
#include "main/formats.h"
|
||||||
#include "main/framebuffer.h"
|
#include "main/framebuffer.h"
|
||||||
#include "main/imports.h"
|
#include "main/imports.h"
|
||||||
|
@ -679,7 +680,7 @@ swrast_check_and_update_window_size( struct gl_context *ctx, struct gl_framebuff
|
||||||
{
|
{
|
||||||
GLsizei width, height;
|
GLsizei width, height;
|
||||||
|
|
||||||
if (!fb)
|
if (!fb || fb == _mesa_get_incomplete_framebuffer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
get_window_size(fb, &width, &height);
|
get_window_size(fb, &width, &height);
|
||||||
|
@ -877,6 +878,12 @@ dri_make_current(__DRIcontext * cPriv,
|
||||||
mesaDraw = &draw->Base;
|
mesaDraw = &draw->Base;
|
||||||
mesaRead = &read->Base;
|
mesaRead = &read->Base;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
struct gl_framebuffer *incomplete
|
||||||
|
= _mesa_get_incomplete_framebuffer();
|
||||||
|
mesaDraw = incomplete;
|
||||||
|
mesaRead = incomplete;
|
||||||
|
}
|
||||||
|
|
||||||
/* check for same context and buffer */
|
/* check for same context and buffer */
|
||||||
if (mesaCtx == _mesa_get_current_context()
|
if (mesaCtx == _mesa_get_current_context()
|
||||||
|
|
Loading…
Reference in New Issue