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:
Mathias Fröhlich 2019-05-08 08:07:24 +02:00 committed by Mathias Fröhlich
parent 15cb19ed6f
commit 1d0a8cf40d
1 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,7 @@
#include "main/api_exec.h"
#include "main/context.h"
#include "main/extensions.h"
#include "main/fbobject.h"
#include "main/formats.h"
#include "main/framebuffer.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;
if (!fb)
if (!fb || fb == _mesa_get_incomplete_framebuffer())
return;
get_window_size(fb, &width, &height);
@ -877,6 +878,12 @@ dri_make_current(__DRIcontext * cPriv,
mesaDraw = &draw->Base;
mesaRead = &read->Base;
}
else {
struct gl_framebuffer *incomplete
= _mesa_get_incomplete_framebuffer();
mesaDraw = incomplete;
mesaRead = incomplete;
}
/* check for same context and buffer */
if (mesaCtx == _mesa_get_current_context()