[Mesa-dev] [PATCH 2/3] mesa: Mute arrays for Bitmap/CopyPixels/DrawPixels callbacks.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Mon Feb 5 22:19:28 UTC 2018


From: Mathias Fröhlich <Mathias.Froehlich at gmx.net>

Set the _DrawArray pointer to NULL when calling into the Drivers
Bitmap/CopyPixels/DrawPixels hooks. This fixes an assert that gets
uncovered with the following patch gets applied.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/main/drawpix.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index ec1d2618ca..05a18d3e51 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -37,6 +37,7 @@
 #include "dispatch.h"
 #include "glformats.h"
 #include "fbobject.h"
+#include "varray.h"
 
 
 /*
@@ -72,6 +73,9 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
     */
    _mesa_set_vp_override(ctx, GL_TRUE);
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    /* Note: this call does state validation */
    if (!_mesa_valid_to_render(ctx, "glDrawPixels")) {
       goto end;      /* the error code was recorded */
@@ -228,6 +232,9 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
     */
    _mesa_set_vp_override(ctx, GL_TRUE);
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    /* Note: this call does state validation */
    if (!_mesa_valid_to_render(ctx, "glCopyPixels")) {
       goto end;      /* the error code was recorded */
@@ -320,6 +327,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
    if (ctx->RasterDiscard)
       return;
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    if (ctx->RenderMode == GL_RENDER) {
       /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
       if (width > 0 && height > 0) {
-- 
2.14.3



More information about the mesa-dev mailing list