summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2019-05-08 08:07:24 +0200
committerMathias Fröhlich <[email protected]>2019-05-28 08:27:16 +0200
commit1d0a8cf40d87ee903d7738f05bf87fd4141ce40d (patch)
treec3c61aa6bdc534bb220a4698cff3053cda67572a /src/mesa/drivers/dri
parent15cb19ed6fb32c707de667c95819e090ee5dc140 (diff)
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 94758e60862..8e8d6bd628e 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -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()